/* ============================================
   TEXTCRAFT NLP SKILLS - RESPONSIVE STYLES
   Mobile & Tablet Breakpoints
   Mobile-First Approach
   ============================================ */

/* ============================================
   BREAKPOINT REFERENCE:
   - Mobile: 320px - 767px
   - Tablet: 768px - 1023px
   - Desktop: 1024px+
   ============================================ */

/* ============================================
   1. TABLET STYLES (768px - 1023px)
   ============================================ */

@media (max-width: 1023px) {
    /* Typography Adjustments */
    :root {
        --font-size-h1: 2.8rem;
        --font-size-h2: 2rem;
        --font-size-h3: 1.4rem;
        --spacing-xl: 3rem;
        --spacing-lg: 2.5rem;
    }

    /* Container */
    .container,
    .container-wide {
        padding: 0 var(--spacing-md);
    }

    /* Grid Adjustments */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Section Spacing */
    .section {
        padding: var(--spacing-lg) 0;
    }

    /* Cards */
    .card {
        padding: 1.5rem;
    }

    /* Navbar */
    .navbar-nav {
        gap: 1.5rem;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
}

/* ============================================
   2. MOBILE STYLES (max-width: 767px)
   ============================================ */

@media (max-width: 767px) {
    
    /* ========== Typography ========== */
    :root {
        --font-size-h1: 2.2rem;
        --font-size-h2: 1.6rem;
        --font-size-h3: 1.2rem;
        --font-size-body: 0.95rem;
        --spacing-xl: 2.5rem;
        --spacing-lg: 2rem;
        --spacing-md: 1.5rem;
    }

    h1 {
        font-size: var(--font-size-h1);
        line-height: 1.3;
    }

    h2 {
        font-size: var(--font-size-h2);
    }

    h3 {
        font-size: var(--font-size-h3);
    }

    p {
        font-size: var(--font-size-body);
        line-height: 1.7;
    }

    /* ========== Layout ========== */
    .container,
    .container-wide {
        padding: 0 1rem;
    }

    .section {
        padding: 2rem 0;
    }

    .section-hero {
        min-height: 90vh;
        padding: 2rem 0;
    }

    /* ========== Grid System ========== */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* ========== Navbar Mobile ========== */
    .navbar {
        padding: 1rem 0;
    }

    .navbar-brand {
        font-size: 1.4rem;
    }

    .navbar-logo {
        width: 35px;
        height: 35px;
    }

    /* Mobile Menu Toggle - Show on Mobile */
    .navbar-toggle {
        display: flex;
    }

    /* Hide navbar items by default on mobile */
    .navbar-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        flex-direction: column;
        gap: 0;
        background: rgba(253, 248, 245, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 2rem;
        border-top: 2px solid var(--color-gold);
        box-shadow: 0 10px 40px rgba(114, 47, 55, 0.2);
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
    }

    .navbar-nav.active {
        left: 0;
    }

    .nav-link {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
        text-align: center;
        border-bottom: 1px solid rgba(114, 47, 55, 0.1);
    }

    .nav-link::after {
        display: none;
    }

    .nav-link:hover {
        background: rgba(212, 175, 55, 0.15);
    }

    /* ========== Buttons ========== */
    .btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .btn-lg {
        padding: 1.125rem 1.75rem;
        font-size: 1rem;
    }

    /* Button groups should stack */
    .btn-group {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-group .btn {
        width: 100%;
    }

    /* ========== Cards ========== */
    .card {
        padding: 1.25rem;
        border-radius: var(--radius-md);
    }

    .card-title {
        font-size: 1.3rem;
    }

    .card-subtitle {
        font-size: 0.9rem;
    }

    .card-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    /* ========== Forms ========== */
    .form-input,
    .form-textarea,
    .form-select {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .form-textarea {
        min-height: 120px;
    }

    .form-label {
        font-size: 0.9rem;
    }

    /* ========== Modal ========== */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 90vh;
    }

    .modal-title {
        font-size: 1.5rem;
    }

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

    .modal-footer .btn {
        width: 100%;
    }

    /* ========== Alerts ========== */
    .alert {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        flex-direction: column;
        text-align: center;
    }

    .alert-close {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }

    /* ========== Badges ========== */
    .badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }

    /* ========== Footer ========== */
    .footer {
        padding: 2rem 0 1.5rem 0;
    }

    .footer-text {
        font-size: 0.875rem;
    }

    .footer-social {
        gap: 1rem;
    }

    .social-link {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    /* ========== Utility Classes ========== */
    .flex-between {
        flex-direction: column;
        gap: 1rem;
    }

    .text-center-mobile {
        text-align: center;
    }

    /* Hide on mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Show only on mobile */
    .show-mobile {
        display: block !important;
    }
}

/* ============================================
   3. SMALL MOBILE (max-width: 480px)
   ============================================ */

@media (max-width: 480px) {
    :root {
        --font-size-h1: 1.9rem;
        --font-size-h2: 1.4rem;
        --font-size-h3: 1.1rem;
        --spacing-xl: 2rem;
        --spacing-lg: 1.5rem;
    }

    .container,
    .container-wide {
        padding: 0 0.875rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-logo {
        width: 30px;
        height: 30px;
    }

    .card {
        padding: 1rem;
    }

    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.85rem;
    }

    .modal-content {
        padding: 1.25rem;
    }

    .section {
        padding: 1.5rem 0;
    }
}

/* ============================================
   4. LANDSCAPE MOBILE (max-height: 500px)
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .section-hero {
        min-height: auto;
        padding: 1.5rem 0;
    }

    .navbar-nav {
        height: calc(100vh - 60px);
        overflow-y: auto;
        padding: 1rem;
    }

    .nav-link {
        padding: 0.75rem;
    }
}

/* ============================================
   5. LARGE DESKTOP (min-width: 1400px)
   ============================================ */

@media (min-width: 1400px) {
    :root {
        --font-size-h1: 4rem;
        --font-size-h2: 2.8rem;
        --font-size-h3: 1.8rem;
    }

    .container {
        max-width: 1300px;
    }

    .container-wide {
        max-width: 1500px;
    }
}

/* ============================================
   6. TOUCH DEVICE OPTIMIZATIONS
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 48px;
    }

    .nav-link {
        min-height: 48px;
    }

    .form-input,
    .form-select {
        min-height: 48px;
    }

    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
    }

    .btn:hover::before {
        width: 0;
        height: 0;
    }

    /* Tap highlight color */
    * {
        -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
    }
}

/* ============================================
   7. PRINT STYLES
   ============================================ */

@media print {
    /* Hide non-essential elements */
    .navbar,
    .navbar-toggle,
    .footer-social,
    .btn,
    .modal,
    .alert {
        display: none !important;
    }

    /* Optimize for print */
    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    /* Show URLs for links */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ============================================
   8. REDUCED MOTION (Accessibility)
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
    }

    .animate-fadeIn,
    .animate-fadeUp,
    .animate-slideInLeft,
    .animate-slideInRight,
    .animate-float,
    .animate-glow {
        animation: none;
    }
}

