/**
 * APA Format Converter & Generator Styles
 * Custom styles for enhanced user experience
 */

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Source type button enhancements */
.source-type-btn {
    position: relative;
    transition: all 0.2s ease-in-out;
}

.source-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.source-type-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* Form field enhancements */
.citation-form-field {
    animation: fadeInUp 0.3s ease-out;
}

.citation-form-field input:focus,
.citation-form-field textarea:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* Loading states */
.loading-overlay {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Citation output enhancements */
#citationOutput {
    animation: slideDown 0.4s ease-out;
}

#citationResult {
    font-family: "Georgia", "Times New Roman", serif;
    line-height: 1.8;
    text-align: left;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid #3b82f6;
    border-radius: 0.5rem;
    position: relative;
}

#citationResult::before {
    content: '"';
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
    font-size: 2rem;
    color: #3b82f6;
    opacity: 0.3;
}

/* Bibliography list enhancements */
.bibliography-item {
    transition: all 0.2s ease-in-out;
    border-left: 4px solid transparent;
}

.bibliography-item:hover {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateX(4px);
}

/* Button hover effects */
.btn-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.2s ease-in-out;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

/* Modal enhancements */
.modal-overlay {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    animation: slideDown 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Validation alert styles */
.validation-alert {
    animation: slideDown 0.3s ease-out;
    border-left: 4px solid #ef4444;
}

/* Toast notification styles */
.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Progress indicators */
.progress-bar {
    height: 2px;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    transition: width 0.3s ease-out;
}

/* Smart features section */
.smart-feature-card {
    transition: all 0.2s ease-in-out;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.smart-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
}

/* Quick tools button effects */
.quick-tool-btn {
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.quick-tool-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.quick-tool-btn:hover::before {
    left: 100%;
}

/* Format toggle buttons */
.format-toggle {
    background: #f1f5f9;
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.format-toggle .format-btn {
    transition: all 0.2s ease-in-out;
    border-radius: 0.375rem;
}

.format-toggle .format-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Citation checker styles */
.checker-results {
    animation: slideDown 0.3s ease-out;
}

.checker-valid {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.checker-invalid {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .source-type-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    #citationResult {
        font-size: 0.875rem;
        padding: 1rem;
    }

    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    #citationResult {
        background: white !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    .bibliography-item {
        page-break-inside: avoid;
        background: white !important;
        border: 1px solid #ccc !important;
    }
}

/* Focus management */
.focus-trap {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .source-type-btn {
        border-width: 2px;
    }

    .source-type-btn.active {
        background: #000;
        color: #fff;
        border-color: #000;
    }

    #citationResult {
        border: 2px solid #000;
        background: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    .citation-dark-mode {
        background: #1f2937;
        color: #f9fafb;
    }

    .citation-dark-mode #citationResult {
        background: #374151;
        color: #f9fafb;
        border-left-color: #60a5fa;
    }

    .citation-dark-mode .smart-feature-card {
        background: #374151;
        border-color: #4b5563;
    }
}
