/**
 * Responsive Styles
 * FortiLabs Automation
 */

/* ================================
   LARGE SCREENS (1280px and below)
   ================================ */
@media (max-width: 1280px) {
    .pricing-grid {
        max-width: 900px;
    }

    .features-grid {
        gap: var(--space-6);
    }

    .footer-grid {
        grid-template-columns: 1.5fr repeat(3, 1fr);
        gap: var(--space-8);
    }
}

/* ================================
   LAPTOP (1024px and below)
   ================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    .hero-title {
        font-size: var(--text-4xl);
    }

    .pricing-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-4);
    }

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

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

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

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

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

/* ================================
   TABLET (768px and below)
   ================================ */
@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
    }

    /* Navbar Mobile */
    .navbar-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        padding: var(--space-4);
        gap: var(--space-1);
        box-shadow: var(--shadow-lg);
        z-index: var(--z-dropdown);
    }

    .navbar-nav.active {
        display: flex;
    }

    .navbar-link {
        display: block;
        padding: var(--space-3) var(--space-4);
        border-radius: var(--radius-lg);
    }

    .navbar-link:hover {
        background-color: var(--bg-hover);
    }

    .navbar-toggle {
        display: flex;
    }

    /* Hide navbar actions on mobile, show in dropdown */
    .navbar-actions {
        display: none;
    }

    .navbar-actions.mobile-show {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        padding-top: var(--space-4);
        margin-top: var(--space-4);
        border-top: 1px solid var(--border);
    }

    /* Hero */
    .hero {
        padding: var(--space-16) 0;
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-subtitle {
        font-size: var(--text-lg);
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        padding: 0 var(--space-4);
    }

    .hero-actions .btn {
        width: 100%;
    }

    /* Pricing */
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

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

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    /* Dashboard Sidebar */
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: calc(var(--z-fixed) - 1);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .dashboard-header {
        padding: var(--space-4) var(--space-5);
    }

    .dashboard-body {
        padding: var(--space-5);
    }

    .page-header {
        flex-direction: column;
        gap: var(--space-4);
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
    }

    /* Grid */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* Sections */
    .section {
        padding: var(--space-12) 0;
    }

    .section-title {
        font-size: var(--text-2xl);
    }

    /* Tables */
    .table-container {
        border-radius: 0;
        margin: 0 calc(-1 * var(--container-padding));
        border-left: none;
        border-right: none;
    }

    /* Auth */
    .auth-layout {
        padding: var(--space-4);
    }

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

    /* Toast */
    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-4);
    }

    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }

    /* Modal */
    .modal {
        width: calc(100% - var(--space-8));
        max-height: calc(100vh - var(--space-8));
    }
}

/* ================================
   MOBILE LARGE (425px and below)
   ================================ */
@media (max-width: 425px) {
    .hero-title {
        font-size: var(--text-2xl);
    }

    .hero-subtitle {
        font-size: var(--text-base);
    }

    .hero-badge {
        font-size: var(--text-xs);
    }

    .section-title {
        font-size: var(--text-xl);
    }

    .auth-title {
        font-size: var(--text-xl);
    }

    .btn-lg {
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-sm);
    }

    .pricing-price {
        font-size: var(--text-3xl);
    }

    .stat-card-value {
        font-size: var(--text-2xl);
    }

    .dashboard-body {
        padding: var(--space-4);
    }

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

    .card-header {
        padding: var(--space-4);
    }
}

/* ================================
   MOBILE SMALL (320px and below)
   ================================ */
@media (max-width: 320px) {
    :root {
        --container-padding: 0.75rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .auth-card {
        padding: var(--space-5);
    }
}

/* ================================
   HOVER STATES (Pointer devices only)
   ================================ */
@media (hover: hover) {
    .card-interactive:hover {
        transform: translateY(-2px);
    }

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

/* ================================
   REDUCED MOTION
   ================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ================================
   PRINT STYLES
   ================================ */
@media print {

    .navbar,
    .sidebar,
    .footer,
    .btn,
    .toast-container {
        display: none !important;
    }

    .main-content {
        margin: 0;
    }

    body {
        background: white;
        color: black;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    .card {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}