/* Geography Course Menu Styles */

/* Theme section styling with themed background colors */
.theme-section {
    margin-bottom: 4rem;
}

.theme-title {
    color: #fff;
    padding: 1.2rem 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    font-size: 1.8rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 30px;
    background: linear-gradient(135deg, #3f51b5, #7986cb);
}

.theme-title:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Themed background colors for different themes */
.theme-background {
    background: linear-gradient(135deg, #3f51b5, #7986cb);
}

/* Subtopic header styling */
.subtopic-header {
    color: var(--text-dark);
    font-size: 1.6rem;
    border-left: 5px solid var(--secondary);
    padding-left: 1rem;
    margin: 2rem 0 1.5rem;
    font-weight: 600;
}

.session-count {
    font-size: 0.9rem;
    color: #666;
    margin-left: 0.5rem;
    font-weight: normal;
}

/* Sessions grid layout */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Session card styling */
.session-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-top: 4px solid var(--primary);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    overflow: visible !important;
    border: 2px solid transparent;
}

.session-card-completed {
    background: #e9f9ea; /* Lighter shade for better readability */
}

.session-card-completed .session-title {
    border-bottom: 2px solid #4CAF50;
}

.session-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.session-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.session-title {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.session-description {
    color: #666;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Completed session description styling */
.session-description.completed {
    color: #666;
}

/* Button styling */
.session-button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 20; /* Make sure button is always clickable */
    cursor: pointer;
}

/* Revisit button styling for completed lessons */
.revisit-button {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    margin-top: 8px;
    margin-top: auto;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 20;
}

.session-button:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.session-button::after {
    content: '→';
    margin-left: 6px;
    transition: all 0.3s ease;
}

.session-button:hover::after {
    transform: translateX(3px);
}

/* Locked session card styling */
.session-card-locked {
    background-color: #f8f8f8;
    opacity: 0.7;
    position: relative;
}

.session-card-locked .session-title {
    color: #999;
}

.session-card-locked .session-description.locked {
    color: #aaa;
}

/* Lock icon styling */
.lock-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #999;
    font-size: 1.2rem;
    z-index: 10;
}

/* Locked button styling */
.locked-button {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 20;
    cursor: pointer;
    margin-top: auto;
}

.locked-button:hover {
    background: linear-gradient(135deg, #f57c00, #e64a19);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.locked-button::after {
    content: '🔓';
    margin-left: 6px;
    transition: all 0.3s ease;
}

.locked-button:hover::after {
    transform: translateX(3px);
}

/* Completed box styling */
.completed-box {
    background: #4CAF50;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    z-index: 20;
    font-size: 0.9rem;
}

.completed-box i {
    font-size: 16px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* We've removed the card-link as it was blocking button clicks */

/* Course card styling */
.course-card {
    background-color: #fff;
    padding: 1.8rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* Subtopic title styling */
.subtopic-title {
    color: var(--secondary);
    margin: 1.2rem 0 0.8rem;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Navigation elements styling */
.subtopic-links {
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
}

.subtopic-link {
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.6rem 0;
    border-bottom: 1px dotted #eee;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.subtopic-link:hover {
    color: var(--secondary);
    padding-left: 0.8rem;
}

.subtopic-link::before {
    content: '•';
    margin-right: 0.5rem;
    color: var(--primary);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.subtopic-link:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Progress bar styling */
.progress-container {
    width: 100%;
    height: 40px;
    background: #f0f0f0;
    border-radius: 20px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

/* Center the progress text in the container */
.progress-container::after {
    content: attr(data-progress);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: bold;
    font-size: 16px;
    z-index: 10;
    white-space: nowrap;
}

/* Update the existing .progress-bar styles in your CSS file */
.progress-bar {
    height: 100%;
    background: linear-gradient(45deg, #f39c12, #f1c40f, #f39c12);    background-size: 200% 200%;
    animation: gradientBackground 3s ease infinite;
    border-radius: 20px;
    position: relative;
    will-change: width;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: left center;
    width: 0%;
    overflow: hidden;
}

/* Hide gradient background when width is 0% */
.progress-bar[style*="width: 0%"] {
    background: transparent !important;
}

/* Hide existing spans inside progress bar */
.progress-bar span {
    display: none;
}

/* Add this CSS class for the plain "0%" text */
.progress-text-only {
    color: #666;
    font-size: 16px;
    padding: 10px 0;
    margin: 20px 0;
    text-align: left;
}

@keyframes fillProgress {
    from {
        width: 0%;
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes gradientBackground {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.header {
    margin: 0;
    
}

/* Add shine effect */
.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(250%);
    }
}

/* Login Modal Styles */
.login-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.login-modal {

    background-color: white;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    overflow: hidden;
    padding-top: 70px !important;
}

.login-modal-backdrop.show .login-modal {
    transform: translateY(0);
}

.login-modal-header {
    position: relative;
    padding: 20px;
    padding-top: 30px; /* Added more padding to the top */
    background-color: var(--primary);
    text-align: center;
}

.login-modal-header img {
    width: 60px;
    height: 60px;
}

.login-modal-header h2 {
    margin: 10px 0;
    color: var(--text-dark);
    border-bottom: none;
    padding-bottom: 0;
}

.login-modal-header p {
    margin: 0;
    color: var(--text-dark);
    opacity: 0.8;
}

.close-modal { /* Renamed from .login-modal-close */

    position: absolute;
    top: 20px; /* Increased from 15px */
    right: 20px; /* Increased from 15px */
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dark); /* Ensure this provides enough contrast */
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    z-index: 10; /* Ensure it's above other modal header content */
}

.close-modal:hover { /* Renamed from .login-modal-close:hover */
    opacity: 1;
}

.login-modal-body {
    padding: 30px;
}

.login-modal-form .form-group {
    margin-bottom: 20px;
}

.login-modal-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.login-modal-form input[type="text"],
.login-modal-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-modal-form input[type="text"]:focus,
.login-modal-form input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(255, 213, 0, 0.3);
}

.remember-me-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.remember-me-wrapper input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.login-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.login-btn {
    background-color: var(--primary);
    color: var(--text-dark);
    padding: 12px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
    text-align: center;
    display: block;
    width: 100%;
}

.login-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.signup-link {
    text-align: center;
    margin-top: 15px;
}

.signup-link a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.signup-link a:hover {
    text-decoration: underline;
}

.benefits-list {
    margin-top: 25px;
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.benefits-list h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-dark);
    border-bottom: none;
}

.benefits-list ul {
    margin: 0;
    padding-left: 25px;
}

.benefits-list li {
    margin-bottom: 8px;
    position: relative;
    list-style: none;
    padding-left: 5px;
}

.benefits-list li:before {
    content: "✓";
    color: #4CAF50;
    font-weight: bold;
    margin-right: 10px;
    position: absolute;
    left: -20px;
}

.btn-primary {
    color: white !important;
}

.login-error {
    color: #e74c3c;
    background-color: #ffeaea;
    border-left: 3px solid #e74c3c;
    padding: 10px 15px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

/* Course page title */
.course-page-title {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2.8rem;
    color: var(--text-dark);
    border-bottom: 3px solid var(--secondary);
    padding-bottom: 0.5rem;
    display: block;
    max-width: fit-content;
    margin: 30px auto;
}

/* COMPLETED SESSIONS STYLING */
.session-completed {
    background-color: #f3fbf4 !important;
    border: 2px solid #4CAF50 !important;
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3) !important;
    position: relative;
}

.session-completed::after {
    content: "COMPLETED";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #4CAF50;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    z-index: 9999;
}

.session-completed .session-title::before {
    content: "✓ ";
    color: #4CAF50;
}

.session-completed .session-button {
    background: linear-gradient(135deg, #4CAF50, #8BC34A) !important;
}

/* Completion ribbon */
.completion-ribbon {
    z-index: 20;
}

/* Styles for locked lessons (when user is not logged in and lesson is not free) */
.session-card.lesson-locked {
    opacity: 0.6; /* Grey out the card */
    position: relative; /* Required for positioning the lock icon overlay */
}

/* Style for the button within a locked card */
.session-card.lesson-locked .session-button,
.session-card .session-button.button-locked {
    background-color: #b0b0b0; /* Greyer background for the button */
    border-color: #a0a0a0;
    color: #555555;
    cursor: pointer; /* It's still clickable to open the modal */
}

.session-card.lesson-locked .session-button:hover,
.session-card .session-button.button-locked:hover {
    background-color: #a0a0a0; /* Darker grey on hover */
    border-color: #909090;
}

/* Lock icon overlay */
.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.15); /* Slight dimming overlay */
    z-index: 5; /* Ensure it's above other card content */
    pointer-events: none; /* The overlay itself should not be interactive */
    border-radius: inherit; /* Inherit border-radius from parent card if any */
}

.lock-overlay .fas.fa-lock {
    font-size: 2.5em; /* Adjust size of the lock icon as needed */
    color: #fff; /* White lock icon for better visibility */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5); /* Add a subtle shadow to the icon */
}

/* Optional: Make text content less prominent on locked cards */
.session-card.lesson-locked .session-title,
.session-card.lesson-locked .session-description {
    color: #555; /* Darken text slightly */
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .sessions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .course-grid {
        grid-template-columns: 1fr;
    }
    
    .sessions-grid {
        grid-template-columns: 1fr;
    }
    
    .theme-title {
        padding: 1rem 1.5rem;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-modal-body {
        padding: 20px;
    }
    
    .login-modal-header {
        padding: 15px;
    }
    
    .login-modal-header h2 {
        font-size: 20px;
    }
}
