/* Custom styles for Universal Document Converter */

:root {
    /* Modern Brand Color Palette */
    --brand-primary: #2563eb;        /* Deep modern blue */
    --brand-secondary: #06b6d4;      /* Cyan accent */
    --brand-accent: #8b5cf6;         /* Purple accent */
    
    /* Semantic Colors */
    --success: #10b981;              /* Green */
    --warning: #f59e0b;              /* Amber */
    --danger: #ef4444;               /* Red */
    --info: var(--brand-secondary);
    
    /* Neutral Palette */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Surface Colors */
    --surface-white: #ffffff;
    --surface-light: var(--gray-50);
    --surface-dark: var(--gray-900);
    
    /* Text Colors */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-500);
    
    /* Border & Shadow */
    --border-light: var(--gray-200);
    --border-medium: var(--gray-300);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing System (8px base) */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */
    --space-16: 4rem;    /* 64px */
    --space-20: 5rem;    /* 80px */
    
    /* Border Radius */
    --radius-sm: 0.375rem;  /* 6px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
}

/* Modern Typography System */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--surface-white);
    font-size: 16px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.875rem); }
h4 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1rem, 2vw, 1.25rem); }
h6 { font-size: clamp(0.875rem, 1.5vw, 1.125rem); }

p {
    margin-bottom: var(--space-4);
    line-height: 1.6;
    color: var(--text-secondary);
}

.text-large {
    font-size: clamp(1.125rem, 2.5vw, 1.25rem);
    line-height: 1.6;
}

.text-small {
    font-size: clamp(0.875rem, 1.5vw, 0.9375rem);
    line-height: 1.5;
}

/* Utility Classes */
.mb-6 { margin-bottom: var(--space-6) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-6 { margin-top: var(--space-6) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }

/* Text Color Utilities */
.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--brand-primary) !important;
}

/* Background Utilities */
.bg-light {
    background-color: var(--surface-light) !important;
}

/* Mobile-First Base Styles */
* {
    box-sizing: border-box;
}

/* Improved tap targets */
a, button, .btn, .nav-link, .dropdown-item {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

/* Focus states for accessibility */
a:focus,
button:focus,
.btn:focus,
.nav-link:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Improved readability */
body {
    line-height: 1.6;
    color: var(--text-primary);
    font-size: 16px;
}

/* Modern Hero Section with High Contrast */
.hero-section {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
    color: #ffffff !important;
    padding: var(--space-16) 0;
    margin: 0;
    text-align: center;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.hero-section * {
    position: relative;
    z-index: 1;
}

.hero-section h1,
.hero-section .display-4 {
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-section p {
    color: #ffffff !important;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    opacity: 1 !important;
}

.hero-section .btn {
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-weight: 600;
}

/* Modern Card System */
.card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface-white);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-primary);
}

.card-body {
    padding: var(--space-6);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Updated Icon System */
.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--surface-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.step-icon {
    width: 60px;
    height: 60px;
    background: var(--surface-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

/* File preview */
#filePreview {
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
}

/* Navbar customization */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Modern Button System */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: var(--space-3) var(--space-6);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 44px; /* Mobile touch target */
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.btn:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Primary Button */
.btn-primary {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: white;
    box-shadow: var(--shadow-md);
}

/* Secondary Button */
.btn-secondary {
    background: var(--surface-white);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-secondary:hover {
    background: var(--brand-primary);
    color: white;
}

/* Success Button */
.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
    color: white;
    box-shadow: var(--shadow-md);
}

/* Large Button */
.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
    min-height: 48px;
    border-radius: var(--radius-lg);
}

/* Small Button */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    min-height: 36px;
    border-radius: var(--radius-sm);
}

