/**
 * UniFinder & PakStudent Kit - Premium UI Design System
 * Version 2.0 - AI-Enhanced with Full-Width Layout
 * Fully Responsive, Modern Glassmorphic Design
 */

/* ============================================
   1. CSS VARIABLES & ROOT CONFIGURATION
   ============================================ */
:root {
    /* Primary Colors - Blue Theme */
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-light: #3d8bfd;
    --primary-subtle: rgba(13, 110, 253, 0.1);

    /* Secondary Colors */
    --secondary: #6c757d;
    --success: #198754;
    --success-subtle: rgba(25, 135, 84, 0.1);
    --warning: #ffc107;
    --warning-subtle: rgba(255, 193, 7, 0.1);
    --danger: #dc3545;
    --danger-subtle: rgba(220, 53, 69, 0.1);
    --info: #0dcaf0;
    --info-subtle: rgba(13, 202, 240, 0.1);

    /* AI Accent Colors */
    --ai-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --ai-purple: #6f42c1;
    --ai-pink: #d63384;

    /* Neutral Colors */
    --white: #ffffff;
    --light: #f8f9fa;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --dark: #212529;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================
   2. BASE & RESET STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--light);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   3. ANIMATED BACKGROUND
   ============================================ */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    overflow: hidden;
}

.animated-bg::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.03) 0%, transparent 50%);
    animation: float 20s infinite linear;
}

@keyframes float {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   4. NAVBAR ENHANCEMENTS
   ============================================ */
.navbar {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(13, 110, 253, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 0;
    transition: var(--transition-normal);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.navbar-brand i {
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
}

/* ============================================
   5. HERO SECTION
   ============================================ */
.hero-section {
    background: var(--ai-gradient);
    padding: 4rem 0 5rem;
    position: relative;
    overflow: hidden;
    color: var(--white);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: patternMove 30s linear infinite;
}

@keyframes patternMove {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(60px);
    }
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-weight: 800;
    font-size: 2.8rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-section .lead {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.hero-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    color: var(--gray-800);
}

.hero-card h3 {
    color: var(--primary);
}

/* ============================================
   6. TOOL CARDS - HOMEPAGE GRID
   ============================================ */
.tool-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ai-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    transition: var(--transition-normal);
}

.tool-card:hover .tool-icon {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.1);
}

/* ============================================
   7. FULL-WIDTH TOOL LAYOUT (NO SIDEBAR)
   ============================================ */
.tool-page-wrapper {
    padding: var(--spacing-xl) 0;
    min-height: calc(100vh - 200px);
}

.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.tool-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.tool-header h1 {
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.tool-header p {
    color: var(--gray-600);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.tool-main-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--gray-200);
}

/* ============================================
   8. AI CHAT ASSISTANT (PREMIUM)
   ============================================ */
.ai-assistant-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--ai-gradient);
    border: none;
    border-radius: var(--radius-full);
    color: var(--white);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    z-index: 2000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-assistant-toggle:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.ai-avatar-wrapper {
    position: relative;
    font-size: 1.8rem;
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4ade80;
    border: 2px solid #fff;
    border-radius: 50%;
}

.ai-chat-panel {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 150px);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 1999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.ai-chat-panel.active {
    display: flex;
    animation: chatOpen 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes chatOpen {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-chat-header {
    background: var(--ai-gradient);
    color: #fff;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-header-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
}

.ai-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    margin-right: 4px;
}

.ai-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ai-chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: #fcfdfe;
    scroll-behavior: smooth;
}

.ai-message {
    margin-bottom: 1.25rem;
    max-width: 85%;
    display: flex;
}

.ai-message.bot {
    margin-right: auto;
}

