/* Responsive Layout Styles */

/* Base layout styles */
body {
    overflow-x: hidden;
}

/* Mobile-first approach */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Sidebar styles */
.sidebar-mobile {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 256px;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.sidebar-mobile.open {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Main content responsive */
.main-content {
    flex: 1;
    width: 100%;
    padding: 1rem;
    transition: margin-left 0.3s ease-in-out;
}

/* Tablet styles (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .main-content {
        padding: 1.25rem;
    }
    
    .sidebar-mobile {
        width: 240px;
    }
    
    /* Reduce font sizes for tablet */
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.375rem;
        line-height: 1.3;
    }
    
    p {
        font-size: 1rem;
        line-height: 1.5;
    }
}

/* Desktop styles (1024px and above) */
@media (min-width: 1024px) {
    .main-container {
        flex-direction: row;
    }
    
    .sidebar-mobile {
        position: relative;
        transform: none;
        height: auto;
        min-height: 100vh;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    
    .sidebar-overlay {
        display: none;
    }
}

/* Large desktop styles (1280px and above) */
@media (min-width: 1280px) {
    .main-content {
        padding: 2rem;
    }
}

/* Small Mobile (481px - 640px) */
@media (min-width: 481px) and (max-width: 640px) {
    .main-content {
        padding: 0.75rem;
    }
    
    .sidebar-mobile {
        width: 220px;
    }
    
    /* Reduce font sizes for small mobile */
    body {
        font-size: 15px;
        line-height: 1.4;
    }
    
    h1 {
        font-size: 1.625rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.375rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
        line-height: 1.3;
    }
    
    p {
        font-size: 0.9375rem;
        line-height: 1.4;
    }
}

/* Extra small mobile (up to 480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .sidebar-mobile {
        width: 200px;
    }
    
    /* Reduce font sizes for mobile */
    body {
        font-size: 14px;
        line-height: 1.4;
    }
    
    h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.25rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.125rem;
        line-height: 1.3;
    }
    
    p {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .text-sm {
        font-size: 0.75rem;
    }
    
    .text-xs {
        font-size: 0.625rem;
    }
}

/* Header responsive adjustments */
@media (max-width: 640px) {
    .header-container {
        padding: 0.75rem;
    }
    
    .header-title {
        font-size: 0.875rem;
    }
    
    .header-logo {
        width: 1.75rem;
        height: 1.75rem;
    }
}

/* Content cards responsive */
@media (max-width: 768px) {
    .content-card {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }
    
    .content-card h2 {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }
    
    .content-card p {
        font-size: 0.8125rem;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .content-card {
        margin-bottom: 0.5rem;
        padding: 0.5rem;
    }
    
    .content-card h2 {
        font-size: 1rem;
        margin-bottom: 0.375rem;
    }
    
    .content-card p {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* Grid responsive */
@media (max-width: 640px) {
    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1025px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Button responsive */
@media (max-width: 480px) {
    .btn-responsive {
        padding: 0.375rem 0.5rem;
        font-size: 0.6875rem;
        min-height: 36px;
    }
    
    .btn-responsive i {
        margin-right: 0.25rem;
        font-size: 0.75rem;
    }
}

@media (min-width: 481px) and (max-width: 640px) {
    .btn-responsive {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-height: 40px;
    }
    
    .btn-responsive i {
        margin-right: 0.25rem;
        font-size: 0.875rem;
    }
}

/* Form responsive */
@media (max-width: 640px) {
    .form-responsive {
        padding: 0.75rem;
    }
    
    .form-responsive .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-responsive label {
        font-size: 0.8125rem;
        margin-bottom: 0.25rem;
    }
    
    .form-responsive input,
    .form-responsive select,
    .form-responsive textarea {
        padding: 0.375rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .form-responsive {
        padding: 0.5rem;
    }
    
    .form-responsive .form-group {
        margin-bottom: 0.5rem;
    }
    
    .form-responsive label {
        font-size: 0.75rem;
        margin-bottom: 0.125rem;
    }
    
    .form-responsive input,
    .form-responsive select,
    .form-responsive textarea {
        padding: 0.25rem;
        font-size: 0.75rem;
    }
}

/* Table responsive */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 500px;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.375rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .table-responsive table {
        min-width: 400px;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.25rem;
        font-size: 0.75rem;
    }
}

/* Modal responsive */
@media (max-width: 640px) {
    .modal-responsive {
        margin: 0.75rem;
        max-width: calc(100vw - 1.5rem);
        max-height: calc(100vh - 1.5rem);
    }
    
    .modal-responsive .modal-header {
        padding: 0.75rem;
    }
    
    .modal-responsive .modal-body {
        padding: 0.75rem;
    }
    
    .modal-responsive .modal-footer {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .modal-responsive {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
    }
    
    .modal-responsive .modal-header {
        padding: 0.5rem;
    }
    
    .modal-responsive .modal-body {
        padding: 0.5rem;
    }
    
    .modal-responsive .modal-footer {
        padding: 0.5rem;
    }
}

/* Navigation responsive */
@media (max-width: 768px) {
    .nav-responsive {
        flex-direction: column;
        gap: 0.375rem;
    }
    
    .nav-responsive .nav-item {
        width: 100%;
    }
    
    .nav-responsive .nav-link {
        padding: 0.625rem;
        justify-content: flex-start;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .nav-responsive {
        gap: 0.25rem;
    }
    
    .nav-responsive .nav-link {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }
}

/* Utility classes for responsive */
.hidden-mobile {
    display: none;
}

@media (min-width: 768px) {
    .hidden-mobile {
        display: block;
    }
}

.visible-mobile {
    display: block;
}

@media (min-width: 768px) {
    .visible-mobile {
        display: none;
    }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
    button, a, input, select, textarea {
        min-height: 40px;
        min-width: 40px;
    }
    
    .touch-target {
        padding: 0.625rem;
        margin: 0.25rem;
    }
}

@media (max-width: 480px) {
    button, a, input, select, textarea {
        min-height: 36px;
        min-width: 36px;
    }
    
    .touch-target {
        padding: 0.5rem;
        margin: 0.125rem;
    }
}

/* Performance optimizations */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    .smooth-scroll {
        -webkit-overflow-scrolling: touch;
    }
}

/* Print styles */
@media print {
    .sidebar-mobile,
    .sidebar-overlay,
    .header {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
} 