/* Performance-optimierte Gaming-Portal Styles */
:root {
    --primary-color: #6441a5;
    --primary-dark: #392e5c;
    --accent-color: #ff6b35;
    --accent-dark: #e55a2b;
    --background-color: #18181b;
    --surface-color: #1f1f23;
    --text-primary: #f5f5f5;
    --text-secondary: #d0d0d0;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --blur-strength: 8px;
    --animation-speed: 0.3s;
}

/* Performance-Optimierungen */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    opacity: 0.1;
    animation: bgShift 20s ease-in-out infinite;
}

@keyframes bgShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(2deg); }
}

/* Glass Morphism Components */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-intense {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 0;
    background: rgba(24, 24, 27, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-btn {
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--animation-speed) ease;
    font-size: 0.9rem;
    cursor: pointer;
}

.nav-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 65, 165, 0.3);
}

.nav-btn.admin {
    background: linear-gradient(45deg, var(--accent-color), var(--accent-dark));
}

.nav-btn.logout {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.nav-btn.logout:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Login Page - New Layout */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    margin-bottom: 40px;
}

.login-form {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.streams-section {
    flex: 1;
}

.streams-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.streams-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.twitch-stream {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: all var(--animation-speed) ease;
    min-height: 300px;
}

.twitch-stream:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 15px 35px rgba(255, 107, 53, 0.2);
}

.stream-header {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    padding: 10px 15px;
    text-align: center;
}

.stream-label {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.twitch-embed {
    width: 100%;
    height: 250px;
    background: #0e0e10;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.twitch-embed::before {
    content: "🎮\AStream lädt...";
    white-space: pre;
    color: #9ca3af;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
}

.twitch-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
}

.twitch-embed:has(iframe)::before {
    display: none;
}

/* Form Elements */
.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--animation-speed) ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(100, 65, 165, 0.2);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--animation-speed) ease;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    color: white;
    margin-bottom: 15px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(100, 65, 165, 0.4);
}

.btn-twitch {
    background: linear-gradient(45deg, #9146ff, #772ce8);
    color: white;
}

.btn-twitch:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(145, 70, 255, 0.4);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .streams-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .twitch-stream {
        min-height: 200px;
    }
    
    .twitch-embed {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }
    
    .login-section {
        min-height: 50vh;
        margin-bottom: 30px;
    }
    
    .login-form {
        padding: 30px 20px;
        margin: 0 10px;
    }
    
    .streams-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .streams-container {
        gap: 15px;
    }
    
    .twitch-embed {
        height: 160px;
    }
}

/* Tablet Layout */
@media (max-width: 768px) and (min-width: 481px) {
    .streams-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .twitch-stream:last-child {
        grid-column: 1 / -1;
        max-width: 50%;
        margin: 0 auto;
    }
}

/* Dashboard */
.dashboard {
    padding-top: 100px;
    min-height: 100vh;
}

.welcome-banner {
    text-align: center;
    padding: 40px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(100, 65, 165, 0.3);
}

.welcome-banner h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-banner p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.app-card {
    padding: 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: all var(--animation-speed) ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.1), transparent);
    transition: left 0.6s ease;
}

.app-card:hover::before {
    left: 100%;
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(100, 65, 165, 0.2);
    border-color: var(--accent-color);
}

.app-icon {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.app-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.app-card p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Error/Success Messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --blur-strength: 4px;
    }
    
    .login-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 10px;
    }
    
    .login-form {
        grid-column: 1;
        grid-row: 1;
        padding: 30px 20px;
    }
    
    .twitch-stream {
        display: none;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .welcome-banner h1 {
        font-size: 2rem;
    }
}

/* Performance-Klassen für schwächere Geräte */
.low-performance .animated-bg {
    animation: none;
    opacity: 0.05;
}

.low-performance .glass {
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.1);
}

.low-performance .app-card::before {
    display: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}