/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6 {
    color: #1a1a2e;
    font-weight: 600;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fc;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: #0a0a0f;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(65, 105, 225, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-courses {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-courses:hover {
    background: rgba(255,255,255,0.15);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    margin-left: 15px;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.15);
}

/* User Dropdown */
.nav-user-dropdown {
    position: relative;
    display: inline-block;
}

.profile-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.profile-btn:hover {
    background: rgba(255,255,255,0.15);
}

.profile-icon {
    display: flex;
}

.dropdown-arrow {
    font-size: 0.7rem;
    opacity: 0.8;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: white;
    min-width: 200px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 1000;
    border: 1px solid rgba(65, 105, 225, 0.2);
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn 0.2s;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    margin: 0;
    border-radius: 0;
    font-weight: 500;
}

.dropdown-menu a:hover {
    background: rgba(65, 105, 225, 0.1);
    color: #4169E1;
}

.dropdown-menu a:last-child {
    border-top: 1px solid #eee;
    color: #dc3545;
}

.dropdown-menu a:last-child:hover {
    background: rgba(220, 53, 69, 0.1);
}

.dropdown-menu a svg {
    flex-shrink: 0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}

/* Page Management */
.page {
    display: none;
    animation: fadeIn 0.3s;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Locked Message */
.locked-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.locked-content {
    background: white;
    padding: 50px 60px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(65, 105, 225, 0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    
    /* Centrare Absolută Bulletproof */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.lock-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 20px;
}

.more-locked {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
}

/* Module Card - Locked */
.module-card.locked {
    opacity: 0.7;
    position: relative;
}

.module-card.locked .module-image {
    position: relative;
}

.module-card.locked .lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

/* Home Page - Module Grid */
.page-title {
    font-size: 2rem;
    margin-bottom: 10px;
    margin-top: 22px;
    color: #1a1a2e;
    font-weight: 700;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.module-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(65, 105, 225, 0.15);
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(65, 105, 225, 0.15);
    border-color: rgba(65, 105, 225, 0.4);
}

.module-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: linear-gradient(135deg, #4169E1, #1E3A8A);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.module-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.module-info {
    padding: 20px;
}

.module-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #1a1a2e;
}

.module-info p {
    color: #666;
    font-size: 0.9rem;
}

/* Module Page */
.module-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
    position: fixed;
    height: calc(100vh - 60px);
}

.back-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 20px;
    padding: 8px 0;
}

.back-btn:hover {
    text-decoration: underline;
}

.sidebar-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

.chapters-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.chapter-header {
    background: #f8f9fc;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: all 0.2s;
    color: #1a1a2e;
}

.chapter-header:hover {
    background: #eef0f5;
}

.chapter-header .toggle-icon {
    transition: transform 0.3s;
}

.chapter-item.open .toggle-icon {
    transform: rotate(180deg);
}

.chapter-lessons {
    display: none;
    padding: 0;
}

.chapter-item.open .chapter-lessons {
    display: block;
}

.lesson-item {
    padding: 10px 15px 10px 30px;
    cursor: pointer;
    border-top: 1px solid #f0f0f0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
}

.lesson-item:hover {
    background: #f8f9fc;
}

.lesson-item.active {
    background: linear-gradient(135deg, #4169E1, #2855D6);
    color: white;
}

.lesson-item .play-icon {
    font-size: 0.8rem;
}

.lesson-item.completed {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4caf50;
}

/* Progress tracking */
.lesson-item.completed {
    background-color: rgba(76, 175, 80, 0.1);
}

.lesson-item.completed .play-icon {
    color: #4caf50;
}

.module-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.module-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #4169E1, #2855D6);
    transition: width 0.3s ease;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(65, 105, 225, 0.4);
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4169E1;
    min-width: 40px;
}

.lesson-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-success {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn-success:hover {
    background-color: #45a049;
}

/* Content Area */
.content-area {
    flex: 1;
    margin-left: 300px;
    padding: 20px;
    background: #f8f9fc;
    min-height: calc(100vh - 60px);
}

.lesson-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(65, 105, 225, 0.15);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lesson-description {
    margin-top: 20px;
}

.lesson-description h2 {
    margin-bottom: 15px;
    color: #1a1a2e;
}

.lesson-description p {
    color: #555;
}

.attachments {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.attachments h3 {
    margin-bottom: 15px;
    color: #333;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.attachment-item:hover {
    background: #e9ecef;
}

/* Subscription Page */
.subscription-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.subscription-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.plan-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.plan-price {
    font-size: 3rem;
    font-weight: bold;
    color: #D4AF37;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.plan-price span {
    font-size: 1rem;
    color: #666;
}

.plan-features {
    list-style: none;
    margin: 30px 0;
    text-align: left;
}

.plan-features li {
    padding: 10px 0;
    font-size: 1.1rem;
}

.plan-features li.strikethrough {
    text-decoration: line-through;
    opacity: 0.5;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2rem;
}

.subscription-status {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Profile Page */
.profile-container {
    max-width: 600px;
    margin: 0 auto;
}

.profile-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.profile-info p {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

/* Admin Page */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-header h1 {
    font-size: 2rem;
    color: #333;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.admin-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.admin-filters input,
.admin-filters select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.admin-filters input {
    flex: 1;
}

.admin-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.table-responsive {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.users-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-expired {
    background: #f8d7da;
    color: #721c24;
}

.status-none {
    background: #e2e3e5;
    color: #383d41;
}

.status-cancelled {
    background: #fff3cd;
    color: #856404;
}

.pagination {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-module-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-module-info {
    flex: 1;
    min-width: 200px;
}

.admin-module-info h3 {
    margin-bottom: 5px;
    color: #333;
}

.admin-module-info p {
    color: #666;
    font-size: 0.9rem;
}

.admin-module-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-chapters {
    width: 100%;
    margin-left: 20px;
    margin-top: 15px;
    padding-left: 20px;
    border-left: 2px solid #667eea;
}

.admin-chapter-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.admin-chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-chapter-header h4 {
    color: #333;
}

.admin-lessons {
    margin-left: 15px;
    margin-top: 10px;
}

.admin-lesson-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 5px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
}

.admin-lesson-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-lesson-info span {
    color: #666;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: linear-gradient(135deg, #4169E1, #2855D6);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(65, 105, 225, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(65, 105, 225, 0.2);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-large {
    max-width: 700px;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #4169E1;
}

.error-message {
    color: #dc3545;
    margin-bottom: 15px;
    padding: 10px;
    background: #fee2e2;
    border-radius: 6px;
}

.success-message {
    color: #28a745;
    margin-bottom: 15px;
    padding: 10px;
    background: #d4edda;
    border-radius: 6px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group input[type="file"],
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #333;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4169E1;
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.15);
}

.form-group input::placeholder {
    color: #999;
}

.image-preview {
    margin-top: 10px;
    max-width: 200px;
}

.image-preview img {
    width: 100%;
    border-radius: 5px;
}

.video-preview {
    margin-top: 10px;
}

.video-preview video {
    max-width: 100%;
    border-radius: 5px;
}

.files-list {
    margin-top: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 5px;
}

.file-item button {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modules-grid {
        grid-template-columns: 1fr;
    }

    .module-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        max-height: 300px;
    }

    .content-area {
        margin-left: 0;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-module-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-module-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .admin-filters {
        flex-direction: column;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .nav-links a {
        margin-left: 10px;
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}