/* General Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* Left Sidebar Menu (Ubuntu-style) */
.sidebar {
    width: 68px;
    background: rgba(30, 30, 46, 0.95);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: width 0.3s ease;
}

.sidebar:hover {
    width: 240px;
}

.sidebar-item {
    width: 48px;
    height: 48px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-item:hover {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

.sidebar-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.sidebar-item i {
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.sidebar-item span {
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    margin-left: 5px;
}

.sidebar:hover .sidebar-item {
    width: 220px;
    padding: 0 10px;
}

.sidebar:hover .sidebar-item span {
    opacity: 1;
}

.sidebar-divider {
    width: 32px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
    transition: width 0.3s ease;
}

.sidebar:hover .sidebar-divider {
    width: 200px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 68px;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px 25px;  /* Reduced from 30px */
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 15px;  /* Reduced from 30px */
    border-bottom: 1px solid #e0e0e0;  /* Thinner border */
    padding-bottom: 10px;  /* Reduced from 15px */
    font-size: 1.8em;  /* Slightly smaller */
    line-height: 1.2;  /* Tighter line height */
}

h2 {
    color: #34495e;
    margin-top: 0;
    margin-bottom: 12px;  /* Reduced from 15px */
    font-size: 1.4em;  /* Slightly smaller */
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Module Styling */
.module {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;  /* Reduced vertical padding */
    margin-bottom: 20px;  /* Reduced from 25px */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.progress-module {
    text-align: center;
    margin-bottom: 25px;  /* Reduced from 40px */
    padding: 20px;  /* Reduced from 30px */
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.task-module {
    position: relative;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;  /* Reduced from 20px */
    padding: 8px 0;  /* Reduced from 10px */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Progress Bar Styles */
#progress-bar-container {
    width: 100%;
    height: 35px;  /* Reduced from 40px */
    background: linear-gradient(145deg, #e8e8e8, #f5f5f5);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 15px 0;  /* Reduced from 20px */
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

#progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

#progress-bar-fill.completed {
    background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    animation: pulse 2s infinite, progress-complete 1s ease-in-out;
}

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

#progress-percentage {
    font-weight: 700;
    font-size: 1.1em;  /* Slightly smaller */
    color: #2c3e50;
    margin-top: 10px;  /* Reduced from 15px */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.section-progress-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 140px;
    margin-left: 20px;
}

.section-progress-bar {
    width: 100%;
    height: 16px;
    background: linear-gradient(145deg, #e8e8e8, #f5f5f5);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
}

.section-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 6px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.section-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: section-shine 3s infinite;
}

@keyframes section-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.section-progress-text {
    font-size: 0.9em;
    font-weight: 600;
    color: #5d6d7e;
    margin-top: 8px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
}

/* Timer Styles */
#timer-display {
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    margin: 15px 0;
    background-color: #ecf0f1;
    padding: 10px;
    border-radius: 8px;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.timer-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

#start-timer {
    background-color: #2ecc71;
    color: white;
}

#start-timer:hover:not(:disabled) {
    background-color: #27ae60;
}

#pause-timer {
    background-color: #f39c12;
    color: white;
}

#pause-timer:hover:not(:disabled) {
    background-color: #e67e22;
}

#reset-timer {
    background-color: #e74c3c;
    color: white;
}

#reset-timer:hover:not(:disabled) {
    background-color: #c0392b;
}

.timer-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Item Checklist Styles */
.item-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.item-with-status {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    overflow: hidden;
}

