/* TECES LMS - Main Stylesheet */

/* CSS Variables */
:root {
    --teces-primary: #587058;
    --teces-secondary: #364536;
    --teces-accent: #FFF8CC;
    --teces-danger: #E86850;
    --teces-success: #28a745;
    --teces-warning: #ffc107;
    --teces-light: #f8f9fa;
    --teces-border: #e9ecef;
    --teces-text: #364536;
    --teces-muted: #6c757d;
    --teces-white: #ffffff;
    --teces-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Course Library */
.teces-library {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.teces-course-card {
    background: var(--teces-white);
    border: 2px solid var(--teces-primary);
    padding: 25px;
    transition: all 0.3s ease;
}

.teces-course-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--teces-shadow);
}

.teces-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.teces-card-icon {
    width: 40px;
    height: 40px;
    background: var(--teces-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.teces-card-icon svg {
    width: 22px;
    height: 22px;
    fill: var(--teces-white);
}

.teces-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    margin: 0;
    line-height: 1.3;
}

.teces-card-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--teces-text);
}

.teces-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.teces-card-description {
    font-size: 15px;
    color: var(--teces-text);
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.teces-progress {
    margin-bottom: 20px;
}

.teces-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.teces-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--teces-border);
    overflow: hidden;
}

.teces-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--teces-primary), var(--teces-secondary));
    transition: width 0.3s ease;
}

.teces-card-actions {
    display: flex;
    gap: 12px;
}

.teces-btn {
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

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

.teces-btn-primary:hover {
    background: var(--teces-secondary);
    color: var(--teces-white);
    text-decoration: none;
}

.teces-btn-secondary {
    background: transparent;
    color: var(--teces-primary);
    border: 2px solid var(--teces-primary);
}

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

/* Course Viewer */
.teces-viewer {
    max-width: 100%;
    margin: 0;
}

.teces-timer {
    display: inline-block;
    font-size: 65px;
    color: var(--teces-danger);
    font-weight: bold;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    padding: 15px 25px;
    margin: 15px 0;
    text-align: center;
}

.teces-timer.warning { color: #ff6600; }
.teces-timer.danger { color: #ff3300; animation: pulse 1s infinite; }
.teces-timer.completed { color: var(--teces-success); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.teces-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 15px 0;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--teces-primary) 0%, #4a6350 100%);
    border-radius: 8px;
    gap: 8px;
}

.teces-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--teces-white);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.teces-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--teces-white);
    text-decoration: none;
}

.teces-control-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.teces-control-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.teces-section-info {
    flex: 1;
    text-align: center;
    color: var(--teces-white);
    font-size: 15px;
    font-weight: 600;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 200px;
}

.teces-lock-icon {
    margin-left: 5px;
    color: #f39c12;
}

/* Dropdown */
.teces-dropdown {
    position: relative;
    display: inline-block;
}

.teces-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--teces-white);
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 150px;
    z-index: 1000;
    display: none;
}

.teces-dropdown-menu.show { display: block; }

.teces-dropdown-menu li { border-bottom: 1px solid #eee; }
.teces-dropdown-menu li:last-child { border-bottom: none; }

.teces-dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
}

