/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&display=swap');

/* --- Variables & Reset --- */
:root {
    --brand-blue: #0a2a43;
    --brand-blue-dark: #081f36;
    --accent-yellow: #ffcc00;
    --bg-light: #f9f9f9;
    --card-bg: #ffffff;
    --muted: #7a8ba6;
    --border-light: rgba(10, 42, 67, 0.08);
    --font: "Cairo", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg-light);
    color: var(--brand-blue);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header, Logo & Back Link --- */
.main-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.logo img {
    height: 80px;
    object-fit: contain;
}
.back-link {
    text-decoration: none;
    color: var(--brand-blue);
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}
.back-link:hover {
    color: #007bff;
}

/* --- Main Content & Page Header --- */
.main-content {
    flex: 1;
    padding: 50px 20px;
}
.page-container {
    max-width: 900px;
    margin: 0 auto;
}
.page-header {
    text-align: center;
    margin-bottom: 40px;
}
.page-header h1 {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 8px;
}
.page-header p {
    font-size: 18px;
    color: var(--muted);
}

/* --- Materials List Styling --- */
.materials-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.material-item {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.material-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.material-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--brand-blue);
    background-color: var(--bg-light);
}
.fa-book { color: #5D4037; } 
.fa-file-alt { color: #0288D1; }
.fa-edit { color: #689F38; }
.fa-youtube { color: #D32F2F; }

.material-details {
    flex-grow: 1;
}
.material-details h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-blue-dark);
    margin: 0;
}

.download-btn {
    flex-shrink: 0;
    text-decoration: none;
    color: #fff;
    background-color: var(--brand-blue);
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}
.download-btn:hover {
    background-color: var(--brand-blue-dark);
}
.download-btn i {
    font-size: 14px;
}

/* --- Empty Message Styling --- */
.empty-message {
    text-align: center;
    padding: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--muted);
    font-size: 16px;
}

/* --- Footer --- */
.site-footer {
    background: var(--brand-blue-dark);
    color: #cbd6e6;
    padding: 40px 20px 0;
    margin-top: auto;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}
.footer-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 40px;
    padding-bottom: 30px;
}
.footer-about .footer-logo img {
    max-width: 150px;
    margin-bottom: 15px;
}
.footer-col.footer-about p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
}
.footer-col h4 {
    font-size: 16px;
    color: #f5f7fb;
    margin-bottom: 20px;
    font-weight: 700;
}
.footer-col ul {
    list-style: none;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul li a {
    color: #d6e1f2;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}
.footer-col ul li a:hover {
    color: var(--accent-yellow);
}
.social-links {
    display: flex;
    gap: 15px;
}
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.social-links a:hover {
    background-color: var(--accent-yellow);
    color: var(--brand-blue);
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
}
.copyright-text {
    font-size: 14px;
    color: #cbd6e6;
}

/* ==============================================
   ====== Media Query for Mobile Devices ======
   ============================================== */
@media (max-width: 768px) {
    /* ===== Header ===== */
    .main-header { 
        flex-direction: column;
        align-items: center;
        padding: 15px;
        text-align: center;
        gap: 10px;
    }

    .logo img { 
        height: 60px; 
    }

    .back-link {
        font-size: 15px;
        gap: 6px;
    }

    /* ===== Main Content ===== */
    .main-content {
        padding: 25px 15px;
    }

    .page-header {
        margin-bottom: 25px;
    }

    .page-header h1 { 
        font-size: 26px; 
        margin-bottom: 6px;
    }

    .page-header p {
        font-size: 15px;
    }

    /* ===== Materials List ===== */
    .materials-list {
        gap: 12px;
    }

    .material-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 15px;
        padding: 18px;
        border-radius: 10px;
    }

    .material-icon {
        width: 60px;
        height: 60px;
        font-size: 26px;
        margin: 0 auto;
    }

    .material-details h3 {
        font-size: 17px;
        font-weight: 600;
    }

    /* ===== Buttons ===== */
    .material-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 0;
        font-size: 16px;
        border-radius: 8px;
        font-weight: 700;
    }

    .download-btn i {
        font-size: 16px;
    }

    .download-btn.disabled {
        opacity: 0.6;
        background-color: #ccc;
        color: #555;
    }

    /* ===== Empty Message ===== */
    .empty-message {
        padding: 30px;
        font-size: 15px;
    }

    /* ===== Footer ===== */
    .footer-top {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 25px;
        padding-bottom: 20px;
    }

    .footer-about .footer-logo img {
        margin: 0 auto 15px;
        max-width: 130px;
    }

    .footer-col h4 {
        font-size: 15px;
    }

    .footer-col ul li a {
        font-size: 14px;
    }

    .social-links { 
        justify-content: center; 
        gap: 12px;
    }

    .social-links a {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .footer-bottom {
        padding: 15px 0;
    }

    .copyright-text {
        font-size: 13px;
    }
}
