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

:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --success-color: #38a169;
    --warning-color: #d69e2e;
    --danger-color: #e53e3e;
    --info-color: #4299e1;
    --dark-color: #2d3748;
    --light-color: #f7fafc;
    --gray-color: #718096;
    --border-color: #e2e8f0;
    --card-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
    --transition: all 0.25s ease;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #ffffff;
    --surface-2: #f8fafc;
    --border-subtle: rgba(148, 163, 184, 0.35);
    --ring: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(1200px 600px at 10% 10%, rgba(102, 126, 234, 0.24) 0%, rgba(102, 126, 234, 0.00) 55%),
        radial-gradient(900px 500px at 90% 20%, rgba(118, 75, 162, 0.22) 0%, rgba(118, 75, 162, 0.00) 60%),
        radial-gradient(900px 500px at 40% 95%, rgba(66, 153, 225, 0.16) 0%, rgba(66, 153, 225, 0.00) 55%),
        linear-gradient(135deg, #f7f8fb 0%, #eef2ff 55%, #f1f5f9 100%);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body * {
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(102, 126, 234, 0.22);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px;
}

.header {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(12px);
}

.header-content h1 {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.4em;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.subtitle {
    color: var(--gray-color);
    font-size: 1.05em;
    margin-bottom: 20px;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 55px rgba(102, 126, 234, 0.28);
}

.stat-value {
    font-size: 2.5em;
    font-weight: 800;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.top-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.bottom-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.bottom-row .card {
    height: 100%;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 65px rgba(15, 23, 42, 0.14);
}

.card-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25em;
    letter-spacing: -0.01em;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 30px;
}

.collapsible-card.is-collapsed .card-body {
    display: none;
}

.collapsible-card .card-header {
    cursor: pointer;
}

.collapsible-card.is-collapsed .card-header {
    border-bottom: none;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-size: 16px;
    transition: var(--transition);
    font-family: inherit;
    background: rgba(255, 255, 255, 0.85);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--ring);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn:active {
    transform: translateY(0px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #2f855a 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #b7791f 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c53030 100%);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px) rotate(10deg);
}

.courses-list {
    max-height: 650px;
    overflow-y: auto;
    padding-right: 10px;
}

.course-item {
    background: rgba(248, 250, 252, 0.85);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}

.course-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(102, 126, 234, 0.55);
    transform: translateX(4px);
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.course-title {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.course-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: var(--gray-color);
}

.course-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82em;
    font-weight: 700;
    letter-spacing: -0.01em;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(226, 232, 240, 0.65);
    color: #334155;
    user-select: none;
}

.course-status--complete {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.28);
    color: #166534;
}

.course-status--progress {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.32);
    color: #854d0e;
}

.course-status--new {
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.35);
    color: #334155;
}

.course-description {
    color: var(--gray-color);
    font-size: 0.92em;
    margin-top: 10px;
}

.course-progress {
    margin: 15px 0;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: var(--gray-color);
    margin-top: 5px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-color);
}

.empty-state i {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--dark-color);
}

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

.mini-stat {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}

.mini-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2em;
}

.mini-stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--dark-color);
}

.mini-stat-label {
    font-size: 0.9em;
    color: var(--gray-color);
}

.chart-container {
    height: 300px;
    position: relative;
}

.timer-widget {
    display: grid;
    gap: 16px;
}

.timer-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.timer-top label {
    font-size: 0.85em;
    color: var(--gray-color);
    margin-bottom: 6px;
}

.timer-display {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    font-weight: 800;
    font-size: 2.3em;
    text-align: center;
    padding: 18px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.timer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.timer-log {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
}

.timer-course label {
    font-size: 0.85em;
    color: var(--gray-color);
    margin-bottom: 6px;
}

.timer-sessions {
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.timer-sessions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.timer-sessions-title {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.timer-sessions-list {
    display: grid;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.timer-session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--border-subtle);
}

.timer-session-left {
    display: grid;
}

.timer-session-title {
    font-weight: 700;
    font-size: 0.95em;
}

.timer-session-meta {
    font-size: 0.85em;
    color: var(--gray-color);
}

.timer-session-time {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--surface-solid);
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 40px 120px rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--surface-solid);
    z-index: 1;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    font-size: 1.6em;
    color: var(--dark-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-color);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modules-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.back-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--border-subtle);
    padding: 10px 15px;
    border-radius: 10px;
    align-items: center;
}

.search-bar i {
    color: #718096;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 14px;
}

.search-bar select {
    padding: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.notes-editor {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: rgba(255, 255, 255, 0.85);
}

.notes-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--ring);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quick-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.module-item {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
}

.module-item:hover {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.module-item.completed {
    border-left-color: #38a169;
    background: rgba(34, 197, 94, 0.08);
}

.module-item.pending {
    border-left-color: #d69e2e;
    background: rgba(245, 158, 11, 0.10);
}

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

.module-title {
    flex: 1;
}

.module-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

.module-meta {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 0.85em;
    color: #718096;
}

.module-actions {
    display: flex;
    gap: 8px;
}

.module-checkbox {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.module-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-complete {
    background: #c6f6d5;
    color: #22543d;
}

.status-pending {
    background: #feebc8;
    color: #744210;
}

.status-overdue {
    background: #fed7d7;
    color: #742a2a;
}

.module-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tag {
    background: #e2e8f0;
    color: #4a5568;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}

.tag-beginner { background: #c6f6d5; color: #22543d; }
.tag-intermediate { background: #feebc8; color: #744210; }
.tag-advanced { background: #fed7d7; color: #742a2a; }

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.modal-tabs .tab {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #718096;
    transition: all 0.3s ease;
}

.modal-tabs .tab:hover {
    background: #f8fafc;
    color: #4a5568;
}

.modal-tabs .tab.active {
    background: #667eea;
    color: white;
}

/* Advanced Edit Form */
.advanced-form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.advanced-form-section h3 {
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 1.1em;
}

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

.date-picker {
    display: flex;
    gap: 10px;
}

.date-picker input {
    flex: 1;
}

.time-estimate {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-display {
    font-weight: 600;
    color: #667eea;
}

/* Resources Section */
.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
}

.resource-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-type {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2em;
}

.resource-type.video { background: #e53e3e; }
.resource-type.document { background: #3182ce; }
.resource-type.link { background: #38a169; }
.resource-type.other { background: #718096; }

.resource-actions {
    display: flex;
    gap: 5px;
}

.add-resource-btn {
    width: 100%;
    padding: 12px;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #718096;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.add-resource-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

/* Bulk Edit */
.bulk-edit-options {
    margin-bottom: 20px;
}

.bulk-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.selected-modules {
    max-height: 200px;
    overflow-y: auto;
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.selected-module {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: white;
    border-radius: 6px;
    margin-bottom: 5px;
}

/* Progress Bar Enhancements */
.progress-container {
    margin: 20px 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #718096;
    margin-top: 5px;
}

/* Calendar View */
.calendar-view {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-day.completed {
    background: #38a169;
    color: white;
}

.calendar-day.partial {
    background: #d69e2e;
    color: white;
}

.calendar-day.empty {
    background: #f8fafc;
    color: #718096;
}

.calendar-day:hover:not(.empty) {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr !important;
    }

    .top-row {
        grid-template-columns: 1fr;
    }

    .bottom-row {
        grid-template-columns: 1fr;
    }

    .header-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95% !important;
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }

    .timer-top {
        grid-template-columns: 1fr;
    }

    .timer-log {
        grid-template-columns: 1fr;
    }
}