/* Modern Dashboard Styles */
:root {
    --primary-color: #18326b;
    --secondary-color: #4a90e2;
    --background-color: #f5f6fa;
    --text-color: #333;
    --success-color: #dcfce7;
    --success-text: #166534;
    --error-color: #fde8e8;
    --error-text: #9b1c1c;
    --sidebar-width: 250px;
    --header-height: 60px;
    --z-index-header: 1100;
    --z-index-nav: 1090;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header and Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0);
    height: var(--header-height);
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

/* Mobile menu button */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color);
    z-index: 1001;
}

/* Navigation menu */
.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu ul {
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--secondary-color);
    background: rgba(74, 144, 226, 0.1);
}

.nav-link.active {
    background: var(--secondary-color);
    color: white;
}

/* Mobile styles */
@media (max-width: 768px) {
    header {
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu-button {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        display: none;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.mobile-menu-open {
        display: block;
        animation: slideDown 0.3s ease forwards;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-link {
        display: block;
        padding: 1rem;
        width: 100%;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main content adjustment for fixed header */
.main-content {
    padding-top: calc(var(--header-height) + 2rem);
}

.welcome-section {
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-section h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Charts */
.chart-container {
    width: 100%;
    height: 300px;
}

/* Stats Cards */
.stats-card {
    text-align: center;
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin: 0.5rem 0;
}

.stats-label {
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: var(--z-index-nav);
    }

    .nav-menu.mobile-menu-open {
        display: block;
    }

    .nav-menu ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
    }

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

    .mobile-menu-button {
        display: block;
    }

    .nav-menu {
        display: none;
        width: 100%;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: var(--z-index-nav);
    }

    .mobile-menu-open {
        display: block !important;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-menu a {
        display: block;
        padding: 0.75rem 1rem;
        width: 100%;
    }
}

/* Settings Page Styles */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Modal styles */
.fixed {
    position: fixed;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.bg-gray-600 {
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    inset: 0;
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.modal-container {
    width: 100%;
    max-width: 500px;
    margin: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal-content {
    width: 100%;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(1);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

.hidden .modal-content {
    transform: scale(0.95);
    opacity: 0;
}

/* Modal overlay and container */
.bg-gray-600 {
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    inset: 0;
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: auto;
    z-index: 1001;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
}

/* Modal animation */
.hidden {
    display: none !important;
}

.hidden .bg-gray-600 {
    opacity: 0;
}

.hidden .modal-container {
    transform: scale(0.95);
}

/* Form styles inside modal */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: white;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Add proper modal centering */
.modal-container {
    position: relative;
    min-height: 100vh;
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease-out;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hidden .modal-content {
    opacity: 0;
    transform: translateY(-20px);
}

/* Status badges */
.bg-green-100 {
    background-color: #def7ec;
}

.text-green-800 {
    color: #03543f;
}

.bg-red-100 {
    background-color: #fde8e8;
}

.text-red-800 {
    color: #9b1c1c;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: var(--success-color);
    color: var(--success-text);
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Modal and form styles */
.modal-box {
    max-width: 32rem;
    border-radius: 1rem;
}

.input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 50, 107, 0.2);
}

.textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    min-height: 8rem;
    transition: all 0.2s ease-in-out;
}

.textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 50, 107, 0.2);
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background-color: #122552;
}

.btn-ghost {
    color: #4b5563;
    background-color: transparent;
}

.btn-ghost:hover {
    background-color: #f3f4f6;
}

.btn-circle {
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
}

.label-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

/* Modal Backdrop and Animation */
dialog {
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

dialog[open] {
    animation: slide-up 0.3s ease-out;
}

/* Modal Content Styles */
.modal-box {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
}

/* Add New Button Styles */
.btn-add-new {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(74, 144, 226, 0.15);
}

.btn-add-new i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.btn-add-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(74, 144, 226, 0.2);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.btn-add-new:hover i {
    transform: rotate(90deg);
}

.btn-add-new:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.1);
}

/* Compact variant */
.btn-add-new.compact {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Outline variant */
.btn-add-new.outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-add-new.outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Modal overlay background */
.bg-gray-600 {
    background-color: rgba(75, 85, 99, 0.75);
    position: fixed;
    inset: 0;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    overflow-y: auto;
    padding: 1rem;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.course-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.course-progress {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.progress-ring__circle {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring__circle--bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 4;
}

.progress-ring__circle--fg {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 4;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    font-weight: 600;
    color: #3b82f6;
}

.course-meta {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    color: #64748b;
    font-size: 0.875rem;
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
    color: #64748b;
}

.main-content {
    padding-top: 80px;
}

.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.courses-wrapper {
    padding: 2rem 0;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.course-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

.course-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.course-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    flex: 1;
}

.progress-ring-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.progress-ring {
    position: relative;
}

.progress-ring__circle {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring__circle--bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 4;
}

.progress-ring__circle--fg {
    fill: none;
    stroke: var(--secondary-color);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.course-content {
    flex: 1;
}

.course-description {
    color: #4b5563;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.course-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.stat i {
    color: var(--secondary-color);
}

.course-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.btn-continue {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.btn-continue:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-continue i {
    transition: transform 0.3s ease;
}

.btn-continue:hover i {
    transform: translateX(4px);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    border: 2px dashed #e5e7eb;
}

.empty-state i {
    font-size: 4rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

.empty-state h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6b7280;
}