/* Trainingsportal - Main Stylesheet */
/* doTERRA Color Palette and Elegant Design */

:root {
    --primary: #d18ca7;
    --primary-dark: #b8758c;
    --primary-light: #e6b3c8;
    --primary-lighter: #f4dce6;
    --secondary: #8ca7d1;
    --success: #5cb85c;
    --warning: #f0ad4e;
    --danger: #d9534f;
    --info: #5bc0de;
    --dark: #2c3e50;
    --gray: #7f8c8d;
    --light: #ecf0f1;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2.5rem;
    width: 100%;
    box-sizing: border-box;
}

.container-fluid {
    width: 100%;
    padding: 0 2.5rem;
    box-sizing: border-box;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
}

.header .container,
.header .container-fluid {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
    box-sizing: border-box;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--white);
    font-size: 1.2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Navigation */
.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    color: var(--dark);
}

.user-role {
    font-size: 0.875rem;
    color: var(--gray);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

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

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

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 2px solid var(--light);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 0;
}

.card-subtitle {
    color: var(--gray);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--light);
    border-radius: var(--radius);
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(209, 140, 167, 0.1);
}

.form-control.error {
    border-color: var(--danger);
}

.form-text {
    font-size: 0.875rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

.form-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--white) 100%);
}

.login-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--white);
}

.login-title {
    text-align: center;
    color: var(--primary);
    margin-bottom: 2rem;
}

/* Progress Bar */
.progress-container {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

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

.progress-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark);
}

.progress-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-bar {
    background: var(--light);
    height: 32px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    height: 100%;
    border-radius: 16px;
    transition: width 0.5s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

/* Lesson Cards */
.lesson-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.lesson-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
    border-left: 5px solid var(--light);
}

.lesson-card.completed {
    border-left-color: var(--success);
}

.lesson-card.current {
    border-left-color: var(--primary);
    background: var(--primary-lighter);
}

.lesson-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.lesson-card:not(.locked):hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.lesson-number {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    flex-shrink: 0;
}

.lesson-card.completed .lesson-number {
    background: var(--success);
}

.lesson-content {
    flex: 1;
}

.lesson-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.lesson-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-completed {
    background: var(--success);
    color: var(--white);
}

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

.status-locked {
    background: var(--gray);
    color: var(--white);
}

/* Timer Display */
.timer-container {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.timer-label {
    font-size: 1rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.timer-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.timer-paused {
    color: var(--warning);
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--primary-lighter);
    color: var(--dark);
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--primary);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light);
}

.table tbody tr:hover {
    background: var(--primary-lighter);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--light);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.alert-danger {
    background: var(--danger);
    color: var(--white);
}

.alert-warning {
    background: var(--warning);
    color: var(--white);
}

.alert-info {
    background: var(--info);
    color: var(--white);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 20px;
    background: var(--primary);
    color: var(--white);
}

.badge-success {
    background: var(--success);
}

.badge-danger {
    background: var(--danger);
}

.badge-warning {
    background: var(--warning);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    body {
        overflow-x: hidden;
    }

    .container {
        padding: 0 1rem;
        max-width: 100%;
    }

    .header {
        padding: 0.75rem 0;
        overflow-x: hidden;
    }

    .header .container,
    .header .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        max-width: 100%;
    }

    .header-content {
        flex-wrap: nowrap;
        gap: 0.5rem;
        width: 100%;
        max-width: 100%;
    }

    .logo {
        gap: 8px;
        flex-shrink: 1;
        min-width: 0;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .logo-text {
        font-size: 0.95rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-menu {
        flex-wrap: nowrap;
        gap: 0.5rem;
        justify-content: flex-end;
        flex-shrink: 0;
    }

    .user-info {
        display: none;
    }

    .btn-sm {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .card {
        padding: 1.5rem;
    }

    .login-box {
        padding: 2rem;
    }

    .lesson-card {
        flex-direction: column;
        text-align: center;
    }

    .timer-display {
        font-size: 2rem;
    }

    .table {
        font-size: 0.875rem;
    }

    .modal {
        width: 95%;
    }
}

/* Hide logout button only on mobile portrait mode */
@media (max-width: 768px) and (orientation: portrait) {
    .user-menu a[href="logout.php"],
    a.btn[href="logout.php"],
    a[href="logout.php"].btn-outline {
        display: none !important;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.875rem;
        overflow-x: hidden;
    }

    .container {
        padding: 0 0.5rem !important;
    }

    .header .container,
    .header .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .header-content {
        width: 100% !important;
        gap: 0.4rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .user-menu {
        gap: 0.4rem;
    }

    .btn-sm {
        padding: 0.35rem 0.6rem;
        font-size: 0.7rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .form-control {
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 390px) {
    .header .container,
    .header .container-fluid {
        padding-left: 0.4rem !important;
        padding-right: 0.4rem !important;
    }

    .header-content {
        gap: 0.3rem !important;
    }

    .logo-icon {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .btn-sm {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-in {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
