/* --- style.css - V2.1 FINAL --- */

/* Import der Google Font */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

:root {
    /* Farbpalette */
    --bg-dark: #242933;
    --bg-medium: #2e3440;
    --bg-light: #3b4252;
    --accent-blue: #88c0d0;
    --accent-green: #a3be8c;
    --accent-red: #bf616a;
    --accent-gold: #ebcb8b;
    --text-light: #eceff4;
    /* Gradienten für Buttons */
    --button-gradient-top: #5e81ac;
    --button-gradient-bottom: #4c566a;
}

body {
    font-family: 'Roboto', sans-serif;
    /* Dunkler Hintergrund mit leichter Textur */
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05) 0%, transparent 60%),
        repeating-linear-gradient(45deg, rgba(0,0,0,0.05) 0px, rgba(0,0,0,0.05) 2px, transparent 2px, transparent 10px);
    color: var(--text-light);
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* === FLOATING TEXTS (+1 Effekte) === */
#floating-text-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; /* Klicks gehen durch */
    z-index: 1000;
    overflow: hidden;
}

.floating-text {
    position: absolute;
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--text-light);
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
    animation: floatUp 1.5s ease-out forwards;
    user-select: none;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-100px) scale(1.2); }
}

/* === LINKER BEREICH === */
#left-section {
    width: 40%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to right, rgba(0,0,0,0.3), rgba(0,0,0,0.1));
    border-right: 8px solid rgba(0, 0, 0, 0.5);
    box-shadow: inset -10px 0 20px rgba(0,0,0,0.5);
    position: relative;
}

.score-header {
    text-align: center;
    padding: 30px;
    background: rgba(0,0,0,0.4);
    border-bottom: 3px solid rgba(0,0,0,0.6);
}

.bakery-name { font-size: 1.2rem; color: #aaa; margin-bottom: 10px; letter-spacing: 1px;}
#score { font-size: 3rem; font-weight: 700; color: var(--accent-blue); text-shadow: 0 3px 6px rgba(0,0,0,0.7); }
#cps-display { font-size: 1.1rem; color: var(--accent-green); margin-top: 5px;}

#mainClickObject-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px; /* Für 3D Effekte */
}

#mainClickObject {
    width: 320px; height: 320px;
    cursor: pointer;
    transition: all 0.05s ease-in-out;
    /* HIER DEIN GEBÄUDE BILD PFAD EINTRAGEN */
    background-image: url('textures/building.png'); 
    /* Fallback falls Bild fehlt: */
    background-color: var(--bg-light);
    background-size: contain; background-repeat: no-repeat; background-position: center;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
    border-radius: 20px;
}
#mainClickObject:active { transform: scale(0.95) rotateX(5deg); filter: brightness(1.1); }


/* === RECHTER BEREICH (MIT TABS) === */
#right-section {
    flex: 1;
    background: var(--bg-medium);
    display: flex;
    flex-direction: column;
    box-shadow: inset 10px 0 30px rgba(0,0,0,0.3);
    overflow: hidden; /* Wichtig für Tabs */
}

/* Navigations Header */
.shop-header-nav {
    display: flex;
    background: rgba(0,0,0,0.4);
    border-bottom: 3px solid rgba(0,0,0,0.5);
    flex-shrink: 0; /* Darf nicht schrumpfen */
}

.nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px;
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent; /* Platzhalter für aktiven Status */
    opacity: 0.6;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.05);
    opacity: 1;
}

/* Aktiver Tab Style */
.nav-btn.active {
    background: rgba(255,255,255,0.1);
    border-bottom-color: var(--accent-blue);
    color: var(--accent-blue);
    opacity: 1;
}

