/* =========================================================
   استایل‌های مشترک بخش آموزش
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 15px;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 25px;
}

/* =========================================================
   هدر (مشترک با سایر بخش‌ها)
   ========================================================= */
.main-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 15px 20px 12px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.main-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.05), transparent 60%);
    pointer-events: none;
}
.main-header h1 {
    font-size: 24px;
    margin: 0 0 4px 0;
    font-weight: 700;
    position: relative;
    z-index: 1;
}
.main-header .subtitle {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.85;
    margin: 0 0 10px 0;
    position: relative;
    z-index: 1;
}
.main-header .back-link {
    display: inline-block;
    color: #ffd700;
    text-decoration: none;
    margin-top: 8px;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    z-index: 1;
    cursor: pointer;
}
.main-header .back-link:hover {
    text-decoration: underline;
}

/* =========================================================
   نوار مدیریت
   ========================================================= */
.admin-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 8px;
}
.admin-bar .admin-info {
    font-size: 13px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 6px;
}
.admin-bar .admin-info .admin-name {
    color: #3498db;
    font-weight: bold;
}
.admin-bar .admin-info .role-badge {
    font-size: 10px;
    padding: 2px 10px;
    border-radius: 20px;
    background: #ffc107;
    color: #856404;
    font-weight: 600;
}
.admin-bar .logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}
.admin-bar .logout-btn:hover {
    background: #c82333;
}

/* =========================================================
   دکمه‌ها
   ========================================================= */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: Tahoma;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.btn-primary {
    background: #3498db;
    color: white;
}
.btn-primary:hover {
    background: #2980b9;
}
.btn-success {
    background: #28a745;
    color: white;
}
.btn-success:hover {
    background: #218838;
}
.btn-danger {
    background: #dc3545;
    color: white;
}
.btn-danger:hover {
    background: #c82333;
}
.btn-warning {
    background: #ffc107;
    color: #2c3e50;
}
.btn-warning:hover {
    background: #e0a800;
}
.btn-secondary {
    background: #95a5a6;
    color: white;
}
.btn-secondary:hover {
    background: #7f8c8d;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.btn-block {
    width: 100%;
    justify-content: center;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================================================
   فرم‌ها
   ========================================================= */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}
.form-group label .required {
    color: #dc3545;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: Tahoma;
    font-size: 15px;
    transition: border 0.3s;
    box-sizing: border-box;
}
.form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.2);
}
textarea.form-control {
    min-height: 80px;
    resize: vertical;
}
select.form-control {
    appearance: auto;
}

/* =========================================================
   آپلود فایل
   ========================================================= */
.file-upload-wrapper {
    position: relative;
    width: 100%;
}
.file-upload-wrapper .file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.file-upload-wrapper .file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 50px;
}
.file-upload-wrapper .file-label:hover {
    border-color: #3498db;
    background: #eaf4fb;
}
.file-upload-wrapper .file-label .file-name {
    font-size: 13px;
    color: #7f8c8d;
}
.file-upload-wrapper .file-preview {
    margin-top: 10px;
    max-width: 150px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 5px;
    background: #f8f9fa;
}
.file-upload-wrapper .file-preview video {
    width: 100%;
    border-radius: 4px;
}
.file-upload-wrapper .file-preview img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* =========================================================
   نوتیفیکیشن
   ========================================================= */
.notification {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    font-weight: 600;
}
.notification.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.notification.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.notification.info {
    display: block;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
.notification.warning {
    display: block;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

/* =========================================================
   Empty State
   ========================================================= */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}
.empty-state .icon {
    font-size: 48px;
    margin-bottom: 15px;
}
.empty-state h3 {
    color: #2c3e50;
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 14px;
}

/* =========================================================
   لودر
   ========================================================= */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #7f8c8d;
}
.loader-container .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52,152,219,0.15);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 0.8s ease-in-out infinite;
    margin-bottom: 12px;
}
.loader-container p {
    font-size: 14px;
    color: #7f8c8d;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   مودال
   ========================================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    animation: modalSlide 0.3s ease;
}
@keyframes modalSlide {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}
.modal-content h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}
.modal-content .btn-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.modal-content .btn-row .btn {
    flex: 1;
}

