/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sidebar-width: 280px;
    --header-height: 0px;
    --footer-height: 0px;
    --primary-color: #A855F7;
    --primary-light: #D8B4FE;
    --primary-dark: #7E22CE;
    --success-color: #581C87;
    --border-color: #C4B5FD;
    --text-color: #1E293B;
    --bg-color: #F9FAFB;
    --card-bg: #FFFFFF;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--card-bg);
}

.course-container {
    width: 100%;
    height: 100vh;
    display: flex;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    right: calc(-1 * var(--sidebar-width));
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    box-shadow: none;
}

.sidebar.open {
    transform: translateX(calc(-1 * var(--sidebar-width)));
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: white;
    font-weight: 600;
}

.close-sidebar {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    color: white;
    opacity: 0.8;
    transition: all var(--transition-fast);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-sidebar:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Course Progress */
.course-progress {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.progress-bar {
    height: 0.5rem;
    background: var(--primary-light);
    border-radius: 0.25rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

.progress-text {
    font-size: 0.875rem;
    color: var(--primary-dark);
    font-weight: 600;
}

/* Slides List */
.slides-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slide-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    background-color: var(--card-bg);
}

.slide-item:hover {
    background: var(--bg-color);
    border-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.slide-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.slide-item.visited .slide-status {
    color: var(--primary-color);
}

.slide-item.active .slide-status {
    color: white;
}

.slide-status {
    margin-right: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(168, 85, 247, 0.1);
}

.slide-title {
    flex: 1;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-right: 0;
    transition: margin-right var(--transition-normal);
    background: var(--card-bg);
}

/* Content area */
.content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    position: relative;
    background: var(--card-bg);
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.slide-image {
    max-width: 100%;
    max-height: calc(100vh - var(--header-height) - var(--footer-height));
    object-fit: contain;
    display: block;
    border-radius: 0;
    box-shadow: none;
}

/* Footer */
footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Navigation */
.navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    grid-column: 2;
}

/* Menu button */
.menu-button {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    transition: all var(--transition-fast);
    margin-left: auto;
    grid-column: 3;
    box-shadow: var(--shadow-sm);
}

.menu-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.progress-info {
    font-size: 0.875rem;
    color: var(--primary-dark);
    font-weight: 600;
    grid-column: 1;
    white-space: nowrap;
    background: rgba(168, 85, 247, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    display: inline-block;
}

.nav-button {
    height: 2.75rem;
    padding: 0 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    gap: 0.5rem;
}

.nav-button:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.finish-button {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.finish-button:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.7);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-content h3 {
    margin: 0 0 1.25rem 0;
    color: var(--primary-dark);
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-content p {
    margin: 0 0 2rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1.25rem;
}

.modal-buttons button {
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-color);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Responsive styles */
@media (max-width: 768px) {
    .course-container {
        height: 100%;
        width: 100%;
    }

    .main-content {
        height: 100%;
    }

    .content {
        padding: 0;
    }

    .sidebar {
        width: 100%;
        right: -100%;
    }

    .sidebar.open {
        transform: translateX(-100%);
    }
    
    .nav-button {
        min-width: 5rem;
        padding: 0 0.5rem;
    }

    .navigation {
        grid-template-columns: auto 1fr auto;
        gap: 0.5rem;
    }
    
    .nav-buttons {
        gap: 0.5rem;
    }
    
    .progress-info {
        display: none;
    }
}

/* Handle mobile rotation */
@media screen and (orientation: landscape) and (max-height: 500px) {
    footer {
        padding: 0.5rem;
    }

    .nav-button {
        height: 2rem;
        min-width: 6rem;
        font-size: 0.75rem;
    }
}
