/* ========================================
   Evaluation Module Styles
   ======================================== */

.container {
    width: 90%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.main-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.main-title h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.primary-button {
    background: var(--accent-gradient);
    color: var(--text-inverse);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-base);
    box-shadow: var(--glow-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.edit-button,
.delete-button {
    color: var(--text-inverse);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-base);
    border: none;
    cursor: pointer;
    font-family: var(--font-base);
    display: inline-block;
}

.edit-button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.delete-button {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.edit-button:hover,
.delete-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.content-card {
    background: var(--surface-strong);
    border-radius: var(--radius-md);
    padding: clamp(1.5rem, 3vw, 2rem);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--surface-border);
}

.table-responsive {
    overflow-x: auto;
    margin-top: 1rem;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.custom-table th,
.custom-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--surface-border);
}

.custom-table thead {
    background: var(--surface-muted);
}

.custom-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.custom-table tbody tr {
    transition: var(--transition-base);
}

.custom-table tbody tr:hover {
    background: var(--surface-muted);
}

.custom-table .actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.custom-table .d-inline {
    display: inline;
}

.pagination-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.alert-success {
    background: var(--success-gradient);
    color: var(--text-inverse);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    box-shadow: var(--glow-success);
}

.form-card {
    background: var(--surface-strong);
    border-radius: var(--radius-md);
    padding: clamp(1.5rem, 3vw, 2rem);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--surface-border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    background: var(--surface-muted);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-base);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--glow-primary);
    background: var(--surface);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.image-preview-container {
    margin-top: 1rem;
    text-align: center;
}

.image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    object-fit: cover;
}

.audio-preview {
    margin-top: 1rem;
}

.back-button {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-base);
}

.back-button:hover {
    color: var(--accent);
    text-decoration: underline;
}

.text-center {
    text-align: center;
}

/* Toggle Switch Styles */
.toggle-switch-wrapper {
    display: inline-block;
}

.toggle-switch-checkbox {
    display: none;
}

.toggle-switch-label {
    display: block;
    cursor: pointer;
    border-radius: 50px;
    position: relative;
    width: 90px;
    height: 40px;
    margin: 0 auto;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toggle-switch-label:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toggle-switch-inner {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.toggle-switch-inner:before {
    content: "لا ✗";
}

.toggle-switch-checkbox:checked + .toggle-switch-label {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toggle-switch-checkbox:checked + .toggle-switch-label .toggle-switch-inner:before {
    content: "نعم ✓";
}

.toggle-switch-switch {
    display: block;
    width: 32px;
    height: 32px;
    margin: 4px;
    background: white;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.toggle-switch-checkbox:checked + .toggle-switch-label .toggle-switch-switch {
    left: calc(100% - 36px);
}

/* Evaluation Table Enhancements */
.evaluation-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    margin-top: 1.5rem;
}

.evaluation-table thead th {
    background: var(--accent-gradient);
    color: white;
    padding: 1rem;
    font-weight: 600;
    text-align: right;
    border: none;
}

.evaluation-table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.evaluation-table thead th:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.evaluation-table tbody tr {
    transition: var(--transition-base);
}

.evaluation-table tbody td {
    background: var(--surface-strong);
    padding: 1.25rem 1rem;
    border-top: 1px solid var(--surface-border);
    border-bottom: 1px solid var(--surface-border);
}

.evaluation-table tbody td:first-child {
    border-right: 1px solid var(--surface-border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.evaluation-table tbody td:last-child {
    border-left: 1px solid var(--surface-border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.evaluation-table tbody tr:hover td {
    background: var(--accent-soft);
    transform: scale(1.01);
}

/* Save Button */
.btn-success {
    background: var(--success-gradient);
    color: white;
    padding: 0.85rem 2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: var(--glow-success);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.btn-success i {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .main-title {
        flex-direction: column;
        align-items: stretch;
    }

    .main-title h1 {
        text-align: center;
    }

    .primary-button {
        justify-content: center;
        width: 100%;
    }

    .custom-table th,
    .custom-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    .custom-table .actions-cell {
        flex-direction: column;
        align-items: stretch;
    }

    .edit-button,
    .delete-button {
        width: 100%;
        text-align: center;
    }

    .toggle-switch-label {
        width: 80px;
        height: 36px;
    }

    .toggle-switch-inner {
        font-size: 12px;
    }

    .toggle-switch-switch {
        width: 28px;
        height: 28px;
    }

    .toggle-switch-checkbox:checked + .toggle-switch-label .toggle-switch-switch {
        left: calc(100% - 32px);
    }

    .evaluation-table tbody td {
        padding: 1rem 0.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 540px) {
    .container {
        width: 95%;
        padding: 0 0.5rem;
    }

    .content-card,
    .form-card {
        padding: 1rem;
    }
}
