/**
 * ========================================
 * MODERN UI - GLASSMORPHISM THEME
 * Tüm modallar ve UI elementleri
 * ========================================
 */

/* ========================================
   CSS VARIABLES - THEME COLORS
   ======================================== */
:root {
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warning: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-dark: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    
    --text-light: white;
    --text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Dark mode variables */
body.dark-mode {
    --gradient-primary: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    --glass-bg: rgba(45, 55, 72, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* ========================================
   GLOBAL MODAL STYLES
   ======================================== */
.modern-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modern-modal-content {
    max-width: 600px;
    margin: 0 auto;
}

.modern-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.modern-modal-title {
    margin: 0;
    color: var(--text-light);
    font-size: 1.5em;
    font-weight: 700;
    text-shadow: var(--text-shadow);
}

.modern-close-button {
    color: white !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 28px !important;
    cursor: pointer !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

.modern-close-button:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    transform: scale(1.1) rotate(90deg) !important;
}

/* ========================================
   GLASS CARDS
   ======================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   MODERN BUTTONS
   ======================================== */
.modern-button {
    padding: 16px 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    text-shadow: var(--text-shadow);
}

.modern-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.modern-button:active {
    transform: translateY(0);
}

.modern-button-primary {
    background: rgba(102, 126, 234, 0.4);
    border-color: rgba(102, 126, 234, 0.6);
}

.modern-button-success {
    background: rgba(74, 222, 128, 0.4);
    border-color: rgba(74, 222, 128, 0.6);
}

.modern-button-danger {
    background: rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.6);
}

/* ========================================
   MODERN INPUTS
   ======================================== */
.modern-input {
    width: 100%;
    padding: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1em;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

.modern-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.modern-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* ========================================
   MODERN TOGGLE SWITCH
   ======================================== */
.modern-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.modern-toggle-container:hover {
    background: rgba(255, 255, 255, 0.25);
}

.modern-toggle-label {
    color: white;
    font-weight: 500;
    text-shadow: var(--text-shadow);
}

.modern-toggle {
    position: relative;
    width: 60px;
    height: 30px;
}

.modern-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.modern-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 30px;
    transition: 0.4s;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.modern-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.4s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modern-toggle input:checked + .modern-toggle-slider {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

.modern-toggle input:checked + .modern-toggle-slider:before {
    transform: translateX(30px);
}

/* ========================================
   SECTION HEADERS
   ======================================== */
.modern-section-header {
    color: white;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
    text-shadow: var(--text-shadow);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */
.modern-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.modern-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* ========================================
   AVATAR PICKER
   ======================================== */
.modern-avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.modern-avatar-option {
    font-size: 3em;
    padding: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.modern-avatar-option:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.modern-avatar-option.selected {
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.3);
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.5);
}

/* ========================================
   PROFILE STATS
   ======================================== */
.modern-profile-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 12px;
}

.modern-profile-stat-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95em;
    font-weight: 500;
}

.modern-profile-stat-value {
    color: white;
    font-size: 1.5em;
    font-weight: 700;
    text-shadow: var(--text-shadow);
}

/* ========================================
   LEADERBOARD TABLE
   ======================================== */
.modern-leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.modern-leaderboard-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.25);
}

.modern-leaderboard-rank {
    font-size: 1.5em;
    font-weight: 700;
    color: white;
    min-width: 50px;
    text-align: center;
}

