/* Responsive CSS untuk Sistem Usulan
 * File ini berisi style tambahan untuk membuat website responsif
 */

/* Base responsive styles */
html, body {
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%;
}

img, video {
    max-width: 100%;
    height: auto;
}

/* Styles untuk tabel responsif */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

/* Styles untuk form responsif */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        margin-bottom: 0.5rem;
    }
    
    .input-group {
        flex-wrap: wrap;
    }
    
    .input-group > .form-control {
        flex: 1 1 auto;
        width: auto;
    }
    
    .card-form {
        padding: 1rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Perbaikan untuk tombol di form */
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Styles untuk card dan dashboard */
@media (max-width: 992px) {
    .card-dashboard {
        height: auto !important;
    }
    
    .dashboard-stats {
        flex-direction: column;
    }
    
    .stat-card {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .chart-container {
        height: auto !important;
        min-height: 300px;
    }
}

/* Styles untuk sidebar responsif */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 240px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 15px rgba(0,0,0,0.2);
    }
    
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .header {
        left: 0 !important;
        width: 100% !important;
    }
    
    /* Styling untuk tombol toggle sidebar */
    .toggle-sidebar {
        display: block !important;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1060;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: var(--primary-color);
        color: #fff;
        border: none;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        transition: all 0.3s ease;
    }
    
    .toggle-sidebar:hover,
    .toggle-sidebar:focus {
        background-color: var(--primary-dark);
        box-shadow: 0 3px 8px rgba(0,0,0,0.3);
        color: #fff;
    }
    
    /* Tambahkan padding pada konten utama untuk menghindari tumpang tindih dengan tombol toggle */
    .main-content {
        padding-top: 60px;
    }
}

/* Styles untuk tampilan mobile */
@media (max-width: 576px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }
    
    .dropdown-menu {
        width: 100%;
        left: 0 !important;
        right: 0 !important;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-item {
        margin-bottom: 0.25rem;
    }
    
    /* Perbaikan untuk filter dan pencarian */
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Perbaikan untuk detail view */
    .detail-header {
        flex-direction: column;
    }
    
    .detail-actions {
        margin-top: 1rem;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    /* Perbaikan untuk tampilan tab */
    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
    }
    
    .nav-tabs .nav-item {
        float: none;
        display: inline-block;
    }
}

/* Perbaikan untuk gambar responsif */
img.responsive-img {
    max-width: 100%;
    height: auto;
}

/* Perbaikan untuk grid layout */
.grid-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

@media (max-width: 768px) {
    .grid-responsive {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 576px) {
    .grid-responsive {
        grid-template-columns: 1fr;
    }
}

/* Perbaikan untuk print media */
@media print {
    .sidebar, .header-nav, .footer, .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