.ai-message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.ai-message .message-content {
    padding: 0.85rem 1.1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ai-message.bot .message-content {
    background: #fff;
    color: #334155;
    border-radius: 4px 18px 18px 18px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-message.user .message-content {
    background: var(--primary);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
}

.ai-suggestions-container {
    padding: 0.75rem 1rem;
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

.ai-suggestions-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ai-suggestions-track::-webkit-scrollbar {
    height: 0;
}

.suggestion-chip {
    white-space: nowrap;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: 0.2s;
}

.suggestion-chip:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.ai-chat-input-wrapper {
    padding: 1rem 1.25rem 0.75rem;
    background: #fff;
    border-top: 1px solid #f1f5f9;
}

.ai-chat-input {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f8fafc;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.ai-chat-input input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 0.95rem;
    outline: none;
}

.ai-send-btn {
    width: 40px;
    height: 40px;
    background: var(--ai-gradient);
    border: none;
    border-radius: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: 0.2s;
}

.ai-send-btn:hover {
    transform: scale(1.05);
}

.ai-footer-note {
    text-align: center;
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Global Mobile Responsiveness Audit */
@media (max-width: 600px) {
    .ai-chat-panel {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .ai-assistant-toggle {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .tool-main-card {
        padding: 1.25rem;
    }

    /* QA Fix: Better spacing for grid on mobile */
    .row.g-3>[class*="col-"] {
        padding-left: 8px;
        padding-right: 8px;
    }

    .tool-card {
        padding: 1rem !important;
    }

    .tool-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* ============================================
   9. AI INSIGHT CARDS
   ============================================ */
.ai-insight-card {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.05) 0%, rgba(214, 51, 132, 0.05) 100%);
    border: 1px solid rgba(111, 66, 193, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Responsive Enhancements */
img {
    max-width: 100%;
    height: auto;
}

.tool-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }

    .display-5 {
        font-size: 2rem;
    }

    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .tool-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

.ai-insight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--ai-gradient);
}

.ai-insight-card h6 {
    color: var(--ai-purple);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-insight-card p {
    color: var(--gray-700);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.ai-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ai-purple);
    font-size: 0.9rem;
}

.ai-loading-dots {
    display: flex;
    gap: 4px;
}

.ai-loading-dots span {
    width: 6px;
    height: 6px;
    background: var(--ai-purple);
    border-radius: var(--radius-full);
    animation: loadingDot 1.4s infinite ease-in-out both;
}

.ai-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingDot {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* ============================================
   10. FORM ELEMENTS (PREMIUM)
   ============================================ */
.form-control,
.form-select {
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: var(--transition-fast);
    background: var(--white);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-subtle);
    outline: none;
}

.form-control-lg,
.form-select-lg {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* ============================================
   11. BUTTONS (PREMIUM)
   ============================================ */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.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;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary);
    border: none;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

.btn-ai {
    background: var(--ai-gradient);
    border: none;
    color: var(--white);
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3);
}

.btn-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
    color: var(--white);
}

/* ============================================
   12. RESULT CARDS
   ============================================ */
.result-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 5px solid var(--primary);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.result-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.result-card.success {
    border-left-color: var(--success);
}

.result-card.warning {
    border-left-color: var(--warning);
}

.result-card.danger {
    border-left-color: var(--danger);
}

.result-summary {
    background: var(--ai-gradient);
    color: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.result-summary h3 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

/* ============================================
   13. PROBABILITY METER
   ============================================ */
.probability-meter {
    height: 12px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.probability-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease-out;
    background: var(--primary);
}

.probability-fill.high {
    background: var(--success);
}

.probability-fill.medium {
    background: var(--warning);
}

.probability-fill.low {
    background: var(--danger);
}

/* ============================================
   14. FILTER SECTION
   ============================================ */
.filter-section {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-title {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* ============================================
   15. RELATED TOOLS SECTION
   ============================================ */
.related-tools-section {
    margin-top: var(--spacing-xxl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--gray-200);
}

.related-tools-section h4 {
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.related-tool-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: var(--transition-normal);
}

.related-tool-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.related-tool-card .icon {
    width: 45px;
    height: 45px;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.related-tool-card h6 {
    margin: 0;
    font-weight: 600;
    color: var(--gray-800);
}

.related-tool-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* ============================================
   16. STATISTICS SECTION
   ============================================ */
.stats-section {
    padding: 4rem 0;
    background: var(--white);
}

.stat-card {
    text-align: center;
    padding: 2rem;
}

.stat-card .number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--ai-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card .label {
    font-size: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* ============================================
   17. FOOTER ENHANCEMENTS
   ============================================ */
footer {
    background: var(--gray-900) !important;
    color: var(--white);
}

footer h5 {
    font-weight: 700;
    margin-bottom: 1rem;
}

footer a {
    color: var(--gray-400);
    transition: var(--transition-fast);
}

footer a:hover {
    color: var(--white);
}

/* ============================================
   18. RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .tool-container {
        max-width: 900px;
    }
}

@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2.2rem;
    }

    .tool-header h1 {
        font-size: 1.8rem;
    }

    .ai-chat-panel {
        width: 320px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 4rem;
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .tool-main-card {
        padding: 1.25rem;
    }

    .tool-header h1 {
        font-size: 1.5rem;
    }

    .result-summary h3 {
        font-size: 2.2rem;
    }

    .stat-card .number {
        font-size: 2.2rem;
    }

    .ai-chat-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }

    .ai-assistant-toggle {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }

    .filter-chips {
        gap: 0.4rem;
    }

    .filter-chip {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.5rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .hero-card {
        border-radius: var(--radius-lg);
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .form-control-lg,
    .form-select-lg {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .tool-main-card {
        border-radius: var(--radius-lg);
    }

    .related-tools-section .row>div {
        margin-bottom: 1rem;
    }
}

/* ============================================
   19. UTILITY CLASSES
   ============================================ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.gradient-text {
    background: var(--ai-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-ai {
    color: var(--ai-purple);
}

.bg-ai {
    background: var(--ai-gradient);
}

.shadow-ai {
    box-shadow: 0 10px 40px rgba(111, 66, 193, 0.2);
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Country Flags */
.country-flag {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
}

/* ============================================
   20. STEP CARDS (TOOLS)
   ============================================ */
.step-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.step-header {
    background: var(--ai-gradient);
    color: var(--white);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-badge {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.step-body {
    padding: 2rem;
}

/* ============================================
   21. ANIMATIONS
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

.scale-in {
    animation: scaleIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   22. DARK MODE SUPPORT (BASIC)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Can be extended for full dark mode */
}

/* ============================================
   23. PRINT STYLES
   ============================================ */
@media print {

    .ai-assistant-toggle,
    .ai-chat-panel,
    .navbar,
    footer {
        display: none !important;
    }

    .tool-main-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ============================================
   24. MOBILE RESPONSIVENESS (100% Coverage)
   ============================================ */
@media (max-width: 768px) {

    /* Container Safety */
    .container,
    .tool-container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Hero Section */
    .hero-section {
        padding: 2.5rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-card {
        margin-top: 1.5rem;
        padding: 1.25rem;
    }

    /* Tool Cards */
    .tool-main-card {
        padding: 1.25rem !important;
        border-radius: 16px;
    }

    .tool-header h1 {
        font-size: 1.6rem;
    }

    .tool-header p {
        font-size: 0.95rem;
    }

    /* Results Display */
    .result-summary {
        padding: 1.5rem;
    }

    .result-summary h3 {
        font-size: 2rem;
    }

    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Nav */
    .navbar-brand {
        font-size: 1.2rem;
    }

    /* Footer */
    footer .row>div {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {

    /* Ultra-small Phones */
    body {
        font-size: 15px;
    }

    /* Touch-friendly inputs */
    .form-control,
    .form-select,
    .btn {
        font-size: 16px;
        /* Prevents iOS zoom */
        padding: 0.75rem 1rem;
        border-radius: 10px;
    }

    /* Stack buttons vertically */
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-direction: column;
    }

    .d-flex.gap-2>.btn,
    .d-flex.gap-3>.btn {
        width: 100%;
    }

    /* Tool results */
    .list-group-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Cards */
    .card {
        border-radius: 12px;
    }

    /* Hero */
    .hero-section h1 {
        font-size: 1.75rem;
    }

    /* AI Chat Panel */
    .ai-chat-panel {
        width: calc(100% - 30px);
        right: 15px;
        max-height: 70vh;
    }

    /* Footer */
    footer {
        text-align: center;
    }
}