.modern-leaderboard-rank.gold {
    color: #ffd700;
    filter: drop-shadow(0 0 8px #ffd700);
}

.modern-leaderboard-rank.silver {
    color: #c0c0c0;
    filter: drop-shadow(0 0 8px #c0c0c0);
}

.modern-leaderboard-rank.bronze {
    color: #cd7f32;
    filter: drop-shadow(0 0 8px #cd7f32);
}

.modern-leaderboard-info {
    flex: 1;
    margin: 0 16px;
}

.modern-leaderboard-name {
    color: white;
    font-weight: 600;
    margin-bottom: 4px;
    text-shadow: var(--text-shadow);
}

.modern-leaderboard-stats {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

.modern-leaderboard-score {
    font-size: 1.3em;
    font-weight: 700;
    color: white;
    text-shadow: var(--text-shadow);
}

/* ========================================
   HELP / INFO BOXES
   ======================================== */
.modern-info-box {
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: var(--glass-shadow);
}

.modern-info-box h3 {
    color: white;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1em;
    text-shadow: var(--text-shadow);
}

.modern-info-box p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 8px 0;
}

.modern-info-box ul {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    padding-left: 20px;
}

/* ========================================
   ANIMATION CLASSES
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .modern-modal {
        padding: 10px;
    }
    
    .modern-modal-header {
        padding: 16px;
    }
    
    .modern-modal-title {
        font-size: 1.2em;
    }
    
    .modern-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .modern-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modern-avatar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .glass-card {
        padding: 16px;
    }
    
    .modern-button {
        padding: 14px 24px;
        font-size: 1em;
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
.modern-modal::-webkit-scrollbar {
    width: 10px;
}

.modern-modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.modern-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.modern-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========================================
   NEW GAME BAR - BUTTON FIX
   Daily Puzzle mor renk + eşit yükseklik
   ======================================== */
#new-game-bar {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
}

#new-game-bar button {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 8px !important;
    margin: 0 !important;
    font-size: 0.85em !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    letter-spacing: 1px !important;
    color: #fff !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

#restart-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    box-shadow: 0 2px 6px rgba(231,76,60,0.3) !important;
}

#daily-puzzle-button {
    background: linear-gradient(135deg, #2196F3, #1565C0) !important;
    box-shadow: 0 2px 6px rgba(33,150,243,0.4) !important;
}

button#daily-puzzle-button {
    background: linear-gradient(135deg, #2196F3, #1565C0) !important;
    box-shadow: 0 2px 6px rgba(33,150,243,0.4) !important;
}

div#new-game-bar button#daily-puzzle-button {
    background: linear-gradient(135deg, #2196F3, #1565C0) !important;
    background-image: linear-gradient(135deg, #2196F3, #1565C0) !important;
    background-color: #2196F3 !important;
    box-shadow: 0 2px 6px rgba(33,150,243,0.4) !important;
}


/* ========================================
   PERFECT MODAL - BLUE THEME
   Override green with blue
   ======================================== */
#prediction-result.success {
    background: rgba(33, 150, 243, 0.95) !important;
    border: 1px solid rgba(33, 150, 243, 0.8) !important;
}


/* ========================================
   WIN MESSAGE - HIDE (redundant with score card)
   ======================================== */
#win-message {
    display: none !important;
}


/* ========================================
   LIGHT MODE - Dark stat boxes like dark mode
   ======================================== */
body:not(.dark-mode) .counter-item {
    background: #334155 !important;
    border: 1px solid #475569 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

body:not(.dark-mode) .counter-item.player-stat {
    background: #2d4a6f !important;
    border: 1px solid #3b82f6 !important;
}

body:not(.dark-mode) .counter-item.puzzle-stat {
    background: #3b4a5c !important;
    border: 1px solid #64748b !important;
}

body:not(.dark-mode) .counter-item .value {
    color: #ffffff !important;
}

body:not(.dark-mode) .counter-item .label {
    color: #94a3b8 !important;
}

body:not(.dark-mode) #notes-area-container {
    background: rgba(30, 41, 59, 0.05) !important;
    border: 1px solid #cbd5e1 !important;
}

body:not(.dark-mode) .note-item-wrapper {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
}

body:not(.dark-mode) .scale-pan {
    border-color: #64748b !important;
}

body:not(.dark-mode) #item-shelf {
    border-top: 2px solid #cbd5e1 !important;
}


/* ========================================
   NOTES TOTAL - Fix overlap with item shelf
   ======================================== */
body .scale-pan {
    overflow: visible !important;
}

body .scale-pan-container {
    overflow: visible !important;
}

body #balance-scale {
    overflow: visible !important;
}

body #balance-scale-wrapper {
    overflow: visible !important;
}

body .note-total-display {
    z-index: 20 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (max-width: 1024px) and (orientation: portrait) {
    /* Responsive layout - space-evenly distribution */
    body #game-container {
        overflow: visible !important;
        max-height: none !important;
        flex-grow: 1 !important;
        height: auto !important;
        min-height: 80vh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-evenly !important;
        gap: 0 !important;
    }
    
    body #balance-scale-wrapper {
        flex: 0 1 auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        margin-top: 0 !important;
    }
    
    body #balance-scale {
        height: auto !important;
        max-height: none !important;
    }
    
    body .scale-pan-container {
        padding-bottom: 22px !important;
        overflow: visible !important;
    }

    body #item-shelf {
        margin-top: 4px !important;
    }
}


/* ========================================
   WEIGHT ANALYSIS - Smaller items in notepad
   ======================================== */
#notes-area .note-item-wrapper .game-item,
#notes-area .game-item,
.note-item-wrapper .game-item {
    width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    margin: 1px !important;
}

#notes-area-container {
    padding: 4px 6px !important;
    margin-bottom: 2px !important;
}

#notes-area-container h2 {
    margin-bottom: 2px !important;
    font-size: 0.65em !important;
}

.note-item-wrapper {
    padding: 2px 4px !important;
    gap: 2px !important;
}

@media (max-width: 1024px) and (orientation: portrait) {
    /* Weight analysis - keep defaults */
}

/* END OF FILE - CSS only, console logs handled in JS */

/* Fix: Hint text readability on yellow items */
.game-item.show-weight {
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000 !important;
}

/* Fix: Weight Analysis - pan overlap spacing */
#notes-area-container {
    margin-bottom: 15px !important;
}