.teces-dropdown-menu a:hover { background: #f5f5f5; }
.teces-dropdown-menu a.locked { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.teces-dropdown-menu a.completed { color: var(--teces-success); font-weight: bold; }

/* Section Content */
.teces-section-content {
    margin-top: 20px;
    padding: 20px 0;
    line-height: 1.6;
}

.teces-section-description {
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-left: 4px solid var(--teces-primary);
}

/* Course Completion */
.teces-completion {
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.teces-completion-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: var(--teces-primary);
}

.teces-completion-title {
    font-size: 3em;
    color: var(--teces-primary);
    margin: 0 0 10px;
    font-weight: bold;
}

.teces-completion-message {
    font-size: 1.2em;
    color: var(--teces-text);
    max-width: 600px;
    margin: 0 auto 30px;
}

.teces-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    margin: 50px 0;
    padding: 30px;
    background: var(--teces-accent);
    border: 2px solid var(--teces-primary);
}

.teces-stat-item { text-align: center; }

.teces-stat-number {
    font-size: 2em;
    font-weight: 700;
    color: var(--teces-primary);
    margin-bottom: 5px;
}

.teces-stat-label {
    font-size: 0.9em;
    color: var(--teces-text);
    text-transform: uppercase;
}

.teces-certificate-section {
    margin: 50px 0;
    padding: 40px 20px;
    text-align: center;
}

.teces-certificate-btn {
    background: var(--teces-primary);
    color: var(--teces-white);
    border: none;
    padding: 18px 40px;
    font-size: 1.2em;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.teces-certificate-btn:hover {
    background: var(--teces-secondary);
    transform: translateY(-3px);
}

/* Course Access */
.teces-access {
    background: var(--teces-white);
    padding: 30px;
}

.teces-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

.teces-badge {
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    color: var(--teces-text);
}

.teces-badge-blue { background: #dbeafe; }
.teces-badge-green { background: #e8f5e8; }
.teces-badge-red { background: #fee2e2; }

.teces-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
}

.teces-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--teces-primary);
    padding: 8px 16px;
    border: 2px solid var(--teces-primary);
}

.teces-enroll-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--teces-danger);
    color: var(--teces-white);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.teces-enroll-btn:hover {
    background: #c53030;
    transform: translateY(-2px);
}

/* Messages */
.teces-message {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.teces-message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.teces-message-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* User Profile Dashboard */
.teces-profile { max-width: 1200px; margin: 0 auto; padding: 20px; }
.teces-profile-header { background: linear-gradient(135deg, var(--teces-primary), var(--teces-secondary)); color: white; padding: 40px 30px; margin-bottom: 30px; text-align: center; }
.teces-avatar { width: 80px; height: 80px; background: var(--teces-accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 32px; font-weight: bold; color: var(--teces-primary); }
.teces-profile-name { font-size: 2em; margin: 0 0 8px; color: white; }
.teces-profile-email { opacity: 0.9; }
.teces-profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 25px; margin-bottom: 30px; }
.teces-profile-card { background: white; border: 2px solid var(--teces-primary); padding: 25px; }
.teces-profile-card .teces-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px solid var(--teces-secondary); }
.teces-profile-card h2 { margin: 0; font-size: 1.3em; color: var(--teces-primary); }
.teces-edit-btn { background: none; border: 1px solid var(--teces-primary); color: var(--teces-primary); padding: 5px 12px; cursor: pointer; border-radius: 4px; }
.teces-edit-btn:hover { background: var(--teces-primary); color: white; }
.teces-info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--teces-border); }
.teces-info-row:last-child { border-bottom: none; }
.teces-label { font-weight: 600; color: var(--teces-primary); text-transform: uppercase; font-size: 0.85em; }
.teces-value { color: var(--teces-text); }
.teces-form-row { display: flex; gap: 15px; }
.teces-form-group { margin-bottom: 15px; flex: 1; }
.teces-form-group label { display: block; margin-bottom: 5px; font-weight: 600; }
.teces-form-group input, .teces-form-group select { width: 100%; padding: 8px 12px; border: 1px solid var(--teces-border); border-radius: 4px; }
.teces-form-actions { display: flex; gap: 10px; margin-top: 15px; }
.teces-btn-primary, .teces-btn-secondary { padding: 10px 20px; border: 2px solid var(--teces-primary); cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; text-align: center; }
.teces-btn-primary { background: var(--teces-primary); color: white; }
.teces-btn-primary:hover { background: var(--teces-secondary); color: white; }
.teces-btn-secondary { background: transparent; color: var(--teces-primary); }
.teces-btn-secondary:hover { background: var(--teces-primary); color: white; }
.teces-stats-row { display: flex; justify-content: space-around; margin-bottom: 20px; }
.teces-stat { text-align: center; padding: 15px; background: var(--teces-accent); flex: 1; margin: 0 5px; }
.teces-stat-num { display: block; font-size: 2em; font-weight: bold; color: var(--teces-primary); }
.teces-stat-label { font-size: 0.85em; color: var(--teces-text); text-transform: uppercase; }
.teces-progress-bar-container { margin-top: 15px; }
.teces-progress-bar { height: 8px; background: var(--teces-border); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.teces-progress-fill { height: 100%; background: linear-gradient(90deg, var(--teces-primary), var(--teces-secondary)); }
.teces-completed-list { margin-top: 20px; }
.teces-completed-list h3 { font-size: 1em; margin: 0 0 10px; color: var(--teces-text); }
.teces-completed-item, .teces-order-item { display: flex; justify-content: space-between; padding: 10px; background: var(--teces-light); margin-bottom: 8px; text-decoration: none; color: var(--teces-text); border-radius: 4px; }
.teces-completed-item:hover, .teces-order-item:hover { background: var(--teces-border); }
.teces-completed-date, .teces-order-date { color: var(--teces-muted); font-size: 0.9em; }
.teces-profile-actions { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.teces-message { padding: 15px; margin-bottom: 20px; border-radius: 4px; }
.teces-message-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.teces-message-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Courses Dropdown */
.courses-dropdown {
    position: relative;
    display: inline-block;
}

.courses-trigger {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.courses-trigger:hover {
    background-color: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.courses-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 250px;
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.courses-dropdown.active .courses-menu {
    display: block;
}

.courses-menu ul {
    margin: 0;
    padding: 10px 0;
    list-style: none;
}

.courses-menu li {
    border-bottom: 1px solid #eee;
    margin: 0;
    padding: 0;
}

.courses-menu li:last-child {
    border-bottom: none;
}

.courses-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.courses-menu a:hover {
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
}

.no-courses {
    padding: 15px 20px;
    color: #666;
    font-style: italic;
}

/* Sections Dropdown - Scrollable */
.sections-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 160px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.sections-dropdown li {
    border-bottom: 1px solid #eee;
    margin: 0;
    padding: 0;
}

.sections-dropdown li:last-child {
    border-bottom: none;
}

.section-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.section-link:hover:not(.locked) {
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
}

.section-link.locked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.section-link.completed {
    color: #28a745;
    font-weight: 600;
}

.lock-icon {
    margin-left: 8px;
    color: #f39c12;
    font-size: 12px;
}

/* Profile Orders List */
.teces-orders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.teces-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--teces-light);
    border: 1px solid var(--teces-border);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.teces-order-item:hover {
    background: var(--teces-border);
    transform: translateX(3px);
    text-decoration: none;
}

.teces-order-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.teces-order-name {
    font-weight: 600;
    color: var(--teces-text);
}

.teces-order-total {
    font-weight: 700;
    color: var(--teces-primary);
}

.teces-order-date {
    font-size: 13px;
    color: var(--teces-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .teces-library { grid-template-columns: 1fr; }
    .teces-controls { flex-direction: column; }
    .teces-control-btn { width: 100%; justify-content: center; }
    .teces-section-info { order: -1; width: 100%; margin: 0; }
    .teces-timer { font-size: 45px; }
    .teces-completion-title { font-size: 2em; }
    .teces-stats { grid-template-columns: 1fr; }
    .teces-price-row { flex-direction: column; align-items: flex-start; }
    .courses-menu { min-width: 200px; right: 0; left: auto; }
    .sections-dropdown { max-height: 250px; min-width: 140px; }
}
