/* 
 * Responsive Design for Dashboard Pages
 * Mobile-First Approach for Student/Teacher Dashboards
 */

/* ========================================
   DASHBOARD BASE STYLES (Mobile First)
   ======================================== */

/* Header Responsive */
.header {
    background-color: #dff4ec;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #cfe5d7;
    flex-wrap: wrap;
    gap: 10px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    background-color: #007a5f;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 1.1rem;
}

.header h1 {
    font-weight: 700;
    color: #1a2e2a;
    margin: 0;
    font-size: 1.1rem;
}

.user-profile {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

/* Navigation Mobile */
.nav-container {
    width: 100%;
    order: 3;
    margin-top: 10px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-item {
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item:hover,
.nav-item.active {
    background: #007a5f;
    color: white;
    text-decoration: none;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Main Content Mobile */
.main-content {
    padding: 15px;
    background: #f5fff7;
    min-height: calc(100vh - 120px);
}

.content-header {
    margin-bottom: 20px;
}

.content-header h2 {
    font-size: 1.5rem;
    color: #1a2e2a;
    margin-bottom: 8px;
}

.content-header p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Cards Mobile */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-header h3 {
    font-size: 1.2rem;
    color: #1a2e2a;
    margin: 0;
}

.card-body {
    padding: 0;
}

/* Stats Cards Mobile */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card .icon {
    width: 50px;
    height: 50px;
    background: #e8f8f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
    color: #007a5f;
}

.stat-card .number {
    font-size: 2rem;
    font-weight: 700;
    color: #007a5f;
    margin-bottom: 4px;
}

.stat-card .label {
    font-size: 0.9rem;
    color: #666;
}

/* Tables Mobile */
.table-responsive {
    overflow-x: auto;
    margin: -20px;
    padding: 20px;
}

.table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.table td {
    color: #666;
}

/* Buttons Mobile */
.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #007a5f;
    color: white;
}

.btn-primary:hover {
    background: #006b4f;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 1rem;
}

/* Forms Mobile */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007a5f;
    box-shadow: 0 0 0 3px rgba(0, 122, 95, 0.1);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
    appearance: none;
}

/* Alerts Mobile */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Modal Mobile */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 15px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a2e2a;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ========================================
   TABLET (768px+)
   ======================================== */

@media (min-width: 768px) {
    .header {
        padding: 16px 30px;
        flex-wrap: nowrap;
    }
    
    .logo-icon {
        padding: 8px 12px;
        font-size: 1.2rem;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .user-profile {
        font-size: 1rem;
    }
    
    .nav-container {
        width: auto;
        order: initial;
        margin-top: 0;
    }
    
    .nav {
        flex-direction: row;
        background: transparent;
        padding: 0;
        box-shadow: none;
        gap: 12px;
    }
    
    .nav-item {
        padding: 10px 16px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .main-content {
        padding: 25px 30px;
    }
    
    .content-header h2 {
        font-size: 1.8rem;
    }
    
    .content-header p {
        font-size: 1rem;
    }
    
    .stats-grid {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .stat-card {
        flex: 1;
        min-width: 200px;
    }
    
    .stat-card .icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .stat-card .number {
        font-size: 2.2rem;
    }
    
    .stat-card .label {
        font-size: 1rem;
    }
    
    .table th,
    .table td {
        padding: 15px 12px;
        font-size: 0.9rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 12px 20px;
    }
    
    .form-control {
        font-size: 1rem;
        padding: 14px 18px;
    }
    
    .form-label {
        font-size: 1rem;
    }
    
    .alert {
        font-size: 1rem;
        padding: 15px 20px;
    }
    
    .modal {
        padding: 30px;
    }
    
    .modal-content {
        max-width: 600px;
    }
    
    .modal-header {
        padding: 25px 25px 20px;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
    
    .modal-body {
        padding: 25px;
    }
    
    .modal-footer {
        padding: 20px 25px 25px;
    }
}

/* ========================================
   DESKTOP (992px+)
   ======================================== */

@media (min-width: 992px) {
    .header {
        padding: 20px 40px;
    }
    
    .logo-icon {
        font-size: 1.3rem;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .nav {
        gap: 16px;
    }
    
    .nav-item {
        padding: 12px 20px;
    }
    
    .main-content {
        padding: 30px 40px;
    }
    
    .content-header h2 {
        font-size: 2rem;
    }
    
    .stats-grid {
        gap: 25px;
    }
    
    .stat-card {
        padding: 25px;
    }
    
    .stat-card .icon {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }
    
    .stat-card .number {
        font-size: 2.5rem;
    }
    
    .card {
        padding: 25px;
    }
    
    .card-header h3 {
        font-size: 1.4rem;
    }
    
    .table th,
    .table td {
        padding: 18px 15px;
        font-size: 1rem;
    }
    
    .btn {
        font-size: 1rem;
        padding: 14px 24px;
    }
    
    .modal-content {
        max-width: 700px;
    }
}

/* ========================================
   LARGE DESKTOP (1200px+)
   ======================================== */

@media (min-width: 1200px) {
    .header {
        padding: 22px 50px;
    }
    
    .main-content {
        padding: 40px 50px;
    }
    
    .content-header h2 {
        font-size: 2.2rem;
    }
    
    .stats-grid {
        gap: 30px;
    }
    
    .stat-card {
        padding: 30px;
    }
    
    .card {
        padding: 30px;
    }
    
    .modal-content {
        max-width: 800px;
    }
}

/* ========================================
   FIND TEACHER PAGE RESPONSIVE
   ======================================== */

.find-teachers-section {
    padding: 20px 15px;
    background: #f5fff7;
    min-height: 100vh;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #007a5f;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.find-teachers-section h2 {
    font-size: 1.8rem;
    color: #1a2e2a;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    margin-bottom: 25px;
    font-size: 1rem;
}

/* Filter Box Mobile */
.filter-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.filter-box h3 {
    font-size: 1.2rem;
    color: #1a2e2a;
    margin-bottom: 15px;
}

.filter-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.filter-group select {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
}

.clear-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
}

.clear-btn:hover {
    background: #5a6268;
}

.price-range {
    margin-top: 15px;
}

.price-range label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.price-range input[type="range"] {
    width: 100%;
    margin-bottom: 10px;
}

.available-days {
    margin-top: 15px;
}

.available-days label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.days-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.days-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.days-grid input[type="checkbox"] {
    margin: 0;
}

/* Teachers Grid Mobile */
.teachers-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.teacher-card-find {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

.teacher-card-find .teacher-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.teacher-card-find .teacher-info {
    padding: 20px;
}

.teacher-card-find .teacher-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a2e2a;
    margin-bottom: 8px;
}

.teacher-card-find .teacher-details {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 12px;
}

.teacher-card-find .teacher-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.teacher-card-find .subject-tag {
    background: #e8f8f1;
    color: #007a5f;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.teacher-card-find .teacher-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Tablet Responsive for Find Teacher */
@media (min-width: 768px) {
    .find-teachers-section {
        padding: 25px 30px;
    }
    
    .find-teachers-section h2 {
        font-size: 2rem;
    }
    
    .filter-row {
        flex-direction: row;
        align-items: end;
        gap: 20px;
    }
    
    .filter-group {
        flex: 1;
    }
    
    .clear-btn {
        width: auto;
        margin-top: 0;
        align-self: end;
    }
    
    .days-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .teachers-grid {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .teacher-card-find {
        width: 300px;
    }
    
    .teacher-card-find .teacher-actions {
        flex-direction: row;
    }
}

/* Desktop Responsive for Find Teacher */
@media (min-width: 992px) {
    .find-teachers-section {
        padding: 30px 40px;
    }
    
    .teachers-grid {
        gap: 25px;
    }
    
    .teacher-card-find {
        width: 320px;
    }
    
    .days-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

@media (min-width: 1200px) {
    .find-teachers-section {
        padding: 40px 50px;
    }
    
    .teachers-grid {
        gap: 30px;
    }
    
    .teacher-card-find {
        width: 350px;
    }
}

/* ========================================
   UTILITY CLASSES FOR DASHBOARDS
   ======================================== */

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-align: center;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007a5f;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Images */
.img-responsive {
    max-width: 100%;
    height: auto;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 30px;
    height: 30px;
}

.avatar-lg {
    width: 60px;
    height: 60px;
}

/* Responsive Tables */
@media (max-width: 767px) {
    .table-stack {
        display: block;
    }
    
    .table-stack thead {
        display: none;
    }
    
    .table-stack tbody,
    .table-stack tr,
    .table-stack td {
        display: block;
    }
    
    .table-stack tr {
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        background: white;
    }
    
    .table-stack td {
        border: none;
        padding: 8px 0;
        position: relative;
        padding-left: 40%;
    }
    
    .table-stack td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 35%;
        font-weight: 600;
        color: #333;
    }
}