/* Admin Dashboard Responsive Styles */

@media (max-width: 1200px) {
    .dashboard-container {
        overflow-x: hidden;
    }
    
    .main-content {
        flex: 1;
        transition: margin-left 0.3s ease;
    }
    
    .dashboard-header {
        padding: 0 20px;
    }
}

@media (max-width: 992px) {
    :root {
        --sidebar-width: 250px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-header {
        left: 0;
    }
    
    .mobile-toggle-sidebar {
        display: block;
    }
    
    .stats-container,
    .panelist-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-card {
        overflow-x: auto;
    }
    
    .chart-container {
        min-width: 500px;
    }
    
    /* Landscape stats container responsive fix */
    .stats-container[style*="display: flex"] {
        flex-direction: column !important;
    }
    
    .stats-container[style*="display: flex"] .stat-card {
        min-width: 100% !important;
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        top: 0;
        transform: translateY(-100%);
    }
    
    .sidebar.active {
        transform: translateY(0);
        height: 100vh;
    }
    
    .stats-container,
    .panelist-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .content-wrapper {
        padding: 20px 15px;
    }
    
    .dashboard-card {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header .btn {
        margin-top: 10px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .panelist-table th, 
    .panelist-table td {
        padding: 8px;
        font-size: 14px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .dashboard-header {
        height: auto;
        padding: 10px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .user-nav {
        width: 100%;
        justify-content: space-between;
    }
    
    .mobile-toggle-sidebar {
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 0 auto;
        text-align: center;
    }
    
    /* Survey table responsiveness */
    .survey-table {
        display: block;
        width: 100%;
    }
    
    .survey-table thead {
        display: none;
    }
    
    .survey-table tbody {
        display: block;
        width: 100%;
    }
    
    .survey-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 5px;
    }
    
    .survey-table td {
        display: flex;
        padding: 8px 10px;
        text-align: right;
        position: relative;
        border-bottom: 1px solid var(--border-color);
    }
    
    .survey-table td:last-child {
        border-bottom: none;
    }
    
    .survey-table td:before {
        content: attr(data-label);
        font-weight: 600;
        position: absolute;
        left: 10px;
        width: 40%;
        white-space: nowrap;
        text-align: left;
    }
    
    /* Assigned survey responsiveness */
    .assigned-survey-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .assigned-survey-info {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .assigned-survey-info span {
        margin-right: 0;
    }
    
    .assigned-survey-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .assigned-survey-actions .btn,
    .assigned-survey-actions .survey-link-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .dashboard-card .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .panelist-table th, 
    .panelist-table td {
        white-space: nowrap;
    }
    
    .panel-title {
        font-size: 16px;
    }
    
    .dashboard-header {
        padding: 10px 15px;
    }
    
    .user-info {
        display: none;
    }
    
    .chart-container {
        height: 200px;
        min-width: 300px;
    }
    
    .form-card {
        padding: 15px;
    }
    
    .form-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    /* Improve form elements on mobile */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on focus in iOS */
        padding: 12px !important;
    }
    
    /* Better touch targets */
    .checkbox-group label {
        padding: 8px 0;
        display: block;
    }
    
    .checkbox-group input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 10px;
        vertical-align: middle;
    }
    
    /* Improve button usability on mobile */
    .btn, button {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}