/* assets/css/menu.css */

.scene { 
    width: 320px; 
    margin-top: 5vh; 
    height: 480px; 
    margin-left: auto;
    margin-right: auto;
    /* perspective törölve */
}

#main-card {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    /* transition és transform-style törölve, hogy ne forogjon */
}

.card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    box-sizing: border-box;
    border-radius: 30px;
    border: 6px solid transparent;
    background-image: linear-gradient(var(--paper), var(--paper)), 
                      linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);

    /* transform-style és backface-visibility törölve */
    display: none; /* Alapból minden panel rejtett */
}

/* Aktív állapot: a JS ezt az osztályt adja hozzá, amitől azonnal megjelenik */
.card-face.active {
    display: flex !important;
}

/* --- REGISZTRÁCIÓS PANEL SPECIFIKUS SŰRÍTÉS --- */
#register-panel {
    justify-content: flex-start !important; 
    padding-top: 20px !important;
    padding-bottom: 15px !important;
}

#register-panel h1 {
    font-family: var(--handwritten);
    font-size: 28px;
    color: #1a2a6c;
    margin: 0 0 10px 0;
}

#register-panel input {
    padding: 10px 15px !important;
    margin: 5px 0 !important;
}

#register-panel .btn-main {
    margin: 10px 0 5px 0 !important;
}

/* --- ÁLTALÁNOS FORM ELEMEK --- */
.card-face input {
    width: 100% !important;
    padding: 12px 15px !important;
    margin: 8px 0 !important;
    border: 1px solid #ccc !important;
    border-radius: 12px !important;
    font-family: var(--handwritten) !important; 
    font-size: 19px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    color: #1a2a6c !important;
    outline: none;
}

.card-face input:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.card-face input::placeholder {
    font-family: var(--handwritten) !important;
    color: #aaa !important;
    font-size: 18px;
    font-style: normal;
}

/* Placeholder fixek */
.card-face input::-webkit-input-placeholder { font-family: var(--handwritten) !important; }
.card-face input::-moz-placeholder { font-family: var(--handwritten) !important; }

.card-face .btn-main {
    width: 100%;
    padding: 14px;
    margin: 15px 0;
    font-size: 24px;
}

.login-footer-links {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 14px;
}

/* --- CÍMEK --- */
.login-title-game {
    font-family: var(--handwritten);
    font-size: 48px;
    font-weight: 700;
    color: #1a2a6c;
    margin: 0;
    line-height: 1.1;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.1);
}

.login-title-sub {
    font-family: sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #555;
    margin: 5px 0 15px 0;
}

.welcome-text {
    font-size: 26px;
    font-weight: 700;
    color: #000000;
    text-align: center;
    margin: 20px 0;
    font-family: 'Kalam', cursive;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
}

/* Mobil nézet finomhangolása */
@media screen and (max-height: 600px) {
    .scene { height: 450px; margin-top: 2vh; }
    .login-title-game { font-size: 40px; }
}

/* 7"-os és kisebb mobilok optimalizálása */
@media screen and (max-width: 768px) and (max-height: 1024px) {
    .scene { 
        width: 280px; 
        height: 420px; 
        margin-top: 3vh; 
    }
    
    .card-face {
        padding: 20px;
        border-radius: 20px;
        border: 4px solid transparent;
    }
    
    .login-title-game { font-size: 36px; }
    .login-title-sub { font-size: 11px; }
    .welcome-text { font-size: 22px; }
    
    .card-face input {
        font-size: 16px !important;
        padding: 10px 12px !important;
        margin: 6px 0 !important;
    }
    
    .card-face .btn-main {
        font-size: 20px;
        padding: 12px;
        margin: 12px 0;
    }
    
    .btn-menu {
        font-size: 16px;
        padding: 12px 20px;
        margin: 8px 0;
    }
    
    .settings-row label {
        font-size: 14px;
    }
    
    .menu-select-small {
        font-size: 12px;
        padding: 6px 25px 6px 10px;
        max-width: 150px;
    }
}

/* Konténer a soroknak */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

/* Egy sor: Felirat balra, Lenyíló jobbra */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.settings-row label {
    font-family: 'Kalam', cursive;
    font-weight: bold;
    color: #1a2a6c;
    font-size: 16px;
    flex: 1;
    text-align: left;
}