/* ============================================
   9. HIGH CONTRAST MODE (Accessibility)
   ============================================ */

@media (prefers-contrast: high) {
    :root {
        --color-burgundy: #5A1F28;
        --color-gold: #B8860B;
    }

    .btn,
    .card,
    .form-input {
        border-width: 3px;
    }

    .glass-card,
    .glass-panel {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* ============================================
   10. DARK MODE PREFERENCE
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode support if needed
       Currently maintaining light luxury theme
       Uncomment below to enable dark mode */
    
    /*
    body {
        background: linear-gradient(135deg, #1a1410, #2a1f1a, #1f1612);
        color: #f5edeb;
    }

    :root {
        --color-text-dark: #fdf8f5;
        --color-text-light: #2C1810;
        --glass-bg: rgba(42, 31, 26, 0.7);
        --glass-border: rgba(212, 175, 55, 0.2);
    }

    .card,
    .navbar {
        background: rgba(42, 31, 26, 0.8);
    }
    */
}

/* ============================================
   11. RESPONSIVE HELPER CLASSES
   ============================================ */

/* Display utilities for different breakpoints */
@media (min-width: 768px) {
    .hide-tablet {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .hide-desktop {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
}

/* Flex direction responsive */
@media (max-width: 767px) {
    .flex-mobile-column {
        flex-direction: column;
    }

    .flex-mobile-center {
        justify-content: center;
        align-items: center;
    }
}

/* Text alignment responsive */
@media (max-width: 767px) {
    .text-mobile-center {
        text-align: center;
    }

    .text-mobile-left {
        text-align: left;
    }
}

/* Spacing adjustments for mobile */
@media (max-width: 767px) {
    .p-mobile-0 { padding: 0 !important; }
    .p-mobile-1 { padding: var(--spacing-xs) !important; }
    .p-mobile-2 { padding: var(--spacing-sm) !important; }
    
    .m-mobile-0 { margin: 0 !important; }
    .m-mobile-1 { margin: var(--spacing-xs) !important; }
    .m-mobile-2 { margin: var(--spacing-sm) !important; }
}

/* ============================================
   END OF RESPONSIVE.CSS
   ============================================ */