/* Cards */
.card-header {
    background: linear-gradient(45deg, var(--brand-primary), #1d4ed8);
    color: white;
    border-bottom: none;
}

.card-header h4,
.card-header h5 {
    color: white;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
}

/* Modern Form Controls */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    padding: var(--space-3) var(--space-4);
    min-height: 44px; /* Mobile touch target */
    background: var(--surface-white);
    color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

/* List groups */
.list-group-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Supported formats section */
.supported-formats {
    background: var(--surface-light);
    padding: 3rem 2rem;
    border-radius: 15px;
}

.supported-formats h3 {
    color: var(--brand-primary);
}

/* Footer */
footer {
    background: var(--surface-light) !important;
    border-top: 1px solid var(--border-light);
}

/* Loading animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Fluid Grid System */
.fluid-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

.fluid-grid {
    display: grid;
    gap: clamp(1rem, 3vw, 2rem);
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.fluid-grid-2 {
    display: grid;
    gap: clamp(1rem, 3vw, 2rem);
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.fluid-grid-3 {
    display: grid;
    gap: clamp(1rem, 2.5vw, 1.5rem);
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.fluid-grid-4 {
    display: grid;
    gap: clamp(0.75rem, 2vw, 1.25rem);
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
}

/* Flexible flex layouts */
.flex-fluid {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(1rem, 3vw, 2rem);
}

.flex-fluid > * {
    flex: 1 1 clamp(280px, 30%, 400px);
}

/* Responsive typography with fluid scaling */
.fluid-text-xl {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
}

.fluid-text-lg {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    line-height: 1.3;
}

.fluid-text-md {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.5;
}

/* Fluid spacing system */
.fluid-spacing-xs { margin: clamp(0.5rem, 2vw, 1rem); }
.fluid-spacing-sm { margin: clamp(1rem, 3vw, 1.5rem); }
.fluid-spacing-md { margin: clamp(1.5rem, 4vw, 2.5rem); }
.fluid-spacing-lg { margin: clamp(2rem, 5vw, 4rem); }
.fluid-spacing-xl { margin: clamp(3rem, 6vw, 6rem); }

.fluid-padding-xs { padding: clamp(0.5rem, 2vw, 1rem); }
.fluid-padding-sm { padding: clamp(1rem, 3vw, 1.5rem); }
.fluid-padding-md { padding: clamp(1.5rem, 4vw, 2.5rem); }
.fluid-padding-lg { padding: clamp(2rem, 5vw, 4rem); }
.fluid-padding-xl { padding: clamp(3rem, 6vw, 6rem); }

/* Container queries for advanced responsive behavior */
.card-fluid {
    container-type: inline-size;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: clamp(8px, 1vw, 12px);
}

@container (min-width: 300px) {
    .card-fluid .card-body {
        padding: clamp(1rem, 3vw, 1.5rem);
    }
}

@container (min-width: 400px) {
    .card-fluid .card-title {
        font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    }
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    /* Navigation optimized for mobile */
    .navbar {
        padding: var(--space-2) 0;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .nav-link {
        padding: var(--space-4) var(--space-3) !important;
        font-size: 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .dropdown-menu {
        width: 100%;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .dropdown-item {
        padding: var(--space-4) var(--space-6) !important;
        min-height: 48px;
        font-size: 1rem;
        border-bottom: 1px solid var(--border-light);
    }
    
    /* Hero section mobile optimization */
    .hero-section {
        padding: var(--space-12) var(--space-4);
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
        line-height: 1.2;
        margin-bottom: var(--space-4);
        color: #ffffff !important;
        font-weight: 700;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .hero-section p {
        font-size: clamp(1rem, 4vw, 1.125rem);
        margin-bottom: var(--space-6);
        color: #ffffff !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        opacity: 1 !important;
    }
    
    /* Mobile-optimized buttons */
    .btn {
        min-height: 48px;
        padding: var(--space-4) var(--space-6);
        font-size: 1rem;
        font-weight: 600;
    }
    
    .btn-lg {
        min-height: 52px;
        padding: var(--space-5) var(--space-8);
        font-size: 1.125rem;
    }
    
    /* Card optimization for mobile */
    .card {
        margin-bottom: var(--space-4);
    }
    
    .card-body {
        padding: var(--space-5);
    }
    
    .card-title {
        font-size: 1.125rem;
        margin-bottom: var(--space-3);
    }
    
    /* Grid optimization */
    .fluid-grid,
    .fluid-grid-2,
    .fluid-grid-3,
    .fluid-grid-4 {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    /* Form controls mobile optimization */
    .form-control,
    .form-select {
        min-height: 48px;
        font-size: 1rem;
        padding: var(--space-4);
    }
    
    /* Touch-friendly spacing */
    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
    
    /* Icon sizing for mobile */
    [data-feather] {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* Mobile-specific layout adjustments */
    .text-center {
        text-align: center !important;
    }
    
    /* Ensure adequate spacing between sections */
    section {
        margin-bottom: var(--space-12) !important;
    }
    
    /* Mobile typography improvements */
    h2 {
        font-size: clamp(1.5rem, 6vw, 2rem);
        margin-bottom: var(--space-4);
    }
    
    h3 {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
        margin-bottom: var(--space-3);
    }
    
    p {
        line-height: 1.6;
        margin-bottom: var(--space-4);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .fluid-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fluid-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .fluid-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e9ecef;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #e9ecef;
    }
    
    .form-control,
    .form-select {
        background-color: #2d2d2d;
        border-color: #495057;
        color: #e9ecef;
    }
    
    .bg-light {
        background-color: #2d2d2d !important;
        color: #e9ecef;
    }
    
    .text-muted {
        color: #adb5bd !important;
    }
}

/* Custom utility classes */
.text-gradient {
    background: linear-gradient(45deg, #007bff, #0056b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-soft {
    box-shadow: 0 2px 25px rgba(0,0,0,0.1) !important;
}

.border-radius-lg {
    border-radius: 15px !important;
}

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

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

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

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