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

/* CSS Variables & Global Settings */
:root {
    --bg-dark: #121212;
    --bg-card: rgba(30, 30, 30, 0.7);
    --primary-color: #e0e0e0;
    --secondary-color: #888888;
    --accent-color: #333333;
    --text-main: #f5f5f5;
    --text-muted: #999999;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-blur: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea, [contenteditable] {
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    -khtml-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

::selection {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

::-moz-selection {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

html {
    scrollbar-gutter: stable;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    /* Tactical grid and subtle top glow for premium dark feel */
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(60, 65, 75, 0.3) 0%, transparent 60%),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    background-position: top center, 0 0, 0 0;
    background-attachment: fixed;
}

body:not(.loaded) > *:not(#global-loader) {
    opacity: 0;
    visibility: hidden;
}

body.gsap-loading * {
    transition: none !important;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Typography */
h1 { 
    font-size: 2.5rem; 
    font-weight: 800; 
    margin-bottom: 0.5rem; 
    color: var(--text-main); 
}
h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
p { color: var(--text-muted); line-height: 1.6; }

/* Logo Text Font */
.logo span, .footer-logo span, .auth-logo span {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Buttons */
button, .btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    -webkit-user-select: none;
    user-select: none;
}

.btn-primary {
    background: #2a2a2a;
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    background: #3a3a3a;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.w-100 { width: 100%; }

/* Main Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.main-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.sidebar {
    flex: 0 0 380px;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }

    .sidebar {
        flex: 1;
        position: static;
        width: 100%;
    }

    .content {
        flex: 1;
        width: 100%;
    }
}

/* Lobbies Page Header */
.lobbies-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
    gap: 1rem;
}

.lobbies-title {
    font-weight: 800;
    font-size: 1.4rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lobbies-title i {
    color: #ff4655;
}

.lobby-stats {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ffcc;
    display: inline-block;
    box-shadow: 0 0 8px #00ffcc;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px #00ffcc; }
    50% { opacity: 0.6; box-shadow: 0 0 4px #00ffcc; }
}

/* Lobby Sort */
.lobby-sort {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.lobby-sort label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    margin: 0;
}

/* Custom Dropdown */
.custom-dropdown {
    position: relative;
    width: 220px;
    user-select: none;
}

.dropdown-selected {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.dropdown-selected:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(20, 20, 20, 0.6);
}

.custom-dropdown.open .dropdown-selected {
    border-color: rgba(255, 255, 255, 0.3);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-dropdown.open .dropdown-selected i {
    transform: rotate(180deg);
}

.dropdown-selected i {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.custom-dropdown.open .dropdown-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-option {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.dropdown-option.active {
    background: rgba(255, 70, 85, 0.1);
    color: #ff4655;
    font-weight: 600;
}

/* Live Feed Panel */
.live-feed-panel {
    padding: 1.5rem;
    position: sticky;
    top: 100px;
    background: linear-gradient(180deg, rgba(30, 30, 35, 0.6) 0%, rgba(20, 20, 25, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.feed-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 70, 85, 0.3);
}

.feed-badge {
    font-size: 0.75rem;
    background: rgba(255, 70, 85, 0.15);
    color: #ff4655;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-weight: 700;
    border: 1px solid rgba(255, 70, 85, 0.3);
    box-shadow: 0 0 10px rgba(255, 70, 85, 0.2);
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.feed-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.feed-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #ff4655;
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: center;
    border-radius: 3px 0 0 3px;
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.feed-item:hover::before {
    transform: scaleY(1);
}

.feed-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}

.feed-content {
    flex: 1;
    min-width: 0;
}

.feed-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
}

.feed-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.feed-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    flex-shrink: 0;
}

.feed-item:hover .feed-btn {
    background: rgba(255, 70, 85, 0.15);
    color: #ff4655;
    border-color: rgba(255, 70, 85, 0.3);
    transform: translateX(3px);
}

.feed-footer {
    margin-top: 1.5rem;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.feed-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.feed-footer a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.feed-item-admin {
    background: linear-gradient(to right, rgba(255, 215, 0, 0.05), transparent) !important;
}

.feed-item-admin::before {
    background: #FFD700 !important;
}

.admin-avatar {
    border: 2px solid #FFD700 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4) !important;
}

img[src*="minecraft.png"] {
    filter: brightness(0) invert(1);
}

/* Kurucu Ozel Lobi Karti */
.founder-lobby-card {
    background: linear-gradient(145deg, rgba(30, 25, 20, 0.95), rgba(15, 13, 10, 1)) !important;
    border: 1px solid rgba(255, 215, 0, 0.3) !important;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.1) !important;
    position: relative;
    overflow: hidden;
}

.founder-lobby-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
    z-index: 10;
}

.founder-lobby-card .user-avatar {
    border: 2px solid #FFD700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.founder-lobby-card .lobby-desc {
    color: rgba(255, 255, 255, 0.95) !important;
    font-style: italic;
}

/* Kurucu Özel Lobi - Discord Butonu */
.founder-lobby-card .discord-join-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    color: #1a1a1c !important;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3) !important;
    border: none !important;
    text-shadow: none !important;
}

.founder-lobby-card .discord-join-btn:hover {
    background: linear-gradient(135deg, #FFDF00 0%, #FFB500 100%) !important;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5) !important;
    transform: translateY(-2px) !important;
}

/* Mobile Minimal Design Overrides */

/* PC-only Layout Adjustments */
@media (min-width: 901px) {
    #filters-root {
        margin-bottom: 2.5rem !important; /* Distance from filter section */
    }
    .lobby-controls-modern {
        width: 100% !important; /* Full width on PC */
    }
}

@media (max-width: 900px) {
    /* Hide the Live Feed Sidebar on Mobile for a cleaner look */
    .sidebar {
        display: none !important;
    }

    /* Make main layout full width */
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Hide the entire top header (Aktif Lobiler & badge) on mobile */
    .lobbies-header-top {
        display: none !important;
    }

    /* Stack lobbies header elements and remove gaps/margins so the space is filled */
    .lobbies-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0 !important;
        margin-bottom: 0 !important; /* Overrides inline style */
    }

    .lobbies-title-group {
        width: 100%;
        justify-content: space-between;
    }

    .lobby-controls {
        width: 100%;
        justify-content: space-between;
    }

    .lobby-controls-modern {
        width: 100% !important;
        flex-wrap: nowrap !important;
    }

    .lobby-sort {
        min-width: 0 !important;
        width: 100% !important; /* Override max-content so it can shrink */
        flex: 1; /* Take remaining space */
    }

    .lobby-controls-modern .custom-dropdown {
        min-width: 0 !important;
        width: 100% !important;
    }
    
    .lobby-controls-modern .dropdown-selected span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 500px) {
    .lobby-controls {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }
    
    .view-toggle {
        justify-content: center;
    }

    .lobby-sort {
        justify-content: space-between;
        width: 100%;
    }
}