/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Heebo', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-brand i {
    font-size: 1.5rem;
    color: #f39c12;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.page-header p {
    font-size: 1.1rem;
    color: #666;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-icon {
    font-size: 4rem;
    color: #3498db;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #f39c12;
    margin-bottom: 2rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

/* Feature Cards */
.features-section {
    margin: 4rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-outline {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Instructions Section */
.instructions-section {
    margin: 4rem 0;
}

.instructions-card {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.instructions-card h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.instruction-step {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.step-number {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h4 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.step-content p {
    color: #666;
    line-height: 1.6;
}

/* Categories Preview */
.categories-preview {
    margin: 4rem 0;
    text-align: center;
}

.categories-preview h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 2rem;
}

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

.category-item {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.category-item:hover {
    transform: translateY(-5px);
}

.category-item i {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.category-item h4 {
    color: #2c3e50;
    font-size: 1.1rem;
}

/* Procedures Styles */
.procedures-container {
    max-width: 900px;
    margin: 0 auto;
}

.procedure-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.procedure-header {
    padding: 1.5rem 2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
}

.procedure-header:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
}

.procedure-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.procedure-title i {
    font-size: 1.5rem;
    color: #3498db;
}

.procedure-title h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin: 0;
}

.toggle-icon {
    font-size: 1.2rem;
    color: #666;
    transition: transform 0.3s ease;
}

.procedure-content {
    display: none;
    padding: 2rem;
}

.procedure-description {
    margin-bottom: 2rem;
}

.procedure-description p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
}

.procedure-section {
    margin-bottom: 2rem;
}

.procedure-section h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.section-content p {
    color: #555;
    margin-bottom: 0.5rem;
    padding-right: 1rem;
    line-height: 1.6;
}

/* Exam Styles */
.exam-section {
    max-width: 900px;
    margin: 0 auto 3rem auto;
}

.form-card {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.form-card h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.form-group label {
    display: block;
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    direction: rtl;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.exam-header {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-progress {
    flex: 1;
}

.progress-bar {
    background: #e9ecef;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    background: linear-gradient(135deg, #3498db, #2980b9);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #666;
    font-size: 0.9rem;
}

.exam-timer {
    color: #e74c3c;
    font-weight: 600;
    font-size: 1.1rem;
}

.question-card {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.question-header {
    margin-bottom: 2rem;
}

.question-category {
    color: #3498db;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-text {
    color: #2c3e50;
    font-size: 1.3rem;
    line-height: 1.6;
    margin-top: 1rem;
}

.answer-options {
    margin: 2rem 0;
}

.answer-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.answer-option:hover {
    background: #e9ecef;
    border-color: #3498db;
}

.answer-option.selected {
    background: #ebf3fd;
    border-color: #3498db;
    color: #2980b9;
}

.answer-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
}

.exam-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Results Styles */
.results-card {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.results-header {
    margin-bottom: 2rem;
}

.results-header i {
    font-size: 4rem;
    color: #f39c12;
    margin-bottom: 1rem;
}

.results-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin: 0;
}

.results-content {
    text-align: right;
}

.result-item {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-label {
    color: #666;
    font-weight: 500;
}

.result-value {
    color: #2c3e50;
    font-weight: 600;
}

.score-display {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
    text-align: center;
}

.score-percentage {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.score-text {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Admin Styles */
.admin-section {
    max-width: 1400px;
    margin: 0 auto;
}

/* Admin Tabs */
.admin-tabs {
    margin-top: 2rem;
}

.tab-nav {
    display: flex;
    background: white;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.tab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.tab-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.tab-btn.active {
    background: #3498db;
    color: white;
}

.tab-content {
    display: none;
    background: white;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    padding: 2rem;
    min-height: 400px;
}

.tab-content.active {
    display: block;
}

/* Content Headers */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.content-header h2 {
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Procedures List */
.procedures-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.procedure-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.procedure-card:hover {
    border-color: #3498db;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
}

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

.procedure-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
}

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

.procedure-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.sections-count {
    color: #3498db;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Questions List */
.questions-summary {
    margin-bottom: 2rem;
}

.summary-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.summary-card h3 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
}

.questions-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #3498db;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
    display: block;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.questions-list {
    display: grid;
    gap: 1rem;
}

.question-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.question-card:hover {
    border-color: #3498db;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
}

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

.question-category {
    background: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

.question-text {
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.question-answers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.answer-option {
    padding: 0.5rem;
    background: white;
    border-radius: 5px;
    font-size: 0.9rem;
}

.answer-option.correct {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.login-header h2 {
    color: #2c3e50;
    margin: 0;
}

.login-error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid #f5c6cb;
}

.admin-actions {
    display: flex;
    gap: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #3498db;
    color: white;
}

.stat-icon.success {
    background: #27ae60;
}

.stat-icon.danger {
    background: #e74c3c;
}

.stat-icon.warning {
    background: #f39c12;
}

.stat-content h3 {
    color: #2c3e50;
    font-size: 2rem;
    margin: 0;
}

.stat-content p {
    color: #666;
    margin: 0.5rem 0 0 0;
}

.results-table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h2 {
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-filters select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background: white;
}

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

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

.results-table th,
.results-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid #dee2e6;
}

.results-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}

.results-table tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

.status-passed {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Error States */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #f5c6cb;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .instruction-step {
        flex-direction: column;
        gap: 1rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .exam-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .exam-navigation {
        flex-direction: column;
    }
    
    .admin-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .form-card,
    .question-card,
    .results-card {
        padding: 2rem 1.5rem;
    }
    
    .hero-content {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
}
