/* 
   Atlas-Civ-Clicker | Design System 
   Fokus: Premium Aesthetics, Glassmorphism & Responsiveness
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    /* Color Palette */
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Resource Colors */
    --color-holz: #d97706;
    --color-stein: #64748b;
    --color-kohle: #1e293b;
    --color-kupfer: #ca8a04;
    --color-eisen: #475569;
    --color-gold: #f59e0b;
    
    /* Effects */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 20px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

header {
    margin-bottom: 2rem;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.game-nav {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-btn.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

/* Resource Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Resource Card */
.resource-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0; /* Geändert für Banner */
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.building-banner {
    width: 100%;
    height: 140px;
    background: rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.building-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.resource-card:hover .building-banner img {
    transform: scale(1.1);
}

.level-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--color-gold);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.research-indicator {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(4px);
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 10;
}

.research-indicator.active {
    opacity: 1;
    transform: scale(1);
    animation: researchPulse 2s infinite alternate;
}

/* Login Overlay Styles (v1.1.0) */
.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: slideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.login-form input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.login-form input:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

.login-form input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.research-indicator .material-symbols-outlined {
    font-size: 1.2rem;
}

@keyframes researchPulse {
    from { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
    to { box-shadow: 0 0 25px rgba(245, 158, 11, 0.6); }
}

.building-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, #1e293b, #0f172a);
}

.building-placeholder span {
    font-size: 3rem;
    opacity: 0.5;
}

.resource-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

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

.resource-icon {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
}

.active-building .building-banner img {
    animation: prodPulse 2s infinite ease-in-out;
}

@keyframes prodPulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.2); }
    100% { transform: scale(1); filter: brightness(1); }
}

.amount {
    font-size: 2rem;
    font-weight: 700;
}

.resource-name {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

/* Action Button */
.gather-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: white;
    padding: 1rem;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: auto;
    opacity: 0.7; /* Standardmäßig dezenter */
    border-style: dashed;
}

.gather-btn:hover {
    opacity: 1;
    border-style: solid;
}

.upgrade-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--color-gold), #fbbf24);
    border: none;
    color: var(--bg-color);
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.upgrade-btn:active {
    transform: translateY(0);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-item {
    background: rgba(255,255,255,0.03);
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    display: block;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
}

.gather-btn:active {
    transform: scale(0.95);
}

.btn-holz:hover { background: var(--color-holz); }
.btn-stein:hover { background: var(--color-stein); }
.btn-kohle:hover { background: var(--color-kohle); }
.btn-kupfer:hover { background: var(--color-kupfer); }
.btn-eisen:hover { background: var(--color-eisen); }
.btn-gold:hover { background: var(--color-gold); }

/* Inline Error Messages */
.error-msg {
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    margin-top: 0.5rem;
    height: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.error-msg.visible {
    opacity: 1;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* View Container */
.view-container {
    animation: fadeIn 0.4s ease-out;
}

.view-header {
    margin-bottom: 2rem;
    text-align: center;
}

/* Skill Tree Layout (Linear) */
.skill-tree-container {
    position: relative;
    padding: 3rem 1rem;
    min-height: 400px;
}

.skill-tree-grid {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4rem;
    position: relative;
    z-index: 2;
}

.research-node {
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    width: 180px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.research-node.available {
    border-color: var(--text-secondary);
}

.research-node.unlocked {
    border-color: var(--color-gold);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.research-node.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.node-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.node-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.node-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.node-stats {
    font-size: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.buy-res-btn {
    width: 100%;
    padding: 0.5rem;
    background: var(--accent-secondary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.buy-res-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

/* Pulse Animation for unlocked nodes */
.research-node.unlocked .node-icon {
    animation: glowPulse 2s infinite alternate;
}

@keyframes glowPulse {
    from { box-shadow: 0 0 5px rgba(255,255,255,0.2); }
    to { box-shadow: 0 0 20px rgba(255,255,255,0.5); }
}

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

/* Footer & Changelog */
footer a {
    color: var(--color-gold);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

footer a:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 90%;
    max-width: 650px;
    max-height: 80vh;
    padding: 2rem;
    position: relative;
    overflow-y: auto;
    box-shadow: var(--glass-shadow);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
}

.modal-close:hover {
    color: white;
}

.changelog-text {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Floating Text Animation */
.floating-text {
    position: absolute;
    color: white;
    font-weight: 800;
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    z-index: 100;
}

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

/* Mobile Adjustments */
@media (max-width: 600px) {
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
}
