* { box-sizing: border-box; }
:root { 
    --bg-image: url('/assets/bg-light.png'); 
    --primary: #00FFFF; 
    --accent: #FF69B4; 
    --dark: rgba(18, 18, 22, 0.85); 
    
    --btn-yellow: #d4ac0d; --btn-yellow-txt: black;
    --btn-green: #229954; --btn-green-txt: white;
    --btn-pink: var(--accent); --btn-pink-txt: white;
    --btn-cyan: var(--primary); --btn-cyan-txt: black;
    --btn-red: #e74c3c; --btn-red-txt: white;
}

body.dark-theme { 
    --bg-image: url('/assets/bg-dark.png'); 
    --primary: #008b8b; 
    --accent: #8b005d; 
    --dark: rgba(10, 10, 12, 0.95); 
    
    --btn-yellow: #292200; --btn-yellow-txt: #f1c40f;
    --btn-green: #0a2614; --btn-green-txt: #2ecc71;
    --btn-pink: #360024; --btn-pink-txt: #ff69b4;
    --btn-cyan: #002b2b; --btn-cyan-txt: #00ffff;
    --btn-red: #360a06; --btn-red-txt: #e74c3c;
}

body { margin: 0; background: var(--bg-image) no-repeat center center fixed; background-size: cover; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; color: white; overflow-x: hidden; transition: background 0.8s ease-in-out; }
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(5px); z-index: -1; transition: background 0.8s ease; }
body.dark-theme .overlay { background: rgba(0, 0, 0, 0.75); }

