/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile Warning */
.mobile-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: #d4af37;
}

.warning-content {
    background: linear-gradient(135deg, #2c1810, #3d2317);
    border: 3px solid #d4af37;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.warning-content h2 {
    font-family: 'Seagram', serif;
    font-size: 28px;
    margin-bottom: 20px;
    color: #d4af37;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.warning-content p {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.4;
}

.warning-content button {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #2c1810;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.warning-content button:hover {
    background: linear-gradient(135deg, #b8941f, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* Body and Main Container */
body {
    margin: 0;
    padding: 0;
    background: #1a1a1a;
    font-family: 'Seagram', 'Times New Roman', serif;
    color: #d4af37;
    overflow: hidden;
}

#gameContainer {
    display: flex;
    height: 100vh;
}

/* Game UI Header */
#gameUI {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #000000;
    border-bottom: 3px solid #d4af37;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#topBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

#gameInfo {
    display: flex;
    gap: 20px;
    font-weight: bold;
}

#gameInfo span {
    background: #000000;
    border: 2px solid #d4af37;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Seagram', serif;
    font-size: 16px;
    color: #d4af37;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#resourceDisplay {
    display: flex;
    gap: 15px;
}

.resource {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #000000;
    border: 2px solid #d4af37;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    color: #d4af37;
    min-width: 70px;
}

.resource-icon {
    font-size: 16px;
}

/* Population Display */
#populationDisplay {
    background: #000000 !important;
    border: 2px solid #d4af37 !important;
    color: #d4af37 !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    margin-left: 0;
}

/* Game Canvas */
#gameCanvas {
    border: 3px solid #d4af37;
    background: #000;
    cursor: grab;
    margin-top: 60px;
   
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

#gameCanvas:active {
    cursor: grabbing;
}

/* Game Controls Panel */
#gameControls {
    
    background-image: url('menuBG.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    border-left: 2px solid #d4af37;
    position: relative;
}

/* Add overlay to make text more readable */
#gameControls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    
    pointer-events: none;
}

#gameControls > * {
    position: relative;
    z-index: 1;
}

/* Logo Container */
#logoContainer {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 50px;
}

#gameLogo {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

/* End Turn Button */
#end-turn-container {
    margin-bottom: 20px;
}

.end-turn-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #2c1810, #3d2317);
    color: #d4af37;
    border: 3px solid #d4af37;
    border-radius: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: 'Seagram', serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.end-turn-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3d2317, #4a2a1c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.end-turn-btn:disabled {
    background: #5a6268;
    border-color: #4e555b;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.end-turn-btn .icon {
    font-size: 22px;
    line-height: 1;
}

.end-turn-btn .text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.end-turn-btn .main-text {
    font-size: 18px;
    font-weight: bold;
}

.end-turn-btn .sub-text {
    font-size: 12px;
    opacity: 0.9;
}

/* Unit and Building Panels */
#unitPanel, #buildingPanel {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(44, 24, 16, 0.8);
    border-radius: 10px;
    border: 2px solid #d4af37;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#unitPanel h3, #buildingPanel h3 {
    margin: 0 0 15px 0;
    color: #d4af37;
    font-size: 16px;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 8px;
    font-family: 'Seagram', serif;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Two Column Layout for Units and Buildings */
#unitButtons, #buildingButtons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Unit and Building Buttons */
.unit-btn, .building-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: linear-gradient(135deg, rgba(44, 24, 16, 0.9), rgba(61, 35, 23, 0.9));
    color: #d4af37;
    border: 2px solid #8b7355;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    text-align: left;
}

.unit-btn:hover:not(:disabled), .building-btn:hover:not(:disabled) {
    border-color: #d4af37;
    background: linear-gradient(135deg, rgba(61, 35, 23, 0.9), rgba(74, 42, 28, 0.9));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.unit-btn:disabled, .building-btn:disabled {
    background: #5a6268;
    border-color: #4e555b;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.unit-btn img, .building-btn img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #8b7355;
}

.unit-info, .building-info {
    flex: 1;
}

.unit-name, .building-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
    color: #d4af37;
    display: block;
}

.unit-cost, .building-cost {
    font-size: 12px;
    opacity: 0.9;
    color: #b8941f;
    line-height: 1.2;
}

/* Action Panel */
#actionPanel {
    padding: 15px;
    background: rgba(44, 24, 16, 0.8);
    border-radius: 10px;
    border: 2px solid #d4af37;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.action-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #2c1810, #3d2317);
    color: #d4af37;
    border: 2px solid #d4af37;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 10px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: linear-gradient(135deg, #3d2317, #4a2a1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

/* Music Player */
#music-player {
    
    background: rgba(44, 24, 16, 0.9);
    padding: 4px;
    border-radius: 10px;
    border: 2px solid #d4af37;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#song-info {
    font-size: 12px;
    color: #d4af37;
    margin-bottom: 8px;
    text-align: center;
}