.item-status {
    display: flex;
    background-color: #f1f1f1;
    padding: 5px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.status-label {
    display: flex;
    align-items: center;
    margin-right: 15px;
    font-size: 0.85em;
    cursor: pointer;
}

.status-label input {
    margin-right: 5px;
}

.item-content {
    padding: 15px;
}

.item-description {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Dark mode item description text */
body.dark-mode .item-description {
    color: #ffffff !important;
}

/* Ensure all description text in items is white */
body.dark-mode .item-content .item-description {
    color: #ffffff !important;
}

body.dark-mode .resource-item .item-description {
    color: #ffffff !important;
}

/* Make all small tags inside item-content white in dark mode */
body.dark-mode .item-content small {
    color: #ffffff !important;
}

body.dark-mode .resource-item small {
    color: #ffffff !important;
}

/* Task Tracking Styles */
.task-tracking {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.task-tracking label {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    cursor: pointer;
}

.task-tracking input {
    margin-right: 5px;
    cursor: pointer;
}

/* Notes Section Styles */
.section-notes {
    margin-top: 15px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.section-notes.collapsed {
    max-height: 0;
}

.notes-area {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

.notes-toggle {
    background-color: #f1f1f1;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.notes-toggle:hover {
    background-color: #e0e0e0;
}

.notes-toggle i {
    font-size: 1.1em;
}

/* Time Logging Styles */
.time-log-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.log-time-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.log-time-btn:hover {
    background-color: #2980b9;
}

.total-time-container {
    font-size: 0.9em;
    color: #7f8c8d;
}

/* Section Actions */
.section-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background-color: #2ecc71;
    color: white;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    font-weight: 500;
}

.notification.show {
    transform: translateX(0);
}

/* Enhanced Progress Animations */
.section-progress-fill[style*="100%"],
#progress-bar-fill[style*="100%"] {
    background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    animation: progress-complete 1s ease-in-out;
}

@keyframes progress-complete {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Progress Bar Glow Effects */
#progress-bar-container:hover {
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(102, 126, 234, 0.3);
    transition: box-shadow 0.3s ease;
}

.section-progress-bar:hover {
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1),
        0 0 15px rgba(168, 237, 234, 0.4);
    transition: box-shadow 0.3s ease;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
    }

    .progress-module {
        padding: 20px;
        margin-bottom: 30px;
    }

    #progress-bar-container {
        height: 35px;
        margin: 15px 0;
    }

    #progress-percentage {
        font-size: 1.1em;
        margin-top: 12px;
    }

    .module-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-progress-container {
        align-self: stretch;
        margin-top: 15px;
        margin-left: 0;
        min-width: auto;
    }

    .section-progress-bar {
        height: 14px;
    }

    .section-progress-text {
        font-size: 0.85em;
        margin-top: 6px;
        text-align: center;
    }

    .timer-controls {
        flex-wrap: wrap;
    }

    .task-tracking {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    #progress-bar-container {
        height: 30px;
        border-radius: 15px;
    }

    #progress-bar-fill {
        border-radius: 13px;
    }

    .section-progress-bar {
        height: 12px;
    }

    .section-progress-fill {
        border-radius: 5px;
    }

    .progress-module {
        padding: 15px;
    }

    #progress-percentage {
        font-size: 1em;
    }
}

/* ===========================
   DARK MODE STYLES
   ========================== */

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e0e0e0;
}