/* Kisebb, elegánsabb lenyíló */
.menu-select-small {
    flex: 1.5; 
    max-width: 180px; 
    padding: 8px 30px 8px 12px;
    border-radius: 8px;
    border: 2px solid #1a2a6c;
    background-color: #fff;
    font-family: 'Kalam', cursive;
    font-size: 14px;
    color: #1a2a6c;
    cursor: pointer;
    outline: none;
    
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231a2a6c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

.menu-select-small option {
    font-family: 'sans-serif';
    background: white;
    color: #333;
    padding: 10px;
}

.menu-select-small:focus {
    border-color: #b21f1f;
}

.scroll-list {
    max-height: 150px;
    overflow-y: auto;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
    margin-top: 5px;
    width: 100%;
}
.friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
}
.btn-add-friend {
    background: #27ae60;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
}

#footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 0px;
}

#info-bar {
    text-align: left;
    display: block;
}

#game-exit-btn {
    width: auto !important;
    margin: 0 !important;
    padding: 10px 25px;
    font-size: 16px;
    cursor: pointer;
}

/* MODAL ÉS EGYÉB ELEMEK */
.modal-overlay.hidden { display: none; }
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: #2c3e50;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    color: white;
    min-width: 300px;
}
#friends-list-container button, .modal-content button {
    display: block; width: 100%;
    margin: 10px 0; padding: 10px;
    background: #34495e; color: white; border: none;
    cursor: pointer; border-radius: 5px;
}
#friends-list-container button:hover { background: #2980b9; }

.hidden {
    display: none !important;
}

.menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.results-content {
    background: #2c3e50;
    width: 90%; max-width: 800px;
    height: 80vh; border-radius: 15px;
    padding: 20px; color: white;
    overflow-y: auto; border: 2px solid #3498db;
}

.results-tabs {
    display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid #555; padding-bottom: 10px;
}

.results-tabs button {
    background: #34495e; color: white; border: none; padding: 10px 15px; cursor: pointer; border-radius: 5px;
}

.results-tabs button:hover { background: #3498db; }

.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px;
}

.stat-card {
    background: #34495e; padding: 15px; border-radius: 10px; text-align: center; border-bottom: 4px solid #3498db;
}

.history-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.history-table th { background: #1a252f; padding: 10px; }
.history-table td { padding: 10px; text-align: center; border-bottom: 1px solid #444; }
.win { color: #2ecc71; }
.loss { color: #e74c3c; }

/* Globális ranglista táblázat sűrítése */
#leaderboard-list td {
    padding: 2px 6px !important;
    font-family: Arial, sans-serif !important;
    font-size: 12px !important;
    border-bottom: 1px solid #eee;
    height: 24px; /* Fix sormagasság */
}

#leaderboard-list tr:hover {
    background-color: #f9f9f9;
}

/* --- EGYSÉGESÍTETT PANEK ANIMÁCIÓK --- */
.card-face {
    transition: all 0.3s ease-out;
    opacity: 0;
    transform: translateX(50px) scale(0.98);
    z-index: 1;
    pointer-events: none;
}

.card-face.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    z-index: 10;
    pointer-events: auto;
}

.card-face.exit-left {
    opacity: 0;
    transform: translateX(-50px) scale(0.98);
    z-index: 5;
    pointer-events: none;
}

.card-face.exit-right {
    opacity: 0;
    transform: translateX(50px) scale(0.98);
    z-index: 5;
    pointer-events: none;
}

.card-face.exit-up {
    opacity: 0;
    transform: translateY(-30px) scale(0.98);
    z-index: 5;
    pointer-events: none;
}

.card-face.exit-down {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    z-index: 5;
    pointer-events: none;
}

/* --- EGYSÉGESÍTETT LOGIN/REGISZTRÁCIÓ ANIMÁCIÓ --- */
#login-panel.active {
    transition: all 0.3s ease-out;
}

/* --- EGYSÉGESÍTETT MENÜ PANEL ANIMÁCIÓ --- */
#menu-panel.active {
    transition: all 0.3s ease-out;
}

/* --- EGYSÉGESÍTETT BEÁLLÍTÁSOK PANEL ANIMÁCIÓK --- */
#settings-panel.active,
#general-settings-panel.active,
#friends-mgmt-panel.active,
#results-menu-panel.active {
    transition: all 0.3s ease-out;
}

/* --- EGYSÉGESÍTETT EREDMÉNYEK ALMENÜK ANIMÁCIÓI --- */
#panel-global-board.active,
#panel-friends-board.active,
#panel-match-history.active,
#panel-personal-stats.active {
    transition: all 0.3s ease-out;
}