/**
 * Main Stylesheet - Startpage
 */

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

:root {
    --primary-color: #4a9eff;
    --text-color: #fff;
    --text-secondary: #ccc;
    --bg-overlay: rgba(0, 0, 0, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --bg-image: url('/assets/img/uploads/trees.png');
    --blur-amount: 2px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-weight: 300;
    --hero-font-size: 3.5em;
    --link-font-size: 1em;
    --link-columns: 3;
}

body {
    font-family: var(--font-family);
    font-weight: var(--font-weight);
    color: var(--text-color);
    background: #000;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(var(--blur-amount));
    z-index: -1;
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header - Dezentes Design */
.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 25px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-info-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--header-font-size, 11px);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.header-separator {
    color: rgba(255, 255, 255, 0.4);
    margin: 0 2px;
}

.header-clock-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-clock-time {
    font-size: var(--header-clock-time-size, 13px);
    font-weight: var(--font-weight, 300);
    letter-spacing: 0.3px;
}

.header-clock-date {
    font-size: var(--header-clock-date-size, 11px);
    font-weight: var(--font-weight, 300);
    text-transform: capitalize;
}

.header-label {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

.header-value {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.header-username-clickable {
    cursor: pointer;
    transition: color 0.2s;
}

.header-username-clickable:hover {
    color: rgba(255, 255, 255, 0.9);
}

.header-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 300;
}

.header-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.header-link-disabled {
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.header-login-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 300;
    transition: all 0.2s;
    font-family: inherit;
}

.header-login-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

/* Header/Footer Divider */
.header-divider,
.footer-divider {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--primary-color);
    z-index: 99;
}

.header-divider {
    top: 50px;
}

.footer-divider {
    bottom: 50px;
}

.username {
    color: var(--text-secondary);
}

.admin-link,
.logout-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.admin-link:hover,
.logout-link:hover {
    color: var(--text-color);
}

.login-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 300;
    transition: all 0.2s;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 70px 20px 70px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 60px;
}

.hero-title {
    font-size: var(--hero-font-size);
    font-weight: var(--font-weight);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.hero-subtitle {
    font-size: 1.2em;
    font-weight: 300;
    color: var(--text-secondary);
}

/* Link Groups */
.link-groups {
    display: grid;
    grid-template-columns: repeat(var(--link-columns), 1fr);
    gap: 40px;
    max-width: 1200px;
    width: 100%;
    margin-bottom: 60px;
}

.link-group {
    text-align: center;
}

.link-group-title {
    font-size: 1.5em;
    font-weight: 300;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.link-group-divider {
    width: 60px;
    height: 1px;
    background: var(--border-color);
    margin: 0 auto 20px;
}

.link-list {
    list-style: none;
}

.link-list li {
    margin-bottom: 12px;
}

.link-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: var(--font-weight);
    font-size: var(--link-font-size);
    transition: all 0.2s;
    display: inline-block;
}

.link-item:hover {
    color: var(--text-color);
    text-decoration: underline;
    transform: translateX(5px);
}

/* Widgets */
.widgets-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    width: 100%;
}

.widget-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.widget-error {
    color: #d32f2f;
    padding: 10px;
    background: rgba(211, 47, 47, 0.1);
    border-radius: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--text-color);
}

.modal-content h2 {
    margin-bottom: 20px;
    font-weight: 300;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: var(--text-color);
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-color);
    opacity: 0.9;
    filter: brightness(0.9);
}

.error-message {
    color: #d32f2f;
    font-size: 14px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(211, 47, 47, 0.1);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 968px) {
    .link-groups {
        grid-template-columns: 1fr !important;
        gap: 40px;
    }
    
    .hero-title {
        font-size: 2.5em;
    }
    
    .widgets-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .link-groups {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2em;
    }
    
    .hero-subtitle {
        font-size: 1em;
    }
    
    .link-group-title {
        font-size: 1.2em;
    }
    
    .header {
        padding: 10px 15px;
    }
}

/* Footer - Dezentes Design (wie Header) */
.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 25px;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    background: transparent; /* Kein Hintergrund */
}