/* Tab Inhalt Container (Shop & Optionen) */
.tab-content {
    flex: 1;
    overflow-y: auto; /* Scrollbar nur im Inhalt */
    padding: 20px;
    /* Schöne Scrollbars für Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--bg-light) var(--bg-dark);
    animation: fadeIn 0.3s ease-out;
}

/* Schöne Scrollbars für Webkit (Chrome, Edge, Safari) */
.tab-content::-webkit-scrollbar { width: 10px; }
.tab-content::-webkit-scrollbar-track { background: var(--bg-dark); }
.tab-content::-webkit-scrollbar-thumb { background-color: var(--bg-light); border-radius: 10px; border: 2px solid var(--bg-dark); }

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

/* === SHOP ITEMS & BOXEN === */
.upgrade-wrapper {
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s;
}
/* Versteckt Items, die noch nicht freigeschaltet sind */
.upgrade-wrapper.locked { display: none; }

/* Der Kauf-Button (3D Look) */
.upgrade-item {
    display: flex; align-items: center;
    /* 3D Gradient Verlauf */
    background: linear-gradient(to bottom, var(--bg-light), var(--bg-medium));
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: 3px solid rgba(0,0,0,0.4);
    padding: 12px;
    cursor: pointer; user-select: none;
    /* Radius wird per JS angepasst, wenn Box aktiv ist */
    border-radius: 12px; 
    position: relative;
    transition: all 0.1s;
}
.upgrade-item:hover { background: linear-gradient(to bottom, #434c5e, #3b4252); transform: translateY(-1px);}
.upgrade-item:active { transform: translateY(2px); border-bottom-width: 1px; }
/* Disabled State (zu teuer) */
.upgrade-item.disabled { 
    opacity: 0.7; cursor: not-allowed; filter: grayscale(60%); 
    background: var(--bg-dark);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.upgrade-icon { 
    width: 64px; height: 64px; margin-right: 15px; background: rgba(0,0,0,0.3); 
    border-radius: 8px; object-fit: cover; border: 2px solid rgba(255,255,255,0.1); box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.upgrade-details { flex: 1; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.upgrade-name { font-weight: bold; color: var(--accent-blue); font-size: 1.15rem;}
.upgrade-desc { font-size:0.85rem; color:#ccc; font-style: italic; margin-bottom: 5px;}
.upgrade-cost { color: var(--accent-red); font-weight: bold; }
.upgrade-cps { color: var(--accent-green); font-size: 0.9rem; }
.upgrade-count { font-size: 2.5rem; font-weight: 700; color: rgba(0,0,0,0.3); margin-left: 15px; }

/* DIE TANZ-BOX (Große Version) */
.dance-box {
    display: none; /* Wird per JS auf 'flex' gesetzt */
    height: 180px;
    background: rgba(0,0,0,0.5);
    /* Ein Holzboden-Muster für die Bühne */
    background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 20px);
    border: 3px solid rgba(0,0,0,0.6);
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: inset 0 10px 30px rgba(0,0,0,0.5);
    
    /* Flex Einstellungen für Überlappung */
    align-items: flex-end; 
    justify-content: center;
    flex-wrap: wrap-reverse; /* Damit sie sich von unten füllen und stapeln */
    align-content: flex-start;
    
    padding: 10px;
    overflow: hidden;
}

/* Die Mini-Figuren */
.dance-box .sprite {
    width: 120px;
    height: auto;
    image-rendering: pixelated;
    /* Sanfteres Wippen */
    animation: gentleBob 2s infinite ease-in-out;
    /* Stärkere Überlappung damit viele reinpassen */
    margin-left: -35px; 
    margin-right: -35px;
    margin-bottom: -10px; /* Näher zusammenrücken */
    position: relative;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.7));
}

@keyframes gentleBob {
    0%, 100% { transform: translateY(0); }
    /* Weniger Hub (nur 10px) */
    50% { transform: translateY(-10px); } 
}

/* === OPTIONEN STYLES === */
.option-section {
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid rgba(255,255,255,0.05);
}

.option-section h3 {
    margin-top: 0;
    color: var(--accent-gold);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.option-section h4 {
    margin-bottom: 5px;
    color: var(--accent-blue);
}

.option-row {
    margin-bottom: 15px;
}

/* Inputs und Textareas */
input[type="text"], textarea {
    width: 100%;
    padding: 10px;
    background: var(--bg-dark);
    border: 1px solid var(--bg-light);
    color: var(--text-light);
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    box-sizing: border-box; /* Wichtig damit Padding nicht die Breite sprengt */
    font-size: 1rem;
}
input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

textarea {
    height: 80px;
    resize: vertical;
    font-family: monospace; /* Damit der Code lesbar ist */
    font-size: 0.9rem;
    word-break: break-all; /* Damit lange Codes umbrechen */
    margin-bottom: 10px;
    background: rgba(0,0,0,0.3);
}

/* Allgemeiner Button Style */
.btn {
    background: var(--button-gradient-top);
    color: white; border: none; padding: 10px 15px; border-radius: 5px; cursor: pointer; font-weight: bold;
    transition: all 0.1s;
    border-bottom: 2px solid rgba(0,0,0,0.3);
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(2px); border-bottom-width: 0; }

.btn-wide { width: 100%; margin-bottom: 10px; padding: 12px;}
.btn-caution { background: #d08770; }

/* Danger Zone */
.danger-zone {
    border-color: var(--accent-red);
    background: rgba(191, 97, 106, 0.1);
}
.btn-reset { background: var(--accent-red); }

/* UI Elemente (Notification) */
#notification {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: var(--accent-green); color: var(--bg-dark); padding: 10px 25px; border-radius: 30px;
    opacity: 0; transition: opacity 0.5s; pointer-events: none; font-weight: bold; z-index: 100;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}