/* ===================================================================
   Verdant Empire - Game Stylesheet
   Medieval fantasy aesthetic με πράσινους/χρυσούς τόνους
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Text:wght@400;600&display=swap');

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

:root {
    /* Χρωματική παλέτα - Verdant Empire */
    --color-bg-dark: #1a2818;
    --color-forest: #2d4a2b;
    --color-moss: #4a6741;
    --color-gold: #d4af37;
    --color-gold-light: #f4d03f;
    --color-parchment: #f5e6d3;
    --color-parchment-dark: #c9b896;
    --color-wood: #6b4423;
    --color-wood-dark: #3d2817;
    --color-blood: #8b2c2c;
    --color-text-light: #f5e6d3;
    --color-text-dark: #2d2418;

    /* Status colors */
    --color-health: #c0392b;
    --color-hunger: #e67e22;
    --color-stamina: #3498db;

    /* Fonts */
    --font-display: 'Cinzel', serif;
    --font-body: 'Crimson Text', serif;
}

body {
    background: var(--color-bg-dark);
    color: var(--color-text-light);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ============ CANVAS ============ */
#gameCanvas {
    width: 100vw;
    height: 100vh;
    display: block;
    touch-action: none;
    outline: none;
}

/* ============ LOADING SCREEN ============ */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2818 0%, #2d4a2b 50%, #1a2818 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease;
}

#loadingScreen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
}

.game-title {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-gold);
    letter-spacing: 0.3em;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5),
                 0 4px 8px rgba(0, 0, 0, 0.8);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 0 30px rgba(212, 175, 55, 0.5), 0 4px 8px rgba(0, 0, 0, 0.8); }
    to { text-shadow: 0 0 60px rgba(212, 175, 55, 0.9), 0 4px 8px rgba(0, 0, 0, 0.8); }
}

.game-subtitle {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--color-parchment);
    font-size: 1.3rem;
    margin-bottom: 3rem;
}

.loading-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--color-gold);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--color-gold);
}

.loading-tip {
    color: var(--color-parchment-dark);
    font-size: 1rem;
    font-style: italic;
}

/* ============ HUD GENERAL ============ */
.hud-element {
    position: fixed;
    z-index: 100;
    pointer-events: auto;
}

.hud-element.hidden {
    display: none;
}

/* ============ TOP HUD - Resource Bar ============ */
#topHUD {
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    background: linear-gradient(180deg,
        rgba(26, 40, 24, 0.95) 0%,
        rgba(26, 40, 24, 0.7) 80%,
        rgba(26, 40, 24, 0) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.resource-bar {
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.resource {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(180deg, var(--color-wood) 0%, var(--color-wood-dark) 100%);
    border: 2px solid var(--color-gold);
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5),
                inset 0 1px 0 rgba(255,255,255,0.1);
    transition: transform 0.2s;
}

.resource:hover {
    transform: translateY(-2px);
}

.resource-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.resource-amount {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-gold-light);
    min-width: 30px;
    text-align: right;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    pointer-events: auto;
}

.player-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--color-gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.day-cycle {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-parchment);
    font-style: italic;
}

/* ============ STATUS HUD - Bottom Left ============ */
#statusHUD {
    bottom: 20px;
    left: 20px;
    width: 280px;
}

.status-bar {
    background: linear-gradient(180deg, rgba(45, 24, 16, 0.92) 0%, rgba(26, 16, 8, 0.92) 100%);
    border: 2px solid var(--color-gold);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.6);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-label {
    font-family: var(--font-body);
    font-size: 0.9rem;
    min-width: 90px;
    color: var(--color-parchment);
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--color-wood);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
}

.progress-fill.health { background: linear-gradient(90deg, #8b2c2c, #c0392b); }
.progress-fill.hunger { background: linear-gradient(90deg, #a04a1f, #e67e22); }
.progress-fill.stamina { background: linear-gradient(90deg, #1e5f8c, #3498db); }

/* ============ SELECTION HUD - Bottom Right ============ */
#selectionHUD {
    bottom: 20px;
    right: 20px;
    width: 320px;
}

.selection-panel {
    background: linear-gradient(180deg, rgba(45, 24, 16, 0.92) 0%, rgba(26, 16, 8, 0.92) 100%);
    border: 2px solid var(--color-gold);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.6);
}

#selectedName {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--color-gold);
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

#selectedDescription {
    font-size: 0.95rem;
    color: var(--color-parchment);
    margin-bottom: 12px;
    font-style: italic;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 14px;
    background: linear-gradient(180deg, var(--color-moss), var(--color-forest));
    border: 1px solid var(--color-gold);
    border-radius: 4px;
    color: var(--color-parchment);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: linear-gradient(180deg, var(--color-gold), #b8941f);
    color: var(--color-text-dark);
    transform: translateY(-1px);
}

/* ============ MENU HUD - Top Right ============ */
#menuHUD {
    top: 70px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(180deg, var(--color-wood) 0%, var(--color-wood-dark) 100%);
    border: 2px solid var(--color-gold);
    border-radius: 6px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.7), 0 0 12px rgba(212,175,55,0.4);
}

/* ============ NOTIFICATIONS ============ */
#notifications {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.notification {
    background: linear-gradient(180deg, rgba(45, 24, 16, 0.95), rgba(26, 16, 8, 0.95));
    border: 2px solid var(--color-gold);
    border-radius: 6px;
    padding: 10px 20px;
    color: var(--color-parchment);
    font-family: var(--font-body);
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    animation: notifSlide 0.3s ease, notifFade 0.3s ease 2.7s forwards;
}

@keyframes notifSlide {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes notifFade {
    to { opacity: 0; transform: translateY(-20px); }
}

/* ============ HINT BOX ============ */
.hint-box {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    padding: 14px 24px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    color: var(--color-parchment);
    font-family: var(--font-body);
    font-size: 1rem;
    text-align: center;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    transition: opacity 0.5s ease;
}

.hint-box.hidden {
    opacity: 0;
    pointer-events: none;
}

.hint-box strong {
    color: var(--color-gold-light);
}

/* ============ RESPONSIVE - Mobile/Tablet ============ */
@media (max-width: 768px) {
    .game-title { font-size: 2.5rem; }

    #topHUD {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    .resource {
        padding: 6px 10px;
    }

    .resource-icon { font-size: 1.2rem; }
    .resource-amount { font-size: 0.9rem; }

    #statusHUD {
        width: calc(100% - 20px);
        left: 10px;
        bottom: 10px;
    }

    #selectionHUD {
        display: none; /* Στα mobile θα δείχνουμε σε modal */
    }

    .menu-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}