.footer-left,
.footer-center,
.footer-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.footer-center {
    flex: 1;
    justify-content: center;
}

/* Chat Button */
.chat-button-wrapper {
    display: flex;
    align-items: center;
}

.chat-button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 300;
    font-family: var(--font-family);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    transition: color 0.2s;
}

.chat-button:hover {
    color: rgba(255, 255, 255, 0.9);
}

.chat-button-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    display: inline-block;
    flex-shrink: 0;
}

.chat-button-text {
    font-weight: 300;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Header - 2 Zeilen auf Mobile */
    .header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 15px;
        gap: 8px;
        min-height: auto;
    }
    
    .header-left,
    .header-right {
        width: 100%;
    }
    
    .header-info-line {
        flex-wrap: wrap;
        gap: 4px;
        font-size: 10px;
        line-height: 1.4;
    }
    
    .header-separator {
        margin: 0 1px;
    }
    
    .header-clock-time {
        font-size: 12px;
    }
    
    .header-clock-date {
        font-size: 10px;
    }
    
    .header-link {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .header-divider {
        top: auto;
        bottom: auto;
    }
    
    /* Main Content - mehr Padding oben für 2-Zeilen-Header */
    .main-content {
        padding-top: 100px;
        padding-bottom: 80px;
    }
    
    /* Footer - fixiert am unteren Rand auf Mobile */
    .footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
        padding: 12px 15px;
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); /* Platz für Audio-Player + Safe Area */
        position: fixed;
        bottom: -10px; /* Weiter nach unten, direkt am Bildschirmrand */
        left: 0;
        right: 0;
        background: transparent; /* Kein schwarzer Hintergrund */
        backdrop-filter: none; /* Kein Blur */
        border-top: none; /* Keine obere Linie */
        z-index: 100;
        font-size: 10px;
    }
    
    .footer-left,
    .footer-center,
    .footer-right {
        width: 100%;
    }
    
    .footer-center {
        justify-content: flex-start;
    }
    
    .footer .header-info-line {
        flex-wrap: wrap;
        gap: 4px;
        font-size: 10px;
    }
    
    .footer-divider {
        display: none; /* Verstecke Divider auf Mobile */
    }
    
    /* Container - mehr Padding unten für fixierten Footer */
    .container {
        padding-bottom: 120px;
    }
    
    /* Main Content - mehr Padding unten */
    .main-content {
        padding-top: 120px;
        padding-bottom: 120px;
    }
}

/* Globaler Audio-Player (fixiert am unteren Rand) */
.global-audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--primary-color, #4a9eff);
    padding: 12px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    animation: slideUpAudio 0.3s ease;
}

@keyframes slideUpAudio {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.global-audio-player-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.global-audio-player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
}

.global-audio-player-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.global-audio-player-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.global-audio-player-title {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.global-audio-player-source {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-audio-player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.global-audio-player-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color, #4a9eff);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.global-audio-player-btn:hover {
    background: var(--primary-color-hover, #3a8eef);
    transform: scale(1.05);
}

.global-audio-player-btn:active {
    transform: scale(0.95);
}

.global-audio-player-close {
    background: rgba(255, 255, 255, 0.1);
    font-size: 20px;
    line-height: 1;
}

.global-audio-player-close:hover {
    background: rgba(211, 47, 47, 0.8);
}

.global-audio-player-progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.global-audio-player-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.global-audio-player-progress {
    height: 100%;
    background: var(--primary-color, #4a9eff);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.global-audio-player-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.global-audio-player-current {
    font-weight: 400;
}

.global-audio-player-separator {
    color: rgba(255, 255, 255, 0.4);
}

.global-audio-player-duration {
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .global-audio-player {
        padding: 10px 15px;
    }
    
    .global-audio-player-content {
        gap: 10px;
    }
    
    .global-audio-player-title {
        max-width: 120px;
        font-size: 12px;
    }
    
    .global-audio-player-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .global-audio-player-time {
        font-size: 10px;
    }
}