/* General link styles for dark mode */
body.dark-mode a {
    color: #5eb3ff;
    text-decoration: underline;
    text-decoration-color: rgba(94, 179, 255, 0.3);
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

body.dark-mode a:hover {
    color: #90caf9;
    text-decoration-color: #90caf9;
}

body.dark-mode a:visited {
    color: #a294ff;
}

/* Main Container */
body.dark-mode .container {
    background: rgba(30, 30, 46, 0.95);
    color: #e0e0e0;
}

body.dark-mode .main-content {
    background: rgba(30, 30, 46, 0.8);
}

/* Module Cards */
body.dark-mode .module {
    background-color: rgba(45, 45, 65, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-mode .task-module {
    background-color: rgba(45, 45, 65, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Exercise boxes and content areas */
body.dark-mode .exercise-box {
    background: rgba(35, 35, 50, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-mode .task-item {
    background: linear-gradient(135deg, rgba(40, 40, 55, 0.9) 0%, rgba(45, 45, 60, 0.9) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
}

body.dark-mode .task-item:hover {
    background: linear-gradient(135deg, rgba(50, 50, 65, 0.95) 0%, rgba(55, 55, 70, 0.95) 100%) !important;
    border-color: rgba(102, 126, 234, 0.4);
}

/* Notes textarea */
body.dark-mode .notes-input,
body.dark-mode textarea {
    background: rgba(30, 30, 45, 0.9) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .notes-input:focus,
body.dark-mode textarea:focus {
    background: rgba(35, 35, 50, 0.95) !important;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Headers */
body.dark-mode .module-header h2 {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

body.dark-mode .task-content p {
    color: #e0e0e0;
}

body.dark-mode .task-content strong {
    color: #ffffff;
}

/* Resource Links - Enhanced Visibility */
body.dark-mode .item-content a {
    color: #5eb3ff;
    text-decoration: underline;
    text-decoration-color: rgba(94, 179, 255, 0.3);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-weight: 500;
    position: relative;
    display: inline-block;
    transition: all 0.2s ease;
}

body.dark-mode .item-content a::before {
    content: "🔗 ";
    font-size: 0.85em;
    opacity: 0.7;
    margin-right: 2px;
}

body.dark-mode .item-content a:hover {
    color: #90caf9;
    text-decoration-color: #90caf9;
    text-decoration-thickness: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(94, 179, 255, 0.1) 10%, 
        rgba(94, 179, 255, 0.1) 90%, 
        transparent);
    padding: 0 4px;
    margin: 0 -4px;
    border-radius: 3px;
}

body.dark-mode .item-content a:visited {
    color: #a294ff;
    text-decoration-color: rgba(162, 148, 255, 0.3);
}

body.dark-mode .item-content a:visited:hover {
    color: #b8acff;
    text-decoration-color: #b8acff;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(162, 148, 255, 0.1) 10%, 
        rgba(162, 148, 255, 0.1) 90%, 
        transparent);
}

body.dark-mode .item-content a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.75em;
    vertical-align: super;
    opacity: 0.6;
    margin-left: 1px;
}

body.dark-mode .item-content small {
    color: #b0b0b0;
}

/* Exercise Sections - Improved Formatting */
.exercises-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.exercises-section h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.exercise-box {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid #667eea;
}

.exercise-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.15);
}

.exercise-box:last-child {
    margin-bottom: 0;
}

.exercise-title {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.exercise-number {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1em;
    flex-shrink: 0;
}

.exercise-content {
    flex: 1;
}

.exercise-content strong {
    color: #2c3e50;
    font-size: 1.1em;
    display: block;
    margin-bottom: 10px;
}

.exercise-description {
    color: #555;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 12px;
}

.exercise-difficulty {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: capitalize;
}

.difficulty-beginner {
    background: #d4f4dd;
    color: #1e7e34;
}

.difficulty-intermediate {
    background: #fff3cd;
    color: #856404;
}

.difficulty-advanced {
    background: #f8d7da;
    color: #721c24;
}

.exercise-complete {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid #dee2e6;
}

.exercise-complete:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.exercise-complete input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.exercise-complete label {
    cursor: pointer;
    color: #495057;
    font-weight: 500;
    user-select: none;
    margin: 0;
}

.exercise-done:checked + label {
    color: #28a745;
    font-weight: 600;
}

/* Dark mode exercise styles */
body.dark-mode .exercises-section {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

body.dark-mode .exercise-box {
    background: rgba(45, 55, 72, 0.95);
    border-left-color: #667eea;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .exercise-content strong {
    color: #ffffff;
}

body.dark-mode .exercise-description {
    color: #cbd5e0;
}

body.dark-mode .exercise-complete {
    background: rgba(74, 85, 104, 0.5);
    border-color: rgba(113, 128, 150, 0.3);
}

body.dark-mode .exercise-complete:hover {
    background: rgba(74, 85, 104, 0.8);
    border-color: #667eea;
}

body.dark-mode .exercise-complete label {
    color: #e2e8f0;
}

body.dark-mode .exercises-section h4 {
    color: #ffffff;
}

/* ===========================
   RESOURCE LINKS - IMPROVED FORMATTING
   ========================== */

.item-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-item {
    display: flex;
    gap: 15px;
    padding: 18px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.resource-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.resource-number {
    background: linear-gradient(135deg, #5a67d8, #667eea);
    color: white;
    min-width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.95em;
    flex-shrink: 0;
}

.resource-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resource-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.resource-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.05em;
    transition: all 0.2s ease;
}

.resource-link:hover {
    color: #667eea;
}

.resource-title {
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.resource-link:hover .resource-title {
    border-bottom-color: #667eea;
}

.resource-external-icon {
    font-size: 0.85em;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.resource-link:hover .resource-external-icon {
    opacity: 1;
    transform: translate(2px, -2px);
}

.resource-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-documentation {
    background: #e3f2fd;
    color: #1565c0;
}

.type-tutorial {
    background: #f3e5f5;
    color: #7b1fa2;
}

.type-tool {
    background: #e8f5e9;
    color: #2e7d32;
}

.type-video {
    background: #ffebee;
    color: #c62828;
}

.type-course {
    background: #fff3e0;
    color: #e65100;
}

.type-guide {
    background: #fce4ec;
    color: #c2185b;
}

.type-platform {
    background: #e1f5fe;
    color: #0277bd;
}

.type-framework {
    background: #f1f8e9;
    color: #558b2f;
}

.type-reference {
    background: #ede7f6;
    color: #512da8;
}

.type-resource {
    background: #f5f5f5;
    color: #616161;
}

.resource-description {
    color: #555;
    font-size: 0.92em;
    line-height: 1.5;
    padding-left: 2px;
}

.resource-actions {
    display: flex;
    gap: 15px;
    margin-top: 5px;
    align-items: center;
}

.resource-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85em;
}

.resource-checkbox:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.resource-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.resource-checkbox span {
    color: #495057;
    font-weight: 500;
    user-select: none;
}

.resource-checkbox input:checked + span {
    color: #28a745;
    font-weight: 600;
}

/* Item Notes Toggle Button */
.item-notes-toggle {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.85em;
    color: #6c757d;
    transition: all 0.2s;
    margin-left: auto;
    display: flex;
    align-items: center;
}

.item-notes-toggle:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

.item-notes-toggle i {
    font-size: 0.9em;
}

/* Item Notes Section */
.item-notes {
    margin-top: 8px;
    transition: all 0.3s ease;
    padding: 0 12px; /* Add horizontal padding to contain within parent */
}

.item-notes.collapsed {
    display: none;
}

.item-notes-area {
    width: calc(100% - 24px); /* Account for padding to prevent overflow */
    min-height: 50px; /* Slightly smaller height */
    max-height: 80px; /* Limit maximum height */
    padding: 6px 10px; /* Smaller padding */
    border: 1px solid #dee2e6;
    border-radius: 4px; /* Smaller border radius */
    font-family: inherit;
    font-size: 0.8em; /* Slightly smaller font */
    resize: vertical;
    background: #f8f9fa;
    transition: all 0.2s;
    box-sizing: border-box; /* Ensure padding is included in width calculation */
}

.item-notes-area:focus {
    outline: none;
    border-color: #4a90e2;
    background: white;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

/* Disabled checkbox styling for anti-cheat - Standardized blue border for BOTH */
input[type="checkbox"].item-completed:disabled,
input[type="checkbox"].item-started:disabled {
    opacity: 0.7;
    cursor: not-allowed !important;
    transition: all 0.2s ease;
    position: relative;
    border: 2px solid #4a90e2 !important;
    background: rgba(74, 144, 226, 0.05) !important;
    accent-color: #4a90e2 !important;
}

/* Mouse hover effects for disabled checkboxes - Consistent blue border style */
input[type="checkbox"].item-completed:disabled:hover,
input[type="checkbox"].item-started:disabled:hover {
    border-color: #4a90e2 !important;
    background: rgba(74, 144, 226, 0.1) !important;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.15) !important;
    transform: scale(1.02);
    cursor: not-allowed !important;
}


/* Disabled checkbox container hover effect */
input[type="checkbox"]:disabled:hover + span,
input[type="checkbox"]:disabled:hover + label {
    color: #4a90e2;
    transition: color 0.2s ease;
}

/* Additional visual feedback for disabled checkboxes */
input[type="checkbox"]:disabled + span,
input[type="checkbox"]:disabled + label {
    opacity: 0.6;
    cursor: not-allowed;
    transition: all 0.2s ease;
}

/* Dark mode resource styles */
body.dark-mode .resource-item {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.9) 0%, rgba(55, 65, 82, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .resource-item:hover {
    border-color: #667eea;
}

body.dark-mode .resource-link {
    color: #e2e8f0;
}

body.dark-mode .resource-link:hover {
    color: #90caf9;
}

body.dark-mode .resource-description {
    color: #cbd5e0;
}

body.dark-mode .resource-checkbox {
    background: rgba(74, 85, 104, 0.5);
    border-color: rgba(113, 128, 150, 0.3);
}

body.dark-mode .resource-checkbox:hover {
    background: rgba(74, 85, 104, 0.8);
    border-color: rgba(113, 128, 150, 0.5);
}

/* ===== LEARNING MODULES NAVIGATION MODAL ===== */

.modules-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modules-modal {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    width: 85vw;
    max-width: 1000px;
    height: 80vh;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.modules-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.modules-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.modules-modal-header h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.modules-modal-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.modules-modal-controls button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.modules-modal-controls button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.progress-view-btn {
    background: rgba(52, 152, 219, 0.2) !important;
    border-color: rgba(52, 152, 219, 0.4) !important;
}

.progress-view-btn:hover {
    background: rgba(52, 152, 219, 0.3) !important;
}

.close-modal-btn {
    background: rgba(231, 76, 60, 0.2) !important;
    border-color: rgba(231, 76, 60, 0.4) !important;
}

.close-modal-btn:hover {
    background: rgba(231, 76, 60, 0.3) !important;
    transform: translateY(-2px) scale(1.1) rotate(90deg);
}

.modules-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px 35px;
    background: transparent;
}

/* Navigation Module Section Styles */
.modal-module-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    margin-bottom: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(102, 126, 234, 0.15);
    backdrop-filter: blur(10px);
}

.modal-module-section:hover {
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.25);
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(102, 126, 234, 0.3);
}

.modal-module-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #333;
    padding: 20px 28px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
}

.modal-module-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: var(--progress-width, 0%);
    transition: width 0.6s ease;
}

.modal-module-header:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    transform: translateX(4px);
}

.modal-module-title {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.modal-module-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    flex: 1;
}

.modal-progress-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-right: 15px;
}

.modal-progress-bar {
    width: 120px;
    height: 6px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.modal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modal-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.modal-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

.modal-module-stats {
    font-size: 11px;
    color: #64748b;
    display: flex;
    gap: 8px;
}

.modal-module-toggle {
    font-size: 18px;
    color: #667eea;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
}

.modal-module-section.collapsed .modal-module-toggle {
    transform: rotate(-90deg);
    background: rgba(102, 126, 234, 0.2);
}

.modal-module-body {
    padding: 0;
    background: rgba(255, 255, 255, 0.5);
    max-height: 400px;
    overflow-y: auto;
}

.modal-module-section.collapsed .modal-module-body {
    display: none;
}

/* Navigation Resource Links */
.modal-resource-link {
    display: flex;
    align-items: center;
    padding: 12px 28px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.modal-resource-link:last-child {
    border-bottom: none;
}

.modal-resource-link:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    transform: translateX(8px);
}

.modal-resource-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.modal-resource-link:hover::before {
    transform: scaleY(1);
}

.modal-link-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-link-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 15px;
    line-height: 1.4;
    margin: 0;
}

.modal-link-description {
    color: #64748b;
    font-size: 13px;
    line-height: 1.3;
    margin: 0;
}

.modal-link-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
}

.modal-status-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.modal-status-badge.started {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 2px solid rgba(52, 152, 219, 0.4);
}

.modal-status-badge.completed {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
    border: 2px solid rgba(39, 174, 96, 0.4);
}

.modal-status-badge.disabled {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
    border: 2px solid rgba(149, 165, 166, 0.3);
}

.modal-navigate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.modal-navigate-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Quick Stats */
.modal-module-quick-stats {
    padding: 20px 28px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.modal-stat-number {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.modal-stat-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive Design for Navigation Modal */
@media (max-width: 768px) {
    .modules-modal {
        width: 95vw;
        height: 85vh;
        border-radius: 16px;
    }
    
    .modules-modal-header {
        padding: 20px 25px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .modules-modal-header h2 {
        font-size: 22px;
    }
    
    .modules-modal-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .modules-modal-controls button {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .modules-modal-content {
        padding: 20px 25px;
    }
    
    .modal-module-header {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .modal-progress-info {
        align-items: flex-start;
        margin-right: 0;
    }
    
    .modal-progress-bar {
        width: 100px;
    }
    
    .modal-resource-link {
        padding: 10px 20px;
    }
    
    .modal-link-status {
        margin-left: 12px;
        gap: 8px;
    }
    
    .modal-module-quick-stats {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }
}

body.dark-mode .resource-checkbox span {
    color: #e2e8f0;
}

body.dark-mode .type-documentation {
    background: rgba(33, 150, 243, 0.2);
    color: #64b5f6;
}

body.dark-mode .type-tutorial {
    background: rgba(156, 39, 176, 0.2);
    color: #ba68c8;
}

body.dark-mode .type-tool {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

body.dark-mode .type-video {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
}

body.dark-mode .type-course {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
}

body.dark-mode .type-guide {
    background: rgba(233, 30, 99, 0.2);
    color: #f06292;
}

body.dark-mode .type-platform {
    background: rgba(3, 169, 244, 0.2);
    color: #4fc3f7;
}

body.dark-mode .type-framework {
    background: rgba(139, 195, 74, 0.2);
    color: #aed581;
}

body.dark-mode .type-reference {
    background: rgba(103, 58, 183, 0.2);
    color: #9575cd;
}

body.dark-mode .type-resource {
    background: rgba(158, 158, 158, 0.2);
    color: #bdbdbd;
}

/* Checkboxes and Labels */
body.dark-mode .status-label,
body.dark-mode .exercise-complete,
body.dark-mode .task-tracking label {
    color: #e0e0e0;
}

body.dark-mode input[type="checkbox"] {
    accent-color: #64b5f6;
    transform: scale(1.1);
}

body.dark-mode input[type="checkbox"]:checked {
    accent-color: #4CAF50;
}

/* General disabled checkbox styling */
input[type="checkbox"]:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

input[type="checkbox"]:disabled + label,
input[type="checkbox"]:disabled + span {
    opacity: 0.6;
    cursor: not-allowed;
}

body.dark-mode input[type="checkbox"]:disabled {
    opacity: 0.3;
}

/* Buttons */
body.dark-mode .log-time-btn {
    background-color: #4a5cc5;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .log-time-btn:hover {
    background-color: #5a6ccf;
}

body.dark-mode .notes-toggle {
    background-color: rgba(55, 55, 75, 0.9);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .notes-toggle:hover {
    background-color: rgba(70, 70, 90, 0.9);
}

/* Dark mode styling for item notes toggle buttons */
body.dark-mode .item-notes-toggle {
    background: rgba(35, 35, 50, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

body.dark-mode .item-notes-toggle:hover {
    background: rgba(45, 45, 65, 0.95) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Force override inline styles when notes are expanded */
body.dark-mode .item-notes-toggle[style*="background"] {
    background: rgba(40, 40, 55, 0.95) !important;
    color: #ffffff !important;
}

/* Header and Title */
body.dark-mode .gamified-header h1 {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Progress Module Section */
body.dark-mode .progress-module {
    background: #333 !important;
    border: 1px solid #444 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .progress-module h2 {
    color: #ffffff !important;
}

/* Progress Bars */
body.dark-mode .section-progress-container {
    background: rgba(0, 0, 0, 0.3);
}

body.dark-mode .section-progress-bar {
    background: #1a1a1a;
    border: 1px solid #444;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.dark-mode .section-progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.3);
}

body.dark-mode .section-progress-text {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    font-weight: bold;
}

body.dark-mode #progress-bar {
    background: linear-gradient(90deg, #4a5cc5, #64b5f6);
}

body.dark-mode #progress-bar-container {
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    border: 1px solid #444;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode #progress-bar-container:hover {
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(102, 126, 234, 0.3);
}

body.dark-mode #progress-bar-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

body.dark-mode #progress-percentage {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    font-weight: bold;
}

/* Notes */
body.dark-mode .section-notes {
    background-color: rgba(30, 30, 46, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .notes-area {
    background-color: rgba(40, 40, 60, 0.9);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .notes-area::placeholder {
    color: #888888;
}

/* Timer */
body.dark-mode .timer-display {
    background-color: rgba(30, 30, 46, 0.9);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .total-time-container {
    color: #e0e0e0;
}

/* Resource Grid */
body.dark-mode .resources-grid {
    background-color: rgba(40, 40, 60, 0.5);
}

body.dark-mode .resource-category h3 {
    color: #ffffff;
}

body.dark-mode .resource-category ul li {
    color: #e0e0e0;
}

body.dark-mode .resource-category ul li a {
    color: #5eb3ff;
    text-decoration: underline;
    text-decoration-color: rgba(94, 179, 255, 0.3);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
}

body.dark-mode .resource-category ul li a::before {
    content: "→ ";
    color: #64b5f6;
    font-weight: bold;
    margin-right: 4px;
}

body.dark-mode .resource-category ul li a:hover {
    color: #90caf9;
    text-decoration-color: #90caf9;
    text-decoration-thickness: 2px;
    background: rgba(94, 179, 255, 0.1);
    padding: 2px 6px;
    margin: -2px -6px;
    border-radius: 4px;
}

body.dark-mode .resource-category ul li a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.75em;
    vertical-align: super;
    opacity: 0.6;
}

/* Lists and Checklist Items */
body.dark-mode .item-checklist {
    background-color: transparent;
}

body.dark-mode .item-with-status {
    background-color: rgba(35, 35, 50, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .item-with-status:hover {
    background-color: rgba(45, 45, 65, 0.9);
    border-color: rgba(100, 181, 246, 0.3);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

body.dark-mode .item-status {
    background-color: rgba(25, 25, 40, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
}

body.dark-mode .item-content {
    background-color: rgba(40, 40, 55, 0.6);
    color: #e0e0e0;
}

/* Section Actions */
body.dark-mode .section-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .time-log-container span {
    color: #e0e0e0;
}

/* ===== DARK MODE NAVIGATION MODAL STYLES ===== */

/* Modal Overlay and Container */
body.dark-mode .modules-modal-overlay {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
}

body.dark-mode .modules-modal {
    background: linear-gradient(135deg, rgba(30, 30, 46, 0.98) 0%, rgba(20, 20, 35, 0.98) 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Modal Header */
body.dark-mode .modules-modal-header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .modules-modal-header h2 {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Modal Controls */
body.dark-mode .modules-modal-controls button {
    background: rgba(45, 45, 65, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
}

body.dark-mode .modules-modal-controls button:hover {
    background: rgba(55, 55, 75, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

body.dark-mode .progress-view-btn {
    background: rgba(52, 152, 219, 0.3) !important;
    border-color: rgba(52, 152, 219, 0.5) !important;
}

body.dark-mode .progress-view-btn:hover {
    background: rgba(52, 152, 219, 0.4) !important;
}

body.dark-mode .close-modal-btn {
    background: rgba(231, 76, 60, 0.3) !important;
    border-color: rgba(231, 76, 60, 0.5) !important;
}

body.dark-mode .close-modal-btn:hover {
    background: rgba(231, 76, 60, 0.4) !important;
}

/* Modal Content */
body.dark-mode .modules-modal-content {
    background: transparent;
}

/* Module Sections */
body.dark-mode .modal-module-section {
    background: rgba(45, 45, 65, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

body.dark-mode .modal-module-section:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

/* Module Headers */
body.dark-mode .modal-module-header {
    background: linear-gradient(135deg, rgba(55, 55, 75, 0.6) 0%, rgba(45, 45, 65, 0.6) 100%);
    color: #e0e0e0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .modal-module-header:hover {
    background: linear-gradient(135deg, rgba(65, 65, 85, 0.8) 0%, rgba(55, 55, 75, 0.8) 100%);
}

body.dark-mode .modal-module-title h3 {
    color: #ffffff;
}

/* Progress Elements */
body.dark-mode .modal-progress-bar {
    background: rgba(40, 40, 55, 0.8);
}

body.dark-mode .modal-progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

body.dark-mode .modal-progress-text {
    color: #90caf9;
}

body.dark-mode .modal-module-stats {
    color: #cbd5e0;
}

/* Module Toggle */
body.dark-mode .modal-module-toggle {
    color: #90caf9;
    background: rgba(102, 126, 234, 0.2);
}

body.dark-mode .modal-module-section.collapsed .modal-module-toggle {
    background: rgba(102, 126, 234, 0.3);
}

/* Module Body */
body.dark-mode .modal-module-body {
    background: rgba(35, 35, 50, 0.7);
}

/* Resource Links */
body.dark-mode .modal-resource-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .modal-resource-link:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

body.dark-mode .modal-link-title {
    color: #ffffff;
}

body.dark-mode .modal-link-description {
    color: #cbd5e0;
}

/* Status Badges */
body.dark-mode .modal-status-badge.started {
    background: rgba(52, 152, 219, 0.3);
    color: #64b5f6;
    border-color: rgba(52, 152, 219, 0.5);
}

body.dark-mode .modal-status-badge.completed {
    background: rgba(39, 174, 96, 0.3);
    color: #4caf50;
    border-color: rgba(39, 174, 96, 0.5);
}

body.dark-mode .modal-status-badge.disabled {
    background: rgba(149, 165, 166, 0.3);
    color: #bdbdbd;
    border-color: rgba(149, 165, 166, 0.4);
}

/* Navigate Button */
body.dark-mode .modal-navigate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

body.dark-mode .modal-navigate-btn:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Quick Stats */
body.dark-mode .modal-module-quick-stats {
    background: linear-gradient(135deg, rgba(45, 45, 65, 0.6) 0%, rgba(35, 35, 55, 0.6) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .modal-stat-number {
    color: #90caf9;
}

body.dark-mode .modal-stat-label {
    color: #cbd5e0;
}

/* Item Notes Textarea Dark Mode */
body.dark-mode .item-notes-area {
    background: rgba(30, 30, 45, 0.9) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .item-notes-area:focus {
    background: rgba(35, 35, 50, 0.95) !important;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

body.dark-mode .item-notes-area::placeholder {
    color: #888888;
}

/* Notes Modal Dark Mode Styles - Added for complete dark mode support */
body.dark-mode .notes-modal {
    background: rgba(0, 0, 0, 0.85) !important;
}

body.dark-mode .notes-modal-content {
    background: linear-gradient(135deg, #2a2a3e 0%, #1e1e2e 100%) !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .notes-modal-content h2 {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .notes-section-item {
    background: rgba(45, 45, 65, 0.8) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
}

body.dark-mode .notes-section-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2)) !important;
    color: #ffffff !important;
}

body.dark-mode .notes-section-header:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3)) !important;
}

body.dark-mode .notes-modal-textarea {
    background: rgba(30, 30, 40, 0.9) !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
}

body.dark-mode .notes-modal-textarea:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

body.dark-mode .notes-control-btn {
    background: linear-gradient(135deg, #4a5cc5, #5a3d7a) !important;
    color: #ffffff !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
}

body.dark-mode .notes-control-btn:hover {
    background: linear-gradient(135deg, #5a6cd5, #6a4d8a) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

body.dark-mode .notes-timestamp {
    color: #999 !important;
}

body.dark-mode .notes-empty {
    color: #888 !important;
    background: rgba(45, 45, 65, 0.5) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    padding: 20px !important;
    border-radius: 8px !important;
}

/* Achievements Modal Dark Mode Styles - Added for complete dark mode support */
body.dark-mode .achievements-modal {
    background: rgba(0, 0, 0, 0.85) !important;
}

body.dark-mode .achievements-content {
    background: linear-gradient(135deg, #2a2a3e 0%, #1e1e2e 100%) !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .achievements-content h2 {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .achievements-tabs {
    background: transparent !important;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2) !important;
    padding-bottom: 10px !important;
    margin-bottom: 20px !important;
}

body.dark-mode .tab-btn {
    background: rgba(45, 45, 65, 0.8) !important;
    color: #c0c0c0 !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
}

body.dark-mode .tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #ffffff !important;
    border: 1px solid transparent !important;
}

body.dark-mode .tab-btn:hover {
    background: rgba(55, 55, 75, 0.9) !important;
    border-color: rgba(102, 126, 234, 0.4) !important;
}

body.dark-mode .achievement-card {
    background: rgba(45, 45, 65, 0.6) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    color: #e0e0e0 !important;
}

body.dark-mode .achievement-card.earned {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 237, 78, 0.2)) !important;
    border: 1px solid rgba(255, 215, 0, 0.4) !important;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2) !important;
}

body.dark-mode .achievement-card h3 {
    color: #ffffff !important;
}

body.dark-mode .achievement-card p {
    color: #c0c0c0 !important;
}

body.dark-mode .achievement-card.earned h3,
body.dark-mode .achievement-card.earned p {
    color: #ffd700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .achievement-xp {
    color: #667eea !important;
    font-weight: bold !important;
}

body.dark-mode .achievement-card.earned .achievement-xp {
    color: #ffd700 !important;
}

body.dark-mode .empty-challenges-state {
    background: rgba(45, 45, 65, 0.5) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    padding: 20px !important;
    border-radius: 8px !important;
}

body.dark-mode .empty-challenges-state h3 {
    color: #667eea !important;
}

body.dark-mode .challenge-placeholder {
    background: rgba(30, 30, 40, 0.5) !important;
}

body.dark-mode .challenge-preview {
    background: rgba(45, 45, 65, 0.4) !important;
    color: #c0c0c0 !important;
    border: 1px solid rgba(102, 126, 234, 0.1) !important;
}

body.dark-mode .daily-challenges-list {
    background: transparent !important;
}

body.dark-mode .challenge-item {
    background: rgba(45, 45, 65, 0.6) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    color: #e0e0e0 !important;
}

body.dark-mode .challenge-item.completed {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.2), rgba(46, 213, 115, 0.1)) !important;
    border-color: rgba(46, 213, 115, 0.4) !important;
}