/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    direction: rtl;
}

/* شاشة تسجيل الدخول */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-container {
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header h1 {
    color: #1e3c72;
    font-size: 2em;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.login-form input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.2em;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 10px rgba(42, 82, 152, 0.3);
}

.login-form button {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.login-form button:active {
    transform: translateY(0);
}

.error-msg {
    color: #e74c3c;
    font-weight: bold;
    margin-top: 15px;
    font-size: 1em;
    min-height: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* الترويسة */
header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.3em;
    margin-bottom: 5px;
    opacity: 0.9;
}

.date {
    font-size: 1em;
    opacity: 0.8;
}

/* شريط التنقل */
.main-nav {
    background: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 15px 0;
    margin: 0;
}

.main-nav li {
    margin: 5px 15px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: block;
}

.main-nav a:hover {
    background: #34495e;
    transform: translateY(-2px);
}

/* زر Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid #fff;
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.hamburger {
    width: 30px;
    height: 4px;
    background: #fff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* المحتوى الرئيسي */
main {
    padding: 40px 20px;
}

.section {
    background: white;
    margin-bottom: 40px;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.section-title {
    color: #1e3c72;
    font-size: 2em;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #2a5298;
}

.subsection {
    margin-bottom: 40px;
}

.subsection-title {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

/* نظرة عامة */
.overview-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.info-box {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.info-box h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 10px;
}

.info-box ul {
    list-style-position: inside;
    margin-top: 10px;
}

.info-box li {
    padding: 8px 0;
    font-size: 1.1em;
}

/* شبكة الأدلة */
.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.evidence-item {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.evidence-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.evidence-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.evidence-label {
    padding: 15px;
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
    background: white;
}

/* التسجيلات الصوتية */
.audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.audio-item {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.audio-item h4 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-align: center;
}

.audio-item audio {
    width: 100%;
    margin-top: 10px;
    border-radius: 25px;
}

/* الفيديو */
.video-container {
    max-width: 900px;
    margin: 30px auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.video-container video {
    width: 100%;
    display: block;
}

/* التذييل */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

footer p {
    margin: 10px 0;
}

/* Modal لعرض الصور */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

.modal-image-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    cursor: grab;
}

.modal-content:active {
    cursor: grabbing;
}

#caption {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #fff;
    padding: 15px 20px;
    font-size: 1.2em;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.image-counter {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1.1em;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.close {
    position: absolute;
    top: 30px;
    right: 50px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #fff;
    background: rgba(255, 0, 0, 0.7);
    transform: rotate(90deg);
}

/* أزرار التنقل */
.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 40px;
    padding: 20px 15px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    z-index: 1001;
    backdrop-filter: blur(10px);
}

.modal-prev {
    right: 20px;
}

.modal-next {
    left: 20px;
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev:active,
.modal-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* أزرار التحكم */
.modal-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1001;
}

.modal-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    font-size: 1.2em;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.modal-btn:active {
    transform: translateY(0);
}

/* Animation */
@keyframes zoom {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.modal-content {
    animation-name: zoom;
    animation-duration: 0.3s;
}

/* تجاوب الشاشات الصغيرة */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 1.1em;
    }

    .section-title {
        font-size: 1.5em;
    }

    .subsection-title {
        font-size: 1.2em;
    }

    /* إظهار زر Hamburger على الموبايل */
    .menu-toggle {
        display: flex;
        position: absolute;
        top: 15px;
        left: 20px;
    }

    .main-nav .container {
        position: relative;
    }

    /* إخفاء القائمة افتراضياً */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: #2c3e50;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 80px;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        overflow-y: auto;
    }

    /* عرض القائمة عند التفعيل */
    .nav-menu.active {
        left: 0;
    }

    .main-nav li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-nav a {
        padding: 18px 25px;
        border-radius: 0;
        font-size: 1.2em;
        width: 100%;
    }

    .main-nav a:hover {
        background: #34495e;
        transform: none;
        padding-right: 35px;
    }

    /* خلفية شفافة عند فتح القائمة */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .nav-overlay.active {
        display: block;
    }

    .evidence-grid {
        grid-template-columns: 1fr;
    }

    .audio-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 20px;
    }

    .close {
        top: 10px;
        right: 15px;
        font-size: 35px;
        width: 50px;
        height: 50px;
    }

    .modal-prev,
    .modal-next {
        font-size: 30px;
        padding: 15px 10px;
    }

    .modal-prev {
        right: 10px;
    }

    .modal-next {
        left: 10px;
    }

    .modal-controls {
        flex-wrap: wrap;
        gap: 5px;
        bottom: 10px;
    }

    .modal-btn {
        padding: 10px 15px;
        font-size: 1em;
    }

    #caption {
        bottom: 60px;
        font-size: 1em;
        padding: 10px 15px;
    }

    .image-counter {
        top: 15px;
        font-size: 0.9em;
        padding: 8px 15px;
    }

    /* تعديل موقع أزرار الطباعة والعودة للأعلى على الموبايل */
    body button[style*="bottom: 30px"] {
        bottom: 20px !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
}

/* طباعة */
@media print {
    header {
        background: #1e3c72;
        color: white;
    }

    .main-nav {
        display: none;
    }

    .section {
        page-break-inside: avoid;
    }

    .evidence-item,
    .audio-item {
        page-break-inside: avoid;
    }

    footer {
        page-break-before: always;
    }
}

/* تحسينات إضافية */
.section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Scroll behavior */
html {
    scroll-behavior: smooth;
}

/* تحسين قابلية الوصول */
a:focus,
button:focus {
    outline: 3px solid #4facfe;
    outline-offset: 2px;
}
