/* Homepage styles for SCORM course navigation */

:root {
    /* Color scheme matching academie_style.css */
    --ade-primary: #9b51e0;
    --ade-primary-dark: #7a3fb8;
    --ade-primary-light: #b87ee6;
    --ade-secondary: #3498db;
    --ade-success: #27ae60;
    --ade-white: #ffffff;
    --ade-gray-light: #f5f5f5;
    --ade-gray-medium: #ddd;
    --ade-gray-dark: #666;
    --ade-text: #333;

    /* Spacing */
    --ade-space-xs: 0.5rem;
    --ade-space-sm: 1rem;
    --ade-space-md: 1.5rem;
    --ade-space-lg: 2rem;
    --ade-space-xl: 3rem;

    /* Shadows */
    --ade-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --ade-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --ade-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--ade-text);
    overflow: auto; /* Changed from hidden to allow scrolling */
}

/* Homepage container - full viewport */
.homepage-container {
    position: relative;
    width: 100vw;
    min-height: 100vh; /* Changed from height to min-height for proper scrolling */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: var(--ade-space-md) 0; /* Add vertical padding for breathing room */
}

/* Background image with overlay */
.homepage-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(155, 81, 224, 0.85) 0%,
        rgba(52, 152, 219, 0.75) 100%
    );
}

/* Main content card */
.homepage-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    padding: var(--ade-space-md);
    margin: var(--ade-space-xl) auto;
}

.content-card {
    background: var(--ade-white);
    border-radius: 16px;
    padding: var(--ade-space-xl);
    box-shadow: var(--ade-shadow-lg);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Course title */
.course-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ade-primary);
    text-align: center;
    margin-bottom: var(--ade-space-lg);
    line-height: 1.2;
}

/* Start button */
.btn-start {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto var(--ade-space-lg);
    padding: 1rem 2rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ade-white);
    background: linear-gradient(135deg, var(--ade-primary) 0%, var(--ade-secondary) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--ade-shadow-md);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 81, 224, 0.4);
}

.btn-start:active {
    transform: translateY(0);
    box-shadow: var(--ade-shadow-sm);
}

/* Course description */
.course-description {
    margin-bottom: var(--ade-space-lg);
    padding: var(--ade-space-md);
    background: var(--ade-gray-light);
    border-radius: 8px;
    border-left: 4px solid var(--ade-primary);
    display: block; /* Ensure it's always displayed */
    min-height: 50px; /* Ensure some height even if empty */
}

.course-description p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ade-gray-dark);
    margin: 0; /* Reset margin */
}

/* Show placeholder if empty */
.course-description:empty::before {
    content: "Chargement de la description...";
    color: var(--ade-gray-medium);
    font-style: italic;
}

/* Lesson list */
.lesson-list {
    margin-top: var(--ade-space-xl);
}

.lesson-list-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ade-text);
    margin-bottom: var(--ade-space-md);
    padding-bottom: var(--ade-space-sm);
    border-bottom: 2px solid var(--ade-gray-medium);
}

.lessons {
    list-style: none;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: var(--ade-space-sm);
    padding: var(--ade-space-md);
    margin-bottom: var(--ade-space-sm);
    background: var(--ade-white);
    border: 2px solid var(--ade-gray-medium);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.lesson-item:hover {
    border-color: var(--ade-primary);
    background: rgba(155, 81, 224, 0.03);
    transform: translateX(4px);
}

/* Custom checkbox styling */
.lesson-checkbox {
    position: relative;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.lesson-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--ade-gray-medium);
    border-radius: 4px;
    background: var(--ade-white);
    transition: all 0.2s ease;
    position: relative;
}

.lesson-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--ade-success);
    border-color: var(--ade-success);
}

.lesson-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--ade-white);
    font-size: 16px;
    font-weight: bold;
}

/* Lesson link */
.lesson-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--ade-space-sm);
    text-decoration: none;
    color: var(--ade-text);
    cursor: pointer;
}

.lesson-link:hover .lesson-title {
    color: var(--ade-primary);
}

.lesson-number {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--ade-gray-dark);
    min-width: 70px;
}

.lesson-title {
    font-weight: 500;
    color: var(--ade-text);
    transition: color 0.2s ease;
}

/* Responsive design */
@media (max-width: 768px) {
    .homepage-content {
        padding: var(--ade-space-sm);
        margin: var(--ade-space-md) auto;
    }

    .content-card {
        padding: var(--ade-space-lg);
    }

    .course-title {
        font-size: 2rem;
    }

    .btn-start {
        font-size: 1.1rem;
        padding: 0.875rem 1.5rem;
    }

    .course-description p {
        font-size: 1rem;
    }

    .lesson-list-title {
        font-size: 1.25rem;
    }

    .lesson-item {
        padding: var(--ade-space-sm);
    }

    .lesson-number {
        min-width: 60px;
        font-size: 0.9rem;
    }

    .lesson-title {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .course-title {
        font-size: 1.75rem;
    }

    .btn-start {
        max-width: 100%;
    }

    .lesson-item {
        flex-direction: row;
        gap: var(--ade-space-xs);
    }

    .lesson-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .lesson-number {
        min-width: auto;
        font-size: 0.85rem;
    }

    .lesson-title {
        font-size: 0.9rem;
    }
}

/* Print styles */
@media print {
    .homepage-background {
        display: none;
    }

    .content-card {
        box-shadow: none;
        border: 1px solid var(--ade-gray-medium);
    }

    .btn-start {
        display: none;
    }
}
