/* Moray School Services - Responsive Styles */

/* Mobile First Approach */

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 767.98px) {
    .container {
        padding: 0 15px;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 1rem 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Hero Section */
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-placeholder {
        width: 200px;
        height: 200px;
        font-size: 1rem;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    /* Blog */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Forms */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: auto;
    }
    
    .table {
        min-width: 600px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .nav-menu {
        display: flex;
    }
    
    .hamburger {
        display: none;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .btn,
    .hamburger {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-placeholder {
        border-width: 2px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* This can be expanded for dark mode support if needed */
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Accessibility */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus,
    .form-control:focus,
    .nav-link:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
}

/* Admin and Client Area Responsive Styles */
@media (max-width: 767.98px) {
    /* Dashboard Cards */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    /* Tables in admin/client areas */
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 4px;
    }
    
    /* Form layouts */
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        margin-bottom: 1rem;
    }
    
    /* Modal dialogs */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    /* Sidebar navigation */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    /* Button groups */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin: 0.25rem 0;
        width: 100%;
    }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop specific adjustments */
@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Sidebar layout for admin/client areas */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 250px;
        background-color: #343a40;
        z-index: 1000;
    }
    
    .main-content {
        margin-left: 250px;
        min-height: 100vh;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-placeholder {
        width: 150px;
        height: 150px;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table th,
    .table td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
}
