/* Container & Γενική Διάταξη */
.grid-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Neon Τίτλος */
.neon-title {
    text-align: center;
    color: #fff;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5),
                 0 0 20px rgba(0, 212, 255, 0.3),
                 0 0 40px rgba(0, 212, 255, 0.1);
}

.grid-info {
    text-align: center;
    color: #a0aec0;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* 🔍 Live Search Bar Styling */
.search-wrapper {
    max-width: 400px;
    margin: 0 auto 35px auto;
}

#mapSearch {
    width: 100%;
    padding: 12px 20px;
    background: #0d111a;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 25px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

#mapSearch:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), inset 0 2px 4px rgba(0,0,0,0.3);
}

/* Ο Χάρτης (Grid System) */
.grid-map {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding: 10px;
}

/* Το κάθε Tile/Περιοχή */
.tile {
    position: relative;
    background: #111625;
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
}

.tile:hover {
    transform: translateY(-5px);
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4), 
                0 0 40px rgba(0, 212, 255, 0.1);
}

/* Wrapper για την εικόνα και τον Loader */
.tile-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #070a12;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* Ξεκινάει κρυφή και εμφανίζεται μέσω JS όταν φορτώσει */
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.tile:hover .tile-image-wrapper img {
    transform: scale(1.08);
}

/* 🌀 Neon Spinner Loader */
.tile-loader {
    position: absolute;
    width: 35px;
    height: 35px;
    border: 3px solid rgba(0, 212, 255, 0.1);
    border-radius: 50%;
    border-top-color: #00d4ff;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Το κάτω Panel με τις Πληροφορίες */
.tile-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(10, 15, 30, 0.95) 75%, rgba(10, 15, 30, 0.0));
    padding: 15px 12px 12px 12px;
    box-sizing: border-box;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 2;
}

