:root {
    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --font-size-base: 16px;
    --navbar-height: 60px;
}

/* Base Typography */
html {
    height: 100%;
    scroll-behavior: smooth;
}

* {
    font-size: var(--font-size-base);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: font-size 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main content area should grow to push footer down */
body> :not(footer):not(#footer-placeholder) {
    flex-shrink: 0;
}

/* Footer placeholder needs margin-top auto since it's the direct child of body */
#footer-placeholder {
    margin-top: auto !important;
}

/* Accessibility Bar */
.accessibility-bar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.accessibility-bar button {
    min-width: 40px;
    height: 32px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.accessibility-bar button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: var(--navbar-height);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--bs-primary) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.hero-section h1 {
    font-weight: 700;
}

.hero-section .lead {
    font-size: 1.25rem;
    opacity: 0.95;
}

/* Hero buttons with better contrast */
.hero-section .btn-primary {
    background-color: white;
    color: #667eea;
    border-color: white;
    font-weight: 600;
}

.hero-section .btn-primary:hover {
    background-color: #f8f9fa;
    color: #5568d3;
    border-color: #f8f9fa;
}

.hero-section .btn-outline-primary {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid white;
    border-color: white;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.hero-section .btn-outline-primary:hover {
    background-color: white;
    color: #667eea;
    border-color: white;
}

/* Cards */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important;
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 50%;
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Footer */
footer a:hover {
    text-decoration: underline !important;
}

/* Download Section (for tools.html) */
.tool-card {
    border-left: 4px solid var(--bs-primary);
}

.download-count {
    font-size: 0.875rem;
    color: var(--bs-secondary);
}

/* Responsive */

/* Tablet (portrait) */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: #f8f9fa;
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 0.375rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #dee2e6;
    }

    .nav-link:last-child {
        border-bottom: none;
    }
}

/* Mobile phones and small tablets */
@media (max-width: 768px) {
    .hero-section {
        min-height: 300px;
        padding: 2rem 0 !important;
    }

    .display-4,
    .display-5 {
        font-size: 2rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    /* Better spacing for mobile */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* Buttons should be easier to tap */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }

    /* Cards should stack nicely */
    .card {
        margin-bottom: 1.5rem;
    }

    /* Tables should be scrollable horizontally */
    .table-responsive {
        margin-bottom: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.875rem;
    }

    /* Alert boxes more compact */
    .alert {
        font-size: 0.9rem;
    }

    .alert h5 {
        font-size: 1rem;
    }
}

/* Very small devices (phones in portrait) */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .display-4,
    .display-5 {
        font-size: 1.75rem;
    }

    /* Navbar brand smaller on very small screens */
    .navbar-brand {
        font-size: 1.1rem;
    }

    /* Accessibility buttons slightly smaller */
    .accessibility-bar button {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    /* Hero buttons stack vertically */
    .hero-section .d-flex {
        flex-direction: column !important;
    }

    .hero-section .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Print Styles */
@media print {

    .accessibility-bar,
    .navbar,
    footer,
    .btn {
        display: none !important;
    }
}