@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');
:root { --bg-dark: #0a0a0c; --bg-sidebar: #121216; --bg-card: rgba(255, 255, 255, 0.02); --border-color: rgba(255, 255, 255, 0.05); --primary: #8b5cf6; --secondary: #3b82f6; --text-main: #f8f9fa; --text-muted: #a1a1aa; }
body { margin: 0; font-family: 'Poppins', sans-serif; background-color: var(--bg-dark); color: var(--text-main); background-image: radial-gradient(circle at 70% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 40%), radial-gradient(circle at 30% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 40%); background-attachment: fixed; }
input[type="text"], input[type="password"], select { width: 100%; padding: 12px 15px; border-radius: 8px; background: rgba(0,0,0,0.5); border: 1px solid var(--border-color); color: white; font-family: inherit; font-size: 14px; box-sizing: border-box; transition: 0.2s; }
input[type="text"]:focus, input[type="password"]:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; padding: 12px 24px; font-size: 16px; font-weight: 700; border: none; border-radius: 8px; cursor: pointer; transition: 0.3s; box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3); width: 100%; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5); }
.btn-danger { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #ef4444; padding: 12px 24px; font-size: 14px; font-weight: 600; border-radius: 8px; cursor: pointer; transition: 0.2s; width: 100%; text-align: center; }
.btn-danger:hover { background: #ef4444; color: white; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: 0.3s; z-index: 9999; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { background: #18181b; border: 1px solid var(--border-color); border-radius: 16px; padding: 30px; width: 450px; max-width: 90%; transform: translateY(20px); transition: 0.3s; box-shadow: 0 15px 40px rgba(0,0,0,0.5); max-height: 90vh; overflow-y: auto;}
.modal-overlay.active .modal-content { transform: translateY(0); }
.close-modal { float: right; cursor: pointer; color: var(--text-muted); font-size: 24px; border:none; background:none; line-height: 1; }
.close-modal:hover { color: white; }

/* Dashboard Specific */
nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 50px; background: rgba(18, 18, 18, 0.8); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); }
.logo-container { font-size: 24px; font-weight: 800; }
.btn-logout { color: #ef4444; text-decoration: none; font-weight: 600; padding: 8px 16px; background: rgba(239, 68, 68, 0.1); border-radius: 8px; transition: 0.3s; border: none; cursor: pointer; }
.btn-logout:hover { background: rgba(239, 68, 68, 0.2); }
.btn-settings { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 22px; transition: 0.2s; padding: 0; }
.btn-settings:hover { color: white; transform: rotate(45deg); }
.container { max-width: 1200px; margin: 50px auto; padding: 0 20px; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.server-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 30px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: var(--text-main); transition: 0.3s; position: relative; overflow: hidden; }
.server-card:hover { transform: translateY(-5px); border-color: rgba(139, 92, 246, 0.4); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.server-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--primary), var(--secondary)); opacity: 0; transition: 0.3s; }
.server-card:hover::before { opacity: 1; }
.server-icon { width: 90px; height: 90px; border-radius: 50%; margin-bottom: 15px; border: 3px solid var(--primary); object-fit: cover; background: #2f3136; }
.btn-manage { background: rgba(139, 92, 246, 0.1); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.3); padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 14px; transition: 0.3s; width: 80%; margin-top: 15px;}
.server-card:hover .btn-manage { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4); }

/* Farm View Specific */
.farm-body { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 280px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; z-index: 10; }
.sidebar-header { padding: 20px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: 0.2s; position: relative;}
.sidebar-header:hover { background: rgba(255,255,255,0.03); }
.bot-avatar-mini { width: 45px; height: 45px; border-radius: 50%; border: 2px solid var(--primary); object-fit: cover; }
.nav-section { padding: 15px 0; }
.nav-section-title { padding: 0 20px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; font-weight: 600; }
.nav-item { padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); cursor: pointer; border-left: 3px solid transparent; transition: 0.2s;}
.nav-item:hover { background: rgba(255,255,255,0.03); color: var(--text-main); }
.nav-item.active { background: linear-gradient(90deg, rgba(139, 92, 246, 0.1) 0%, transparent 100%); color: var(--primary); border-left-color: var(--primary); font-weight: 500; }
.back-to-dash { margin-top: auto; padding: 20px; border-top: 1px solid var(--border-color); text-align: center; }
.back-to-dash a { color: var(--text-muted); text-decoration: none; font-size: 14px; transition: 0.2s; }
.back-to-dash a:hover { color: #ef4444; }
.main-content { flex: 1; overflow-y: auto; position: relative; }
.topbar { padding: 20px 40px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background: rgba(10, 10, 12, 0.8); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; }
.topbar h2 { margin: 0; font-size: 20px; font-weight: 600; }
.btn-refresh { background: rgba(255,255,255,0.05); color: white; border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 6px; cursor: pointer; transition: 0.2s; font-size: 13px;}
.btn-refresh:hover { background: rgba(255,255,255,0.1); }
.tab-pane { display: none; padding: 40px; animation: fadeIn 0.4s ease-out; max-width: 900px; margin: 0 auto; }
.tab-pane.active { display: block; }
.module-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 25px; margin-bottom: 25px; }
.edit-btn { background: rgba(255,255,255,0.05); color: white; border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 6px; cursor: pointer; transition: 0.2s; font-size: 13px; font-weight: 600; }
.edit-btn.active { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.5); color: #ef4444; }
.delete-streamer-btn { display: none; background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; font-weight: bold; font-size: 16px; align-items: center; justify-content: center; flex-shrink: 0; }
.edit-mode .delete-streamer-btn { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
/* Tooltip (ikonka informacyjna) */
.tooltip { position: absolute; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; background: rgba(139, 92, 246, 0.15); color: var(--primary); border-radius: 50%; font-size: 12px; cursor: help; z-index: 2; border: 1px solid rgba(139, 92, 246, 0.4); font-weight: bold; font-family: monospace; }
.tooltip .tooltiptext { visibility: hidden; width: 260px; background-color: #18181b; color: #e4e4e7; text-align: center; border-radius: 8px; padding: 10px; position: absolute; z-index: 10; bottom: 130%; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s; font-size: 12px; border: 1px solid var(--border-color); font-weight: normal; line-height: 1.5; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.tooltip .tooltiptext::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: var(--border-color) transparent transparent transparent; }
.tooltip:hover .tooltiptext { visibility: visible; opacity: 1; }
/* Znaczek LIVE */
.live-badge {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: pulse-live 2s infinite;
}
@keyframes pulse-live {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* --- CUSTOMOWE ROZWIJANE MENU (SELECT) --- */
select {
    appearance: none; /* Wyłącza brzydką, systemową strzałkę */
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    /* Własna strzałka SVG (biała) */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' 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;
    /* Ustawienie strzałki: 15px od prawej, na środku w pionie (idealnie jak tekst z lewej) */
    background-position: right 15px center; 
    background-size: 16px;
    /* Prawy padding większy, żeby tekst nie wchodził pod strzałkę */
    padding-right: 40px !important;
}

/* Stylizacja samej listy (po rozwinięciu) */
select option {
    background-color: #121216; /* Ciemne tło, pasujące do panelu bocznego */
    color: var(--text-main);
    padding: 12px;
    font-size: 14px;
    border: none;
}

/* Delikatny efekt po najechaniu myszką na rozwiniętą opcję (działa w niektórych przeglądarkach) */
select option:hover, select option:focus, select option:active, select option:checked {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    background-color: var(--primary) !important;
    color: white;
}