/**
 * Instructor Dashboard - Page Specific Styles
 * 教師 Dashboard 頁面專用樣式
 */

/* ==================== Common Page Styles ==================== */

.page-section {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header h1 i {
    color: var(--primary-color);
}

/* ==================== Filters Bar ==================== */

.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-gray);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.filters-bar select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filters-bar select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==================== Courses Grid ==================== */

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.course-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-status {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.course-status.published {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.course-status.draft {
    background: rgba(249, 115, 22, 0.9);
    color: white;
}

.course-status.archived {
    background: rgba(107, 114, 128, 0.9);
    color: white;
}

.course-info {
    padding: 1.25rem;
}

.course-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.course-info p {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-gray);
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.course-meta i {
    color: var(--primary-color);
}

.course-actions {
    display: flex;
    gap: 0.5rem;
}

.course-actions button {
    flex: 1;
}

/* ==================== Data Table ==================== */

.data-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f9fafb;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.95rem;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.progress-bar {
    width: 100px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    display: inline-block;
    margin-right: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 10px;
    transition: width 0.3s;
}

/* ==================== Settings Styles ==================== */

.settings-grid,
.settings-sections {
    display: grid;
    gap: 1.5rem;
}

.settings-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.settings-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.settings-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-gray);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ==================== Charts ==================== */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.chart-placeholder {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 8px;
    color: var(--text-gray);
}

.chart-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==================== Feedback ==================== */

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feedback-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.feedback-rating {
    color: #f59e0b;
    font-size: 1.1rem;
}

.course-name {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 0.25rem;
}

.feedback-comment {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.feedback-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feedback-date {
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* ==================== Income ==================== */

.income-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ==================== Status Badges ==================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-badge.completed {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-badge.pending {
    background: rgba(249, 115, 22, 0.1);
    color: #ea580c;
}

.status-badge i {
    font-size: 0.6rem;
}

/* ==================== Notification Settings ==================== */

.notification-setting {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.notification-setting:last-child {
    border-bottom: none;
}

/* ==================== Empty States ==================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-gray);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1.1rem;
}

/* ==================== Videos Grid ==================== */

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ==================== Articles List ==================== */

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==================== Quiz List ==================== */

.quiz-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==================== Responsive Design ==================== */

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filters-bar {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        overflow-x: auto;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}