/* =========================================================
   جدول مدیریت
   ========================================================= */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -5px;
    padding: 0 5px;
}
.table-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}
.table-header-actions .count {
    font-size: 14px;
    color: #7f8c8d;
}
.education-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    font-size: 13px;
}
.education-table th {
    background: #f1f3f5;
    padding: 10px 8px;
    text-align: center;
    border-bottom: 2px solid #dee2e6;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
}
.education-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}
.education-table .video-thumb {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
}
.education-table .badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}
.education-table .badge.active {
    background: #d4edda;
    color: #155724;
}
.education-table .badge.inactive {
    background: #f8d7da;
    color: #721c24;
}
.education-table .actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}
.education-table .actions .btn {
    padding: 3px 8px;
    font-size: 11px;
    min-width: 30px;
}

/* =========================================================
   ریسپانسیو
   ========================================================= */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    .main-header h1 {
        font-size: 20px;
    }
    .main-header .subtitle {
        font-size: 13px;
    }
    .main-header .back-link {
        font-size: 13px;
    }
    .admin-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .admin-bar .admin-info {
        justify-content: center;
    }
    .education-table {
        font-size: 12px;
        min-width: 550px;
    }
    .education-table .video-thumb {
        width: 60px;
        height: 40px;
    }
    .modal-content {
        padding: 20px;
    }
    .modal-content .btn-row {
        flex-direction: column;
    }
    .modal-content .btn-row .btn {
        width: 100%;
    }
    .table-header-actions {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .table-header-actions .add-btn {
        width: 100%;
    }
    .table-header-actions .add-btn .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    .container {
        padding: 10px;
        border-radius: 10px;
    }
    .main-header {
        padding: 12px 14px;
        border-radius: 8px;
    }
    .main-header h1 {
        font-size: 17px;
    }
    .main-header .subtitle {
        font-size: 12px;
    }
    .main-header .back-link {
        font-size: 12px;
    }
    .admin-bar {
        padding: 6px 10px;
        font-size: 12px;
    }
    .admin-bar .admin-info {
        font-size: 12px;
    }
    .admin-bar .logout-btn {
        font-size: 11px;
        padding: 4px 12px;
    }
    .btn {
        font-size: 13px;
        padding: 8px 14px;
    }
    .btn-sm {
        font-size: 11px;
        padding: 4px 10px;
    }
    .education-table {
        font-size: 11px;
        min-width: 400px;
    }
    .education-table th,
    .education-table td {
        padding: 5px 3px;
    }
    .education-table .video-thumb {
        width: 40px;
        height: 30px;
    }
    .form-control {
        font-size: 13px;
        padding: 8px 10px;
    }
    .file-upload-wrapper .file-label {
        font-size: 13px;
        padding: 8px 12px;
        min-height: 40px;
    }
    .modal-content {
        padding: 15px;
    }
    .modal-content h3 {
        font-size: 17px;
    }
}

@media (max-width: 360px) {
    .main-header h1 {
        font-size: 15px;
    }
    .main-header .subtitle {
        font-size: 11px;
    }
    .main-header .back-link {
        font-size: 11px;
    }
    .admin-bar .admin-info {
        font-size: 11px;
    }
    .admin-bar .logout-btn {
        font-size: 10px;
        padding: 3px 10px;
    }
    .education-table {
        font-size: 10px;
        min-width: 340px;
    }
    .education-table th,
    .education-table td {
        padding: 4px 2px;
    }
    .education-table .video-thumb {
        width: 32px;
        height: 24px;
    }
    .btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    .form-control {
        font-size: 12px;
        padding: 6px 8px;
    }
    .file-upload-wrapper .file-label {
        font-size: 12px;
        padding: 6px 10px;
    }
}