.global-loader { position: fixed; inset: 0; background: rgba(10, 10, 12, 0.95); backdrop-filter: blur(15px); z-index: 9999; display: flex; align-items: center; justify-content: center; flex-direction: column; transition: opacity 0.6s ease-in-out; }
.loader-fade-out { opacity: 0 !important; pointer-events: none; }
.loader-spinner { width: 60px; height: 60px; border: 5px solid rgba(0, 255, 255, 0.1); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite; margin-bottom: 20px; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.loader-flag { font-size: 65px; margin-bottom: 15px; display: none; animation: popIn 0.5s ease; }
.loader-text { font-size: 18px; font-weight: bold; color: white; letter-spacing: 1px; text-shadow: 0 0 10px var(--primary); text-align: center;}
.text-fade { animation: textFade 0.6s ease forwards; }
@keyframes textFade { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }

.view { display: none; width: 100%; opacity: 0; }
.view.active { display: block; animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.85) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* TOP DROPDOWN MENU */
.top-menu-container { position: absolute; top: 25px; left: 30px; z-index: 1000; }
.menu-btn { background: rgba(0,0,0,0.6); border: 1px solid var(--primary); color: white; border-radius: 50%; width: 45px; height: 45px; display: flex; justify-content: center; align-items: center; cursor: pointer; font-size: 20px; transition: all 0.3s ease; }
.menu-btn:hover { background: var(--primary); color: black; box-shadow: 0 0 15px var(--primary); transform: rotate(90deg); }
.dropdown-content { display: none; position: absolute; left: 0; top: 55px; background: var(--dark); min-width: 220px; border-radius: 12px; border: 1px solid #444; flex-direction: column; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.8); transform-origin: top left; animation: popIn 0.3s ease forwards; }
.dropdown-content.show { display: flex; }
.dropdown-content a { color: white; padding: 15px 20px; text-decoration: none; cursor: pointer; border-bottom: 1px solid #333; display: flex; align-items: center; gap: 12px; font-size: 14px; transition: 0.2s; }
.dropdown-content a:hover { background: rgba(0, 255, 255, 0.1); padding-left: 25px; color: var(--primary); }

/* MAIN LAYOUT & SIDEBAR */
.app-layout { display: flex; width: 100%; min-height: 100vh; }
.sidebar { width: 260px; background: var(--dark); padding: 25px; border-right: 1px solid var(--primary); flex-direction: column; display: none; overflow-y: auto; }
.main-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 40px 20px; overflow-y: auto; }
.content-box { width: 100%; max-width: 900px; }

/* TYPOGRAPHY */
.page-title { text-align: center; margin-bottom: 5px; font-size: 32px; font-weight: 800; text-shadow: 0 0 15px rgba(255, 255, 255, 0.3); }
.page-subtitle { text-align: center; color: #bbb; margin-top: 0; font-size: 15px; }
.clock { font-size: 52px; font-weight: bold; text-align: center; margin: 20px 0 35px 0; color: white; text-shadow: 0 0 20px var(--primary); font-variant-numeric: tabular-nums; transition: text-shadow 0.3s; }

/* BUTTONS & MENUS */
.btn-group { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; margin-top: 20px; width: 100%; }
.btn { padding: 12px 24px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.btn:hover { transform: translateY(-5px) scale(1.05); filter: brightness(1.2); box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.btn:active { transform: scale(0.95); }

.btn-yellow { background: var(--btn-yellow); color: var(--btn-yellow-txt); border-color: #d4ac0d; } 
.btn-green { background: var(--btn-green); color: var(--btn-green-txt); border-color: #229954; } 
.btn-pink { background: var(--btn-pink); color: var(--btn-pink-txt); border-color: var(--accent); } 
.btn-cyan { background: var(--btn-cyan); color: var(--btn-cyan-txt); border-color: var(--primary); } 
.btn-red { background: var(--btn-red); color: var(--btn-red-txt); border-color: #e74c3c; }

.btn-outline { background: transparent; border: 1px solid white; color: white; padding: 8px 16px; border-radius: 6px; cursor: pointer; transition: 0.3s; font-size: 13px; font-weight: bold; }
.btn-outline:hover { background: white; color: black; transform: translateX(-5px); }

.nav-btn { background: transparent; border: 1px solid transparent; color: #ccc; padding: 12px 15px; width: 100%; text-align: left; border-radius: 8px; cursor: pointer; font-size: 15px; margin-bottom: 5px; transition: 0.3s; display: flex; align-items: center; gap: 10px; font-weight: bold;}
.nav-btn:hover { background: rgba(0,255,255,0.1); color: var(--primary); transform: translateX(5px); border-color: rgba(0,255,255,0.2); }

/* CARDS */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 30px; }
.card { background: var(--dark); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 8px 25px rgba(0,0,0,0.5); display: flex; flex-direction: column; align-items: center; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease; opacity: 0; animation: popIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.card:nth-child(1) { animation-delay: 0.1s; } .card:nth-child(2) { animation-delay: 0.2s; } .card:nth-child(3) { animation-delay: 0.3s; } .card:nth-child(4) { animation-delay: 0.4s; }
.card:hover { border-color: var(--primary); transform: translateY(-8px) scale(1.02); box-shadow: 0 15px 35px rgba(0,255,255,0.2); z-index: 10; }
.card h3 { margin: 0 0 10px 0; font-size: 14px; color: #ccc; text-transform: uppercase; letter-spacing: 1px; }
.card p { margin: 0; font-size: 26px; font-weight: bold; color: white; }

/* ICONS COLORS */
.i-online { color: #00FF00; } .i-ping { color: #FF4500; } .i-users { color: var(--accent); } .i-servers { color: var(--primary); }

/* INPUT & CONTAINERS */
.login-container { max-width: 380px; margin: 0 auto; background: var(--dark); border: 1px solid var(--primary); border-radius: 16px; padding: 40px 30px; text-align: center; box-shadow: 0 10px 40px rgba(0,255,255,0.15); margin-top: 20px; transition: 0.5s; }
.login-container img { width: 85px; height: 85px; border-radius: 50%; border: 3px solid var(--accent); margin-bottom: 20px; object-fit: cover; transition: transform 0.5s; }
.login-container img:hover { transform: rotate(360deg); }
.login-container h2 { margin: 0 0 5px 0; font-size: 22px; color: white; border: none; padding: 0;}

.input-glass { width: 100%; padding: 14px; margin-bottom: 15px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.4); color: white; font-size: 14px; outline: none; transition: 0.3s; }
.input-glass:focus { border-color: var(--primary); box-shadow: 0 0 15px rgba(0,255,255,0.4); transform: scale(1.02); }

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px dashed #444; padding-bottom: 15px; }
.top-bar h2 { margin: 0; color: var(--primary); border: none; padding: 0; font-size: 20px; }
.text-box { background: var(--dark); border: 1px solid #555; border-radius: 12px; padding: 30px; overflow-y: auto; max-height: 65vh; color: #ccc; font-size: 14.5px; line-height: 1.7; transition: border-color 0.4s; }
.text-box:hover { border-color: var(--primary); }
.text-box h3 { color: white; border-bottom: 1px solid #444; padding-bottom: 8px; margin-top: 25px; font-size: 18px; }
.text-box h3:first-child { margin-top: 0; }
.text-box ul { padding-left: 20px; }
.text-box li { margin-bottom: 8px; }

/* ACCOUNT & PROFILE */
.profile-header { display: flex; align-items: center; gap: 20px; border-bottom: 1px solid #444; padding-bottom: 20px; margin-bottom: 20px; }
.profile-header img { width: 100px; height: 100px; border-radius: 50%; border: 3px solid var(--accent); object-fit: cover;}
.badge { background: #FFD700; color: black; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: bold; display: inline-block; margin-top: 8px; }
.welcome-card { background: rgba(255, 105, 180, 0.1); border: 1px solid var(--accent); padding: 15px 20px; border-radius: 12px; display: flex; align-items: center; gap: 15px; margin-top: 20px; animation: popIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* EDITOR, DB & TERMINAL */
#editor-container { width: 100%; height: 65vh; border-radius: 8px; overflow: hidden; border: 1px solid var(--primary); box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.file-btn { background: transparent; border: 1px solid #444; color: #ccc; padding: 10px 15px; width: 100%; margin-bottom: 10px; border-radius: 6px; cursor: pointer; text-align: left; transition: 0.3s; }
.file-btn:hover { border-color: var(--primary); color: white; background: rgba(0,255,255,0.05); transform: translateX(5px); }

table { width: 100%; border-collapse: collapse; text-align: left; color: white; font-size: 14px; }
table th { padding: 12px 10px; font-weight: bold; border-bottom: 2px solid var(--primary); }
table td { padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
table tr:hover { background-color: rgba(0, 255, 255, 0.05); }

.guild-item { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.3); padding: 15px; border-radius: 8px; margin-bottom: 10px; border: 1px solid #444; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #555; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.terminal-box { background: #0c0c0c; border: 1px solid #333; border-radius: 8px; padding: 15px; height: 60vh; overflow-y: auto; font-family: 'Courier New', Courier, monospace; font-size: 13px; color: #0f0; text-align: left; }
.log-info { color: #0f0; } .log-error { color: #ff4d4d; }

.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 10000; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.modal-content { background: var(--dark); border: 1px solid var(--primary); padding: 30px; border-radius: 12px; width: 90%; max-width: 400px; animation: popIn 0.3s ease; box-shadow: 0 10px 40px rgba(0,255,255,0.2); }
.modal label { display: block; margin-bottom: 5px; color: #ccc; font-size: 13px; text-align: left; margin-top: 10px; }

@media (max-width: 600px) {
    .btn-group { flex-direction: column; align-items: center; gap: 10px; }
    .btn-group .btn { width: 90%; min-width: 0; max-width: none; }
}