/* التصميم الرئيسي لصفحة الاستعلام */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    direction: rtl;
    color: #333;
}

/* Header */
.main-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-text h1 {
    font-size: 24px;
    color: #1a237e;
    margin-bottom: 5px;
}

.header-text h2 {
    font-size: 18px;
    color: #3949ab;
}

.header-logo .coat-of-arms {
    font-size: 48px;
}

.main-nav {
    background: #3949ab;
    padding: 15px;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.main-nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
}

/* Search Section */
.search-section {
    max-width: 600px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.search-box {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.search-box h2 {
    color: #1a237e;
    margin-bottom: 20px;
    text-align: center;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3949ab;
}

.btn-search {
    background: #3949ab;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-search:hover {
    background: #1a237e;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

/* Result Container */
.result-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* Student Card */
.student-card {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border: 2px dashed #3949ab;
    position: relative;
    overflow: hidden;
}

.student-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
    width: 100%;
}

.info-row:nth-child(even) {
    background: #e8eaf6;
}

.info-label {
    font-weight: 600;
    color: #555;
    min-width: 150px;
}

.info-value {
    color: #333;
    flex: 1;
    text-align: right;
    word-break: break-word;
}

.branch-name {
    color: #3949ab;
    font-weight: 600;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.success-dot {
    background: #4caf50;
}

.failed-dot {
    background: #f44336;
}

.student-icon {
    position: absolute;
    left: 25px;
    bottom: 15px;
    opacity: 0.2;
    pointer-events: none;
}

.id-card-icon {
    font-size: 120px;
}

/* Subjects Grid */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.subject-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    border: 2px solid transparent;
}

.subject-card:hover {
    transform: translateY(-5px);
}

.subject-card.passed {
    border-color: #4caf50;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.subject-card.failed {
    border-color: #f44336;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

.subject-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.subject-grade {
    font-size: 32px;
    font-weight: 700;
    color: #1a237e;
    margin-bottom: 15px;
}

.subject-card.failed .subject-grade {
    color: #c62828;
}

.subject-limits {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
}

.limit-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
}

.limit-icon {
    font-size: 18px;
    font-weight: bold;
}

/* Totals Section */
.totals-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.total-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border: 2px solid #3949ab;
}

.total-card h3 {
    font-size: 20px;
    color: #1a237e;
    margin-bottom: 15px;
}

.total-value {
    font-size: 36px;
    font-weight: 700;
    color: #3949ab;
    margin-bottom: 10px;
}

.total-limits {
    display: flex;
    justify-content: space-around;
    color: #666;
    font-size: 14px;
}

/* Legend */
.legend {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.legend h4 {
    margin-bottom: 15px;
    color: #1a237e;
}

.legend-items {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 30px;
}

.back-btn {
    background: #3949ab;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #1a237e;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .student-icon {
        left: 10px;
        bottom: 10px;
    }
    
    .subjects-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .id-card-icon {
        font-size: 80px;
    }
    
    .main-nav {
        padding: 10px;
    }
    
    .main-nav a {
        display: block;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        padding: 20px;
    }
    
    .student-card {
        padding: 20px;
    }
}