#volume-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #8b7355;
    outline: none;
    border-radius: 3px;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #d4af37;
    cursor: pointer;
    border-radius: 50%;
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #d4af37;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* Unit Dialog Styles */
#unit-dialog {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, #2c1810, #3d2317);
    color: #d4af37;
    padding: 20px;
    border-radius: 12px;
    border: 3px solid #d4af37;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 400px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

#unit-dialog.visible {
    opacity: 1;
    transform: translateY(0);
}

#unit-dialog .portrait {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 2px solid #d4af37;
}

#unit-dialog .text-area {
    flex: 1;
}

#unit-dialog .unit-name {
    font-size: 16px;
    font-weight: bold;
    color: #d4af37;
    margin-bottom: 5px;
    font-family: 'Seagram', serif;
}

#unit-dialog .message {
    font-size: 14px;
    font-style: italic;
    color: #b8941f;
    margin-bottom: 10px;
}

#unit-dialog .income-info {
    font-size: 12px;
    color: #8b7355;
}

#unit-dialog .income-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 8px;
}

#unit-dialog .income-item {
    background: rgba(139, 115, 85, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #d4af37;
}

/* Info Popup Styles */
#info-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

#info-popup-box {
    background: linear-gradient(135deg, #2c1810, #3d2317);
    color: #d4af37;
    padding: 30px;
    border-radius: 15px;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    border: 3px solid #d4af37;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#info-popup-box h2 {
    color: #d4af37;
    margin-top: 0;
    font-family: 'Seagram', serif;
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
}

#info-popup-box h4 {
    color: #b8941f;
    margin-bottom: 10px;
}

#info-popup-box ul {
    margin: 10px 0;
    padding-left: 20px;
}

#info-popup-box li {
    margin-bottom: 5px;
    line-height: 1.4;
}

#close-popup-btn {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #2c1810;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    font-weight: bold;
    transition: all 0.3s ease;
}

#close-popup-btn:hover {
    background: linear-gradient(135deg, #b8941f, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}



/* Responsive Design */
@media (max-width: 1200px) {
    #gameControls {
        width: 300px;
    }
    
    .unit-name, .building-name {
        font-size: 8px;
    }
    
    .unit-cost, .building-cost {
        font-size: 6px;
    }
}

@media (max-width: 768px) {
    #gameContainer {
        flex-direction: column;
    }
    
    #gameCanvas {
        margin-top: 60px;
        width: calc(100% - 40px);
        height: 50vh;
        margin-left: 20px;
        margin-right: 20px;
    }
    
    #gameControls {
        width: 100%;
        height: 40vh;
        border-left: none;
        border-top: 3px solid #d4af37;
    }
    
    #unitButtons, #buildingButtons {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    #resourceDisplay {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .resource {
        font-size: 12px;
        padding: 4px 8px;
        min-width: 60px;
    }
}

/* Loading and Game States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.loading-text {
    color: #d4af37;
    font-family: 'Seagram', serif;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Tile Highlight Effects */
.tile-highlight {
    box-shadow: 0 0 10px #d4af37;
    border: 2px solid #d4af37;
}

.tile-selected {
    box-shadow: 0 0 15px #d4af37;
    border: 2px solid #d4af37;
}

.tile-moveable {
    box-shadow: 0 0 8px #b8941f;
    border: 2px solid #b8941f;
}

/* Click Animation Styles */
.click-animation {
    position: absolute;
    border: 3px solid #d4af37;
    border-radius: 50%;
    pointer-events: none;
    animation: clickRipple 0.5s ease-out;
}

@keyframes clickRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Selection Feedback */
.selection-highlight {
    position: absolute;
    border: 2px solid #d4af37;
    background: rgba(212, 175, 55, 0.2);
    pointer-events: none;
    animation: selectionPulse 1s infinite;
}

@keyframes selectionPulse {
    0% { 
        transform: scale(1);
        opacity: 0.6;
    }
    50% { 
        transform: scale(1.1);
        opacity: 1.0;
    }
    100% { 
        transform: scale(1);
        opacity: 0.6;
    }
}

/* Tıklama Animasyonu */
.click-ripple {
    position: absolute;
    border: 3px solid rgba(212, 175, 55, 0.8);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Bilgi Paneli */
#tileInfoPanel {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(44, 24, 16, 0.9);
    color: #d4af37;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    white-space: pre-wrap;
    z-index: 1000;
    border: 2px solid #d4af37;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

/* Hometown Button Styling */
.hometown-btn {
    background: linear-gradient(135deg, #d4af37, #b8941f) !important;
    border: 2px solid #d4af37 !important;
    color: #2c1810 !important;
    font-weight: bold !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
    transition: all 0.3s ease !important;
}

.hometown-btn:hover {
    background: linear-gradient(135deg, #b8941f, #d4af37) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(212, 175, 55, 0.4) !important;
}

.hometown-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

/* Camera Edge Indicators */
.camera-edge-indicator {
    position: fixed;
    background: rgba(212, 175, 55, 0.8);
    color: #2c1810;
    font-weight: bold;
    z-index: 1000;
    pointer-events: none;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1.0; }
    100% { opacity: 0.6; }
}