/**
 * Common CSS styles shared across all templates
 * Invoice Classifier AI Application
 */

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* Common animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceGentle {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Enhanced animations for processing UI */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes floatGently {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

/* Glass card effect */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Primary button styles */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    min-height: 44px;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Upload area styles (specific to homepage) */
.upload-area {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #cbd5e1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-area:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #2563eb;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    transform: scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Result card styles */
.result-card {
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Common page layout */
.page-container {
    min-height: 100vh;
    background: linear-gradient(to bottom right, #f8fafc, #dbeafe, #e0e7ff);
}

/* Header styles */
.app-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Navigation styles */
.nav-link {
    color: #374151;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #2563eb;
}

.nav-link.active {
    color: #2563eb;
    font-weight: 600;
}

/* Language switcher dropdown */
.language-dropdown {
    position: absolute;
    right: 0;
    margin-top: 0.5rem;
    width: 8rem;
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    border: 1px solid #e5e7eb;
}

.language-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    transition: background-color 0.2s ease;
}

.language-option:hover {
    background-color: #f3f4f6;
}

.language-option.active {
    background-color: #f3f4f6;
}

/* Mobile menu styles */
.mobile-menu {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    padding: 1rem;
}

/* Footer styles */
.app-footer {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 4rem;
    padding: 3rem 0 2rem 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.footer-description {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 400px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.9375rem;
}

.footer-links a:hover {
    color: #2563eb;
}

.footer-bottom {
    border-top: 1px solid #e5e7eb;
    padding-top: 2rem;
    text-align: center;
}

.footer-copyright {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Social sharing button styles */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    color: white;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.social-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.social-btn.facebook {
    background-color: #1877f2;
}

.social-btn.facebook:hover {
    background-color: #166fe5;
}

.social-btn.twitter {
    background-color: #000000;
}

.social-btn.twitter:hover {
    background-color: #1f2937;
}

.social-btn.linkedin {
    background-color: #0a66c2;
}

.social-btn.linkedin:hover {
    background-color: #084c94;
}

.social-btn.whatsapp {
    background-color: #25d366;
}

.social-btn.whatsapp:hover {
    background-color: #22c55e;
}

.social-btn.telegram {
    background-color: #0088cc;
}

.social-btn.telegram:hover {
    background-color: #0074b3;
}

.social-btn.email {
    background-color: #6b7280;
}

.social-btn.email:hover {
    background-color: #4b5563;
}

.social-btn.copy {
    background-color: #7c3aed;
}

.social-btn.copy:hover {
    background-color: #6d28d9;
}

/* Animation utilities */
.animate-shimmer {
    animation: shimmer 2s infinite;
}

.animate-gradient-shift {
    animation: gradientShift 3s ease infinite;
}

.animate-float {
    animation: floatGently 3s ease-in-out infinite;
}

.animate-pulse-ring {
    animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

/* Animation delays */
.animation-delay-1000 {
    animation-delay: 1s;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-3000 {
    animation-delay: 3s;
}

/* Utility classes */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

.animate-bounce-gentle {
    animation: bounceGentle 2s infinite;
}

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Custom scrollbar for tables and content areas */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Focus styles for accessibility */
.focus-ring:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Responsive text utilities */
@media (max-width: 640px) {
    .responsive-text-4xl {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }

    .responsive-text-3xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .responsive-text-2xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    /* Mobile-specific enhancements */
    .page-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Header improvements for mobile */
    .app-header {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    /* Mobile header layout optimization */
    .mobile-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .mobile-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .mobile-title {
        font-size: 1.75rem;
        line-height: 2rem;
        font-weight: 700;
    }

    .mobile-subtitle {
        font-size: 0.875rem;
        line-height: 1.25rem;
        margin-top: 0.25rem;
    }

    .mobile-logo {
        height: 2.5rem;
        width: auto;
    }

    /* Upload area mobile optimizations */
    .upload-area {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .upload-area .upload-icon {
        width: 3rem;
        height: 3rem;
        margin-bottom: 1rem;
    }

    .upload-area .upload-text {
        font-size: 1rem;
        line-height: 1.5rem;
    }

    .upload-area .upload-subtext {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }

    /* Button improvements for mobile */
    .btn-primary {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        color: white;
        border: none;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 500;
        min-height: 44px;
        border-radius: 0.75rem;
        transition: all 0.3s ease;
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .btn-primary:hover {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        transform: translateY(-1px);
        box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
    }

    .btn-primary:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .mobile-btn-large {
        padding: 1rem 2rem;
        font-size: 1.125rem;
        min-height: 48px;
        border-radius: 0.875rem;
        font-weight: 600;
    }

    /* Glass card mobile adjustments */
    .glass-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        border-radius: 1rem;
    }

    /* Mobile navigation improvements */
    .mobile-menu {
        margin-top: 1rem;
        padding: 1.25rem;
        border-radius: 0.75rem;
    }

    .mobile-menu a {
        padding: 0.875rem 0;
        font-size: 1rem;
        line-height: 1.5rem;
        border-bottom: 1px solid #f3f4f6;
        margin-bottom: 0.5rem;
    }

    .mobile-menu a:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    /* File list mobile optimizations */
    .file-item-mobile {
        padding: 1rem;
        border-radius: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .file-item-mobile .file-name {
        font-size: 0.875rem;
        line-height: 1.25rem;
        font-weight: 500;
    }

    .file-item-mobile .file-size {
        font-size: 0.75rem;
        line-height: 1rem;
        color: #6b7280;
    }

    /* Results table mobile responsive */
    .results-table-mobile {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        border-radius: 0.75rem;
    }

    .results-table-mobile table {
        min-width: 100%;
        font-size: 0.875rem;
    }

    .results-table-mobile th,
    .results-table-mobile td {
        padding: 0.75rem 0.5rem;
    }

    /* Social sharing mobile adjustments */
    .social-sharing-mobile {
        padding: 1.5rem;
        text-align: center;
    }

    .social-sharing-mobile .social-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
        max-width: 16rem;
        margin: 0 auto;
    }

    .social-btn {
        width: 3rem;
        height: 3rem;
        min-height: 44px; /* Touch target size */
    }

    /* Footer mobile improvements */
    .app-footer {
        padding: 2rem 1rem;
        margin-top: 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-section {
        padding: 0;
    }

    .footer-section h3,
    .footer-section h4 {
        margin-bottom: 1rem;
        font-size: 1.125rem;
        font-weight: 600;
    }

    .footer-links {
        align-items: center;
        gap: 1rem;
    }

    .footer-links a {
        padding: 0.5rem 0;
        font-size: 0.9375rem;
    }

    .footer-description {
        text-align: center;
        max-width: 300px;
        margin: 0 auto 1.5rem;
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .footer-bottom {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .footer-copyright {
        font-size: 0.8125rem;
        line-height: 1.4;
    }

    /* Processing phase mobile optimizations */
    .processing-mobile {
        text-align: center;
        padding: 2rem 1rem;
    }

    .processing-mobile .spinner {
        width: 3rem;
        height: 3rem;
        margin: 0 auto 1rem;
    }

    .processing-mobile .processing-text {
        font-size: 1.125rem;
        line-height: 1.75rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    .processing-mobile .processing-subtext {
        font-size: 0.875rem;
        line-height: 1.25rem;
        color: #6b7280;
    }

    /* Language switcher mobile */
    .language-switcher-mobile {
        padding: 0.75rem 1rem;
        border-top: 1px solid #e5e7eb;
        margin-top: 0.75rem;
    }

    .language-switcher-mobile button {
        width: 100%;
        text-align: left;
        padding: 0.75rem 0;
        font-size: 0.875rem;
        min-height: 44px;
    }

    /* Form inputs mobile */
    .form-input-mobile {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        border-radius: 0.5rem;
        min-height: 44px;
        border: 1px solid #d1d5db;
    }

    .form-input-mobile:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
        border-color: #3b82f6;
    }

    /* Spacing utilities for mobile */
    .mobile-spacing-sm {
        margin-bottom: 0.75rem;
    }

    .mobile-spacing-md {
        margin-bottom: 1.5rem;
    }

    .mobile-spacing-lg {
        margin-bottom: 2rem;
    }

    /* Improved touch targets */
    .touch-target {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile-specific animations */
    .mobile-slide-up {
        animation: mobileSlideUp 0.4s ease-out;
    }

    @keyframes mobileSlideUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Better text readability on mobile */
    .mobile-text-contrast {
        color: #111827;
        line-height: 1.6;
    }

    .mobile-text-secondary {
        color: #4b5563;
        line-height: 1.5;
    }

    /* Card hover effects adjusted for mobile */
    .glass-card:hover {
        transform: none; /* Disable hover transforms on mobile */
    }

    .result-card:hover {
        transform: none;
    }

    /* Mobile safe areas for devices with notches */
    .mobile-safe-top {
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .mobile-safe-bottom {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .mobile-safe-left {
        padding-left: max(1rem, env(safe-area-inset-left));
    }

    .mobile-safe-right {
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Additional mobile-specific optimizations for smaller screens */
@media (max-width: 475px) {
    .glass-card {
        padding: 1rem;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-radius: 0.75rem;
    }

    .mobile-title {
        font-size: 1.5rem;
        line-height: 1.75rem;
    }

    .mobile-subtitle {
        font-size: 0.8125rem;
        line-height: 1.125rem;
    }

    .upload-area {
        padding: 1rem;
    }

    .social-sharing-mobile .social-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .mobile-btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .glass-card {
        background: white !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }
}