/* =========================================
   Base & Reset
   ========================================= */
:root {
    --bg-color: #0a0a1a;
    --glass-bg: rgba(30, 30, 46, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-gradient: linear-gradient(135deg, #ffffff 0%, #a5a5a5 100%);
    --ios-blue: #298eff;
    --android-green: #3DDC84;
    --text-main: #f0f0f0;
    --text-sec: #b0b0b0;
    --radius-l: 24px;
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, .nav-tab {
    font-family: 'Nunito', sans-serif;
}

/* Background Canvas */
#bg-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
}

/* =========================================
   GLOBAL LOADER
   ========================================= */
#global-loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #0a0a1a;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

/* Klasse zum Ausblenden */
#global-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.loader-text {
    color: var(--text-sec);
    font-size: 0.9rem;
    letter-spacing: 1px;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }


/* =========================================
   Layout & Header
   ========================================= */
.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hub-header {
    margin: 40px 0 30px;
    text-align: center;
    width: 100%;
}

.logo-container h1 {
    font-size: 4rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 5px;
    letter-spacing: -1px;
}

.badge {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-sec);
    margin-bottom: 30px;
}

/* =========================================
   Navigation Tabs
   ========================================= */
.nav-tabs {
    display: inline-flex;
    background: rgba(255,255,255,0.05);
    padding: 5px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    gap: 5px;
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-sec);
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tab:hover { color: #fff; }

.nav-tab.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Content Switching */
.content-container { width: 100%; min-height: 400px; }
.tab-content { display: none; animation: fadeIn 0.5s ease; width: 100%; }
.tab-content.active { display: block; }

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

.loader-msg {
    text-align: center; color: var(--text-sec); 
    grid-column: 1 / -1; padding: 40px;
}

.category-header h2 {
    font-size: 2rem;
    margin: 30px 0 20px 0;
    color: #fff;
    text-align: left;
    padding-left: 10px;
    border-left: 4px solid rgba(255,255,255,0.5);
}

.section-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 40px 0;
    width: 100%;
}

/* =========================================
   SITES GRID
   ========================================= */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding-bottom: 20px;
}

.tile {
    background: var(--glass-bg);
    border-radius: var(--radius-l);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s;
    height: 100%;
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    background: rgba(50, 50, 80, 0.6);
}

.tile-image-wrapper {
    height: 160px; width: 100%; overflow: hidden;
    background: rgba(0,0,0,0.2);
    position: relative;
}

.tile-image {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s ease;
}
.tile:hover .tile-image { transform: scale(1.05); }

.tile-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }

.tile-title {
    font-size: 1.25rem; font-weight: 700; color: #fff;
    font-family: 'Nunito', sans-serif; margin-bottom: 5px;
}

.tile-subtitle {
    font-size: 0.9rem; color: var(--text-sec); line-height: 1.4;
}

/* =========================================
   APPS GRID
   ========================================= */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.app-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: 24px;
    display: flex;
    gap: 20px;
    transition: all 0.3s ease;
}

.app-card:hover {
    transform: translateY(-5px);
    background: rgba(50, 50, 80, 0.6);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.app-icon {
    width: 80px; height: 80px; border-radius: 18px;
    object-fit: cover; background: #000; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.app-info { flex: 1; display: flex; flex-direction: column; }
.app-info h3 { font-size: 1.3rem; margin-bottom: 5px; color: #fff; }
.app-info p {
    font-size: 0.9rem; color: var(--text-sec); line-height: 1.4;
    margin-bottom: 15px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.btn-group { display: flex; gap: 10px; margin-top: auto; }

.app-btn {
    flex: 1; text-decoration: none; padding: 10px; border-radius: 12px;
    font-size: 0.85rem; font-weight: 600; text-align: center;
    border: 1px solid transparent; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}

.btn-ios { background: rgba(41, 142, 255, 0.1); color: #4da3ff; border-color: rgba(41, 142, 255, 0.2); }
.btn-ios:hover:not(.disabled) { background: var(--ios-blue); color: #fff; }

.btn-android { background: rgba(61, 220, 132, 0.1); color: #3ddc84; border-color: rgba(61, 220, 132, 0.2); }
.btn-android:hover:not(.disabled) { background: var(--android-green); color: #000; }

.app-btn.disabled { opacity: 0.3; cursor: default; filter: grayscale(1); border-color: rgba(255,255,255,0.05); }

/* =========================================
   Footer & Mobile
   ========================================= */
.footer { margin-top: 40px; text-align: center; width: 100%; }
.footer-content {
    display: inline-block; background: rgba(255,255,255,0.03);
    padding: 15px 30px; border-radius: 20px; border: 1px solid var(--glass-border);
}
.footer-links { margin-bottom: 10px; }
.footer-link { color: var(--text-sec); text-decoration: none; margin: 0 5px; transition: color 0.2s; }
.footer-link:hover { color: #fff; }
.footer-copyright { font-size: 0.85rem; color: rgba(255,255,255,0.4); }

@media (max-width: 768px) {
    .logo-container h1 { font-size: 3rem; }
    .apps-grid, .tiles-grid { grid-template-columns: 1fr; }
    .nav-tab { padding: 8px 16px; font-size: 1rem; }
    .category-header h2 { font-size: 1.5rem; margin-left: 10px; }
}