.tile-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-coords {
    color: #00d4ff;
    font-size: 0.85rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.coord-label {
    color: #4a5568;
    margin-right: 2px;
    margin-left: 5px;
}

.coord-label:first-child {
    margin-left: 0;
}

/* Messages (Errors / Empty) */
.msg-box {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    font-weight: 500;
}

.error-msg {
    background: rgba(245, 101, 101, 0.1);
    color: #feb2b2;
    border: 1px solid rgba(245, 101, 101, 0.2);
}

.empty-msg {
    background: rgba(74, 85, 104, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(74, 85, 104, 0.2);
}

/* Button Ευθυγράμμιση */
.action-wrapper {
    text-align: center;
    margin-top: 40px;
}

.neon-btn-blue {
    display: inline-block;
    padding: 12px 30px;
    color: #00d4ff;
    border: 2px solid #00d4ff;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
    transition: all 0.3s ease;
}

.neon-btn-blue:hover {
    background: #00d4ff;
    color: #111;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}


/* ==========================================================================
   1. CONTAINER & ΓΕΝΙΚΗ ΔΙΑΤΑΞΗ
   ========================================================================== */
.grid-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Neon Κεντρικός Τίτλος */
.neon-title {
    text-align: center;
    color: #ffffff;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5),
                 0 0 20px rgba(0, 212, 255, 0.3),
                 0 0 40px rgba(0, 212, 255, 0.1);
}

.grid-info {
    text-align: center;
    color: #a0aec0;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* ==========================================================================
   2. 🔍 ΖΩΝΤΑΝΗ ΜΠΑΡΑ ΑΝΑΖΗΤΗΣΗΣ (LIVE SEARCH BAR)
   ========================================================================== */
.search-wrapper {
    max-width: 400px;
    margin: 0 auto 35px auto;
}

#mapSearch {
    width: 100%;
    padding: 12px 20px;
    background: #0d111a;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 25px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

#mapSearch:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), inset 0 2px 4px rgba(0,0,0,0.3);
}

/* ==========================================================================
   3. Ο ΧΑΡΤΗΣ (GRID SYSTEM) & TILES
   ========================================================================== */
.grid-map {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding: 10px;
}

/* Το κάθε Tile Περιοχής */
.tile {
    position: relative;
    background: #111625;
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.tile:hover {
    transform: translateY(-5px);
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4), 
                0 0 40px rgba(0, 212, 255, 0.1);
}

/* Wrapper για την εικόνα και τον Loader */
.tile-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #070a12;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* Εμφανίζεται με fade-in μέσω JS όταν φορτώσει */
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.tile:hover .tile-image-wrapper img {
    transform: scale(1.08);
}

/* 🌀 Neon Spinner Loader */
.tile-loader {
    position: absolute;
    width: 35px;
    height: 35px;
    border: 3px solid rgba(0, 212, 255, 0.1);
    border-radius: 50%;
    border-top-color: #00d4ff;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   4. ΣΤΟΙΧΕΙΑ ΕΠΑΝΩ ΣΤΑ TILES (ACTIONS, BADGES, PANELS)
   ========================================================================== */
/* Θέση Teleport Κουμπιού στο Tile */
.tile-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

/* 🟢 Live Counter Badge */
.tile-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    background: rgba(76, 175, 80, 0.9);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Το κάτω Panel με το Όνομα */
.tile-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(10, 15, 30, 0.95) 75%, rgba(10, 15, 30, 0.0));
    padding: 15px 12px 12px 12px;
    box-sizing: border-box;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 2;
}

.tile-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-coords {
    color: #00d4ff;
    font-size: 0.85rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.coord-label {
    color: #4a5568;
    margin-right: 2px;
    margin-left: 5px;
}

.coord-label:first-child {
    margin-left: 0;
}

/* ==========================================================================
   5. ΚΟΥΜΠΙΑ (NEON BUTTONS)
   ========================================================================== */
.tp-btn {
    background: #00d4ff;
    color: #111111;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
    transition: all 0.2s ease;
}

.tp-btn:hover {
    background: #ffffff;
    box-shadow: 0 0 15px #ffffff;
    transform: scale(1.05);
}

.action-wrapper {
    text-align: center;
    margin-top: 40px;
}

.neon-btn-blue {
    display: inline-block;
    padding: 12px 30px;
    color: #00d4ff;
    border: 2px solid #00d4ff;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
    transition: all 0.3s ease;
}

.neon-btn-blue:hover {
    background: #00d4ff;
    color: #111111;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

/* ==========================================================================
   6. 🔥 NEON MODAL POPUP WINDOW
   ========================================================================== */
.neon-modal {
    display: none; 
    position: fixed; 
    z-index: 100; 
    left: 0; 
    top: 0;
    width: 100%; 
    height: 100%;
    background-color: rgba(5, 7, 12, 0.85);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #0d111a;
    border: 2px solid #00d4ff;
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 450px;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.4);
    position: relative;
    animation: modalSlide 0.3s ease;
}

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

.close-modal {
    position: absolute;
    top: 15px; 
    right: 20px;
    color: #a0aec0;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover { 
    color: #ff0055; 
}

.modal-title {
    color: #00d4ff;
    margin-top: 0;
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    padding-bottom: 10px;
}

.modal-body p {
    margin: 12px 0;
    font-size: 0.95rem;
}

.modal-label { 
    color: #a0aec0; 
    font-weight: bold; 
    margin-right: 5px;
}

.modal-value { 
    font-family: monospace; 
    color: #ffffff; 
}

.modal-footer {
    margin-top: 20px;
    text-align: right;
}

/* ==========================================================================
   7. ΜΗΝΥΜΑΤΑ ΣΦΑΛΜΑΤΟΣ / ΑΔΕΙΑΣ ΛΙΣΤΑΣ
   ========================================================================== */
.msg-box {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    font-weight: 500;
}

.error-msg {
    background: rgba(245, 101, 101, 0.1);
    color: #feb2b2;
    border: 1px solid rgba(245, 101, 101, 0.2);
}

.empty-msg {
    background: rgba(74, 85, 104, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(74, 85, 104, 0.2);
}
