* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.robot-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* Auth Container Styles */
.auth-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin: 100px auto;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 10s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.robot-header {
    text-align: center;
    margin-bottom: 30px;
}

.robot-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #00ffff, #00ff88, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.robot-header p {
    color: #00ffff;
    font-size: 1.1em;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 5px;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(45deg, #00ffff, #00ff88);
    color: #000;
    font-weight: bold;
}

.tab-btn:hover {
    background: rgba(0, 255, 255, 0.2);
}

/* Auth Forms */
.auth-form h2 {
    margin-bottom: 25px;
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #00ff88;
    font-weight: 500;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #00ffff, #00ff88);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    font-family: 'Orbitron', sans-serif;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.4);
}

.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #00ff88;
}

/* Main Content Styles */
.main-content {
    min-height: 100vh;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.main-header h1 {
    font-family: 'Orbitron', sans-serif;
    color: #00ffff;
    font-size: 1.8em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    padding: 10px 20px;
    background: linear-gradient(45deg, #ff0080, #ff8000);
    border: none;
    border-radius: 25px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.4);
}

.content-container {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 200px);
}

.sidebar {
    width: 250px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
}

.sidebar h3 {
    color: #00ffff;
    margin-bottom: 20px;
    font-family: 'Orbitron', sans-serif;
}

#chaptersList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-item {
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chapter-item:hover {
    background: rgba(0, 255, 255, 0.3);
    transform: translateX(5px);
}

.chapter-item.completed {
    background: rgba(0, 255, 136, 0.3);
}

.main-area {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    max-height: calc(100vh - 150px);
}

#bookContent h2 {
    color: #00ffff;
    margin-bottom: 20px;
    font-family: 'Orbitron', sans-serif;
}

#bookContent p {
    line-height: 1.6;
    color: #e0e0e0;
}

.chat-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(0, 255, 255, 0.3);
}

.chat-section h3 {
    color: #00ff88;
    margin-bottom: 20px;
    font-family: 'Orbitron', sans-serif;
}

.chat-container {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #00ffff, #00ff88);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.message.user .content {
    background: linear-gradient(45deg, #00ffff, #00ff88);
    color: #000;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

#userInput {
    flex: 1;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 16px;
}

.send-btn {
    padding: 15px 25px;
    background: linear-gradient(45deg, #00ffff, #00ff88);
    border: none;
    border-radius: 25px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.05);
}

.language-selector {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-selector label {
    color: #00ff88;
    font-weight: 500;
}

.language-selector select {
    padding: 8px 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #00ffff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .auth-container {
        margin: 50px auto;
        padding: 20px;
        max-width: 90%;
    }
    
    .content-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .main-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .user-info {
        width: 100%;
        justify-content: center;
    }
    
    .content {
        max-width: 90%;
    }
}

/* GitHub Icon Styles */
.github-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #00ffff;
    text-decoration: none;
    margin-right: 15px;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 50%;
}

.github-link:hover {
    color: #00ff88;
    background: rgba(0, 255, 255, 0.1);
    transform: scale(1.1) rotate(5deg);
}

/* Theme Toggle Button */
.theme-toggle {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Dashboard Button */
.dashboard-btn {
    background: linear-gradient(135deg, #00ffff, #00ff88);
    border: none;
    color: #1a1a2e;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-right: 15px;
}

.dashboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.4);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 0;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 10px 50px rgba(0, 255, 255, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: rgba(0, 255, 255, 0.1);
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #00ffff;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #00ffff;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #ff0000;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

/* Dashboard Progress Styles */
.progress-overview {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 40px;
}

.progress-card {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
}

.progress-card h3 {
    color: #00ffff;
    margin-bottom: 20px;
}

.progress-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 20px auto;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #00ffff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00ffff;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.2);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #00ffff;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #888;
}

/* Module Progress List */
.modules-progress h3 {
    color: #00ffff;
    margin-bottom: 20px;
}

.module-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.module-progress-item {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.module-progress-item:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00ffff;
}

.module-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.module-title h4 {
    color: #00ff88;
    margin: 0;
}

.module-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.status-completed {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid #00ff88;
}

.status-in-progress {
    background: rgba(0, 255, 255, 0.2);
    color: #00ffff;
    border: 1px solid #00ffff;
}

.status-not-started {
    background: rgba(136, 136, 136, 0.2);
    color: #888;
    border: 1px solid #666;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ffff, #00ff88);
    transition: width 0.5s ease;
    border-radius: 4px;
}

.chapter-count {
    font-size: 12px;
    color: #888;
}

.mark-complete-btn {
    background: linear-gradient(135deg, #00ffff, #00ff88);
    border: none;
    color: #1a1a2e;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.mark-complete-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0, 255, 255, 0.3);
}

.mark-complete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Light Mode Styles */
body.light-mode {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    color: #1a1a2e;
}

body.light-mode .auth-container,
body.light-mode .main-content,
body.light-mode .sidebar,
body.light-mode .main-area,
body.light-mode .modal-content {
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a2e;
}

body.light-mode .main-header {
    background: rgba(255, 255, 255, 0.98);
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode .module-header {
    color: #0f3460;
}

body.light-mode .github-link,
body.light-mode .theme-toggle {
    color: #0f3460;
}

body.light-mode .chapter-item,
body.light-mode .message,
body.light-mode .stat-card,
body.light-mode .module-progress-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .progress-card {
    background: rgba(0, 0, 0, 0.02);
}

body.light-mode .modal-header {
    background: rgba(0, 0, 0, 0.05);
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a2e;
    border-color: rgba(0, 0, 0, 0.2);
}

body.light-mode code {
    background: rgba(0, 0, 0, 0.05);
    color: #0f3460;
}

body.light-mode .stat-label,
body.light-mode .chapter-count {
    color: #666;
}

/* Chapter Header Styles */
.chapter-header {
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.chapter-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    font-size: 14px;
    color: #888;
}

.chapter-content {
    line-height: 1.8;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .progress-overview {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .module-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chapter-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}