/* ========================================
   BASE STYLES & LAYOUT
   ======================================== */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

div {
    display: block;
    unicode-bidi: isolate;
}

.content-container {
    padding-top: 85px;
    padding-bottom: 30px;
}

.main-height {
    min-height: 50vh !important;
    flex: 1;
}

/* ========================================
   NAVIGATION
   ======================================== */

.navbar {
    z-index: 1000 !important;
}

.navbar-toggler {
    z-index: 1000 !important;
}

.navbar-shadow {
    box-shadow: 0px 2px 18px 4px rgba(0, 0, 0, 0.44);
    padding: 15px 0px !important;
    position: fixed;
    z-index: 100;
    width: 100%;
}

/* ========================================
   FOOTER STYLES
   ======================================== */

.footer {
    flex-shrink: 0;
    /* Don't shrink the footer */
    margin-top: auto;
    /* Push footer to bottom */
    padding-top: 15px;
    /* Add separation space */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    /* Add shadow above footer */
    background: #fff;
    border-top: 1px solid #ddd;
}

.footer-modern {
    background: rgba(0, 0, 0, 0.7);
    color: #ecf0f1;
    border-top: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.footer-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-logo-circle {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ecf0f1;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.footer-logo-circle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.footer-logo-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    margin: 0 auto;
    display: block;
}

.footer-logo-image:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.footer-links {
    color: #bdc3c7;
}

.footer-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.footer-link-list li {
    margin-bottom: 8px;
}

.footer-link-list a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-link-list a:hover {
    color: #ecf0f1;
    text-decoration: none;
}

.footer-newsletter {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 350px;
    margin: 0 auto;
}

.newsletter-title {
    color: #ecf0f1;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.newsletter-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ecf0f1;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.newsletter-input::placeholder {
    color: rgba(236, 240, 241, 0.7);
}

.newsletter-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ecf0f1;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1);
}

.newsletter-btn {
    background: #3498db;
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    width: 100%;
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.footer-copyright {
    color: #95a5a6;
    font-size: 0.8rem;
}

/* ========================================
   FORMS & INPUTS
   ======================================== */

.center-form-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.form-check-align {
    margin-left: 0;
    width: 100%;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
}

.login-label {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 15px;
    display: block;
}

.input-short,
.select-short {
    max-width: 60ch;
    min-width: 30ch;
}

/* ========================================
   ALERT MESSAGES
   ======================================== */

.alert-success {
    background-color: #00d432;
    color: #040f07;
}

.alert-info {
    background-color: #00859c;
    color: #031f24;
}

.alert-warning {
    background-color: #aa5200;
    color: #241b00;
}

.alert-error {
    background-color: #d10000;
    color: #1a0000;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 45px;
    margin: 1rem 0;
}

/* ========================================
   COOKIE CONSENT
   ======================================== */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    padding: 20px;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-categories {
    margin: 15px 0;
}

.cookie-category {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.cookie-consent-buttons {
    margin-top: 15px;
}

.cookie-consent-buttons button {
    margin-right: 10px;
    margin-bottom: 10px;
}

.cookie-policy-link {
    display: block;
    margin-top: 10px;
    font-size: 0.9em;
}

/* ========================================
   COURSE COMPONENTS
   ======================================== */

.course-card {
    background-color: rgb(187, 187, 187);
    border-radius: 10px;
}

.course-image {
    width: 100%;
    max-width: 400px !important;
    height: auto;
    border-radius: 8px;
    flex-shrink: inherit;
}

.course-link {
    text-decoration: none;
    color: black;
    position: relative;
}

.course-link .course-image {
    transition: filter 0.3s ease;
}

.course-link:hover .course-image {
    filter: brightness(0.7);
}

.course-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.course-link::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-45%, -50%);
    font-size: 24px;
    color: #333;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 11;
    pointer-events: none;
}

.course-link:hover::before,
.course-link:hover::after {
    opacity: 1;
}

.course-link .course-card {
    position: relative;
}

/* ========================================
   LEARNING MATERIALS
   ======================================== */

.learning-material {
    min-height: 150px;
    width: 100%;
    box-sizing: border-box;
}

.material-container {
    padding: 30px 45px 45px 45px;
    background: #f8f9fa;
    opacity: 1;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
}

.material-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.material-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.learning-material .material-images div {
    width: 100%;
}

.learning-material .material-images img {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.material-images {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.material-images div {
    flex: 1 1 300px;
    max-width: 100%;
    box-sizing: border-box;
}

.material-images img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: cover;
}

/* ========================================
   TEST & QUIZ COMPONENTS
   ======================================== */

.timer-container {
    font-size: 1.2rem;
    font-weight: bold;
}

#timer.time-warning {
    color: red;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.test-container {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
}

.answers-container {
    flex: 1;
}

.submit-container {
    margin-top: auto;
    padding-top: 20px;
}

.question-container {
    margin: 2rem 0;
}

.answers-list {
    margin: 1.5rem 0;
}

.answer-option {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.answer-option:hover {
    background-color: #f8f9fa;
}

/* ========================================
   QUIZ RESULTS
   ======================================== */

.results-header {
    margin-bottom: 2rem;
}

.result-summary {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.pass-fail-indicator.pass {
    color: #28a745;
}

.pass-fail-indicator.fail {
    color: #dc3545;
}

.question-result {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.question-result.correct {
    border-left: 5px solid #28a745;
}

.question-result.incorrect {
    border-left: 5px solid #dc3545;
}

.selected-answer.correct {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #28a745;
    padding: 0.5rem;
}

.selected-answer.incorrect {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
    padding: 0.5rem;
}

.correct-answer {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #28a745;
    padding: 0.5rem;
    margin-top: 1rem;
}

.feedback {
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-left: 3px solid #17a2b8;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Small screens (phones) */
@media (max-width: 575.98px) {
    .container-lg {
        width: 100% !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .card-body {
        padding: 0% !important;
    }

    .learning-material .material-container {
        padding: 15px 5px;
        margin-left: 0;
        margin-right: 0;
    }

    .material-container {
        border-radius: 5px;
    }

    .learning-material .material-images {
        margin-left: 0px;
        margin-right: 0px;
        width: calc(100% + 10px);
    }

    .learning-material .material-images div {
        flex: 1 1 100%;
        margin: 0;
    }
}

/* Medium screens */
@media (min-width: 576px) and (max-width: 991.98px) {
    .container-lg {
        width: 100% !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .card-body {
        padding: 0% !important;
    }

    .learning-material .material-container {
        padding: 20px 15px;
        margin-left: auto;
        margin-right: auto;
    }

    .material-container {
        width: 100%;
    }

    .learning-material .material-images div {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Large screens */
@media (min-width: 992px) {
    .material-container {
        padding: 30px 45px 45px 45px;
        width: 90%;
    }

    .learning-material .material-images div {
        flex: 1 1 300px;
    }

    .footer-newsletter {
        margin-top: 20px;
        max-width: 100%;
    }

    .footer-links {
        margin: 20px 0;
    }
}

/* Extra large screens */
@media (min-width: 1200px) {
    .material-container {
        width: 90%;
    }

    .pagination {
        padding: 0px 100px;
    }
}

/* Footer responsive adjustments */
@media (max-width: 991.98px) {
    .footer-newsletter {
        margin-top: 20px;
        max-width: 100%;
    }

    .footer-links {
        margin: 20px 0;
    }
}

@media (max-width: 767.98px) {
    .footer-modern .row {
        text-align: center;
    }

    .footer-link-list {
        text-align: center;
    }

    .footer-logo-circle,
    .footer-logo-image {
        margin-bottom: 20px;
    }
}