/* BASE STYLES */
:root {
    --bg-dark: #121212;
    --card-bg: rgba(30, 30, 30, 0.85);
    --text-light: #f0f0f0;
    --border-color: #444;
    --accent: #7e57c2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Roboto Mono', monospace;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(40, 40, 40, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(40, 40, 40, 0.1) 0%, transparent 20%);
    padding-top: 70px;
}

/* FLASH (floating toast) */
.flash { position: fixed; top: 84px; right: 24px; max-width: 360px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border-color); background: rgba(25,25,25,0.95); box-shadow: 0 8px 30px rgba(0,0,0,0.4); z-index: 1100; opacity: 0; transform: translateY(-8px); animation: flash-in 200ms ease-out forwards; }
.flash-success { border-color: #2e7d32; box-shadow: 0 8px 30px rgba(46,125,50,0.25); }
.flash-error { border-color: #c62828; box-shadow: 0 8px 30px rgba(198,40,40,0.25); }
.flash-info { border-color: #2962ff; box-shadow: 0 8px 30px rgba(41,98,255,0.25); }
.flash.hide { animation: flash-out 180ms ease-in forwards; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flash-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 680px) {
    .flash { left: 16px; right: 16px; top: 76px; max-width: none; }
}

/* NAVIGATION (moved from inline) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    padding: 0 clamp(12px, 2vw, 24px);
}
.nav-container { max-width: 100%; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 12px 0; gap: 12px; }
.logo { font-size: clamp(1.2rem, 2.2vw, 1.6rem); font-weight: 700; color: #f0f0f0; text-decoration: none; display: flex; align-items: center; }
.logo span { color: var(--accent); margin-left: 8px; }
.nav-links { display: flex; list-style: none; gap: 6px; }
.nav-links li { position: relative; }
.nav-links a { color: #e0e0e0; text-decoration: none; padding: clamp(10px, 1.8vw, 15px) clamp(12px, 2vw, 20px); display: flex; align-items: center; transition: all 0.3s ease; font-size: clamp(0.9rem, 1.6vw, 1rem); border-radius: 4px; }
.nav-links a:hover { background-color: rgba(126, 87, 194, 0.2); color: #fff; }
.nav-links a i { margin-right: 10px; font-size: 1.2rem; font-style: normal; line-height: 1; font-family: 'Segoe UI Emoji','Noto Color Emoji','Apple Color Emoji', sans-serif; display: inline-flex; align-items: center; justify-content: center; width: 1.25em; height: 1.25em; }
.dropdown { position: absolute; top: 100%; left: 0; background-color: rgba(40, 40, 40, 0.95); backdrop-filter: blur(10px); width: 220px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s ease; z-index: 1001; overflow: hidden; }
.nav-links li:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown li a { padding: 12px 20px; width: 100%; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 0.95rem; }
.dropdown li:last-child a { border-bottom: none; }
.hamburger { display: none; cursor: pointer; background: none; border: none; outline: none; }
.hamburger span { display: block; width: 30px; height: 3px; background-color: #f0f0f0; margin: 6px 0; transition: all 0.3s ease; border-radius: 2px; }
.mobile-menu { position: fixed; top: 70px; left: 0; width: 100%; background-color: rgba(30, 30, 30, 0.98); backdrop-filter: blur(10px); padding: 20px; transform: translateY(-100%); transition: transform 0.4s ease; z-index: 999; display: none; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); }
.mobile-menu.active { transform: translateY(0); }
.mobile-menu ul { list-style: none; }
.mobile-menu li { margin-bottom: 15px; }
.mobile-menu a { color: #e0e0e0; text-decoration: none; display: flex; align-items: center; padding: 12px 15px; border-radius: 6px; transition: all 0.3s ease; font-size: clamp(1rem, 5vw, 1.1rem); }
.mobile-menu a:hover { background-color: rgba(126, 87, 194, 0.2); color: #fff; }
.mobile-menu a i { margin-right: 15px; font-size: 1.4rem; font-style: normal; line-height: 1; font-family: 'Segoe UI Emoji','Noto Color Emoji','Apple Color Emoji', sans-serif; display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; }
@media (max-width: 900px) { .nav-links { display: none; } .hamburger { display: block; } .mobile-menu { display: block; } }

/* Prevent dropdown from going off-screen */
.nav-links > li { position: relative; }
.nav-links > li .dropdown { left: auto; right: 0; }
@media (max-width: 1200px) {
  .dropdown { max-width: min(90vw, 280px); }
}

/* MAIN LAYOUT WITH SIDEBAR */
.main-container { 
    display: flex; 
    max-width: 1400px; 
    margin: 0 auto; 
    gap: 24px; 
    padding: 20px; 
    align-items: flex-start;
}

.surveys-sidebar { 
    width: 320px; 
    flex-shrink: 0; 
    position: sticky; 
    top: 90px; 
    max-height: calc(100vh - 110px); 
    overflow-y: auto;
}

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

/* SURVEYS SIDEBAR STYLES */
.sidebar-content {
    background: rgba(25, 25, 25, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(8px);
}

.sidebar-content h3 {
    margin: 0 0 16px 0;
    color: var(--text-light);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.sidebar-content h3 i {
    font-size: 1.2rem;
    font-style: normal;
}

/* Kebab Tracker Widget */
.kebab-widget {
    margin-bottom: 24px;
}

.kebab-widget-loading,
.kebab-widget-error {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    opacity: 0.7;
    font-size: 0.9rem;
}

.kebab-countdown {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(126, 87, 194, 0.1);
    border-radius: 8px;
    text-align: center;
}

.kebab-countdown-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    opacity: 0.8;
    margin-bottom: 4px;
}

.kebab-countdown-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    margin-top: 8px;
}

.kebab-countdown-value .time-value {
    font-size: 1em;
    color: var(--accent);
}

.kebab-countdown-value .time-unit {
    font-size: 0.5em;
    color: var(--text-light);
    opacity: 0.7;
    font-weight: 500;
    margin-left: 3px;
    margin-right: 8px;
    text-transform: lowercase;
}

.kebab-countdown-value .time-unit:last-child {
    margin-right: 0;
}

.kebab-contestant-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 0.9rem;
}

.kebab-contestant-name {
    color: var(--text-light);
    opacity: 0.9;
}

.kebab-contestant-count {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.1rem;
}

.kebab-chart-container {
    height: 180px;
    margin-top: 12px;
    position: relative;
    width: 100%;
    overflow: hidden;
}

#kebabWidgetChart {
    width: 100% !important;
    height: 180px !important;
    max-height: 180px !important;
}

.btn-kebab-link {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(126, 87, 194, 0.2);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-kebab-link:hover {
    background: rgba(126, 87, 194, 0.3);
    color: #fff;
    transform: translateY(-1px);
}

.kebab-widget-link {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* SURVEY CREATION FORM */
.create-survey-form {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.create-survey-form h4 {
    margin: 0 0 12px 0;
    color: #ddd;
    font-size: 0.95rem;
}

.survey-form textarea,
.survey-form input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(40, 40, 40, 0.8);
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.survey-form textarea {
    min-height: 60px;
    max-height: 120px;
}

.survey-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.btn-add-option {
    background: rgba(60, 60, 60, 0.8);
    color: #ddd;
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.btn-add-option:hover {
    background: rgba(80, 80, 80, 0.8);
}

.btn-create-survey {
    width: 100%;
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-create-survey:hover {
    background: #6a4fb8;
    border-color: #6a4fb8;
}

/* SURVEYS LIST */
.surveys-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.survey-item {
    background: rgba(35, 35, 35, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    transition: all 0.2s ease;
}

.survey-item:hover {
    border-color: rgba(126, 87, 194, 0.3);
}

.survey-header {
    margin-bottom: 12px;
}

.survey-question {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 6px;
    line-height: 1.3;
}

.survey-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #888;
}

.survey-author {
    color: #aaa;
}

.survey-votes {
    color: #999;
}

/* VOTING OPTIONS */
.vote-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.vote-option {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: rgba(45, 45, 45, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vote-option:hover {
    background: rgba(55, 55, 55, 0.8);
    border-color: rgba(126, 87, 194, 0.4);
}

.vote-option input[type="radio"] {
    margin-right: 10px;
    accent-color: var(--accent);
}

.option-label {
    font-size: 0.85rem;
    color: #ddd;
    flex: 1;
}

.btn-vote-submit {
    width: 100%;
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-vote-submit:hover {
    background: #6a4fb8;
    border-color: #6a4fb8;
}

/* SURVEY RESULTS */
.survey-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-option {
    background: rgba(45, 45, 45, 0.6);
    border-radius: 6px;
    padding: 10px;
}

.option-text {
    font-size: 0.85rem;
    color: #ddd;
    margin-bottom: 6px;
}

.option-bar {
    position: relative;
    background: rgba(60, 60, 60, 0.8);
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
}

.option-fill {
    background: linear-gradient(90deg, var(--accent), #6a4fb8);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.option-percentage {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #fff;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* DELETE SURVEY BUTTON */
.delete-survey-form {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-delete-survey {
    background: rgba(139, 30, 30, 0.8);
    color: #fff;
    border: 1px solid #a93232;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.btn-delete-survey:hover {
    background: #a93232;
}

/* NO SURVEYS MESSAGE */
.no-surveys {
    text-align: center;
    padding: 20px;
    color: #888;
}

.no-surveys p {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
}

.no-surveys small {
    font-size: 0.8rem;
    color: #aaa;
}

/* AUTH */
.auth-section { max-width: 1000px; margin: 30px auto; padding: 0 20px; }
.auth-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.auth-card { background: rgba(20, 20, 20, 0.7); border: 1px solid var(--border-color); border-radius: 8px; padding: 16px; }
.auth-card h3 { margin-bottom: 10px; color: #ddd; }
.auth-card input, .auth-card button { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid var(--border-color); border-radius: 4px; background: rgba(30, 30, 30, 0.8); color: var(--text-light); }
.auth-card button { background: #2c2c2c; cursor: pointer; }
.auth-card button:hover { background: #3a3a3a; }
.user-bar { max-width: 1000px; margin: 20px auto; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border-color); border-radius: 8px; background: rgba(20, 20, 20, 0.6); }
.user-bar form button { border: 1px solid var(--border-color); background: #2c2c2c; color: var(--text-light); padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.user-bar form button:hover { background: #3a3a3a; }

/* COMMENT LIST */
.comment-form { max-width: 1000px; margin: 20px auto; padding: 16px 20px; background: rgba(20, 20, 20, 0.7); border: 1px solid var(--border-color); border-radius: 8px; }
.comment-form textarea, .comment-form button { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid var(--border-color); border-radius: 4px; background: rgba(30, 30, 30, 0.8); color: var(--text-light); }
.comment-form button { background: #2c2c2c; cursor: pointer; }
.comment-form button:hover { background: #3a3a3a; }
#comments-list { max-width: 1000px; margin: 24px auto 72px; padding: 0 24px; display: grid; gap: 16px; }
.comment-item { background: rgba(30, 30, 30, 0.85); border: 1px solid var(--border-color); border-radius: 8px; padding: 16px; }
.comments-sort { max-width: 1000px; margin: 10px auto 0; padding: 0 24px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; color: #aaa; }
.comments-sort select { background: rgba(30,30,30,0.8); color: #e0e0e0; border: 1px solid var(--border-color); border-radius: 6px; padding: 6px 10px; }
.comment-actions { margin-top: 8px; }
.btn-danger { background: #8b1e1e; color: #fff; border: 1px solid #a93232; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.btn-danger:hover { background: #a93232; }
.comment-actions.votes { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.btn-vote { background: transparent; color: #ddd; border: 1px solid var(--border-color); padding: 6px 10px; border-radius: 6px; cursor: pointer; font-family: 'Roboto Mono', monospace; font-size: 1.05rem; font-weight: 700; }
.btn-vote:hover { background: rgba(255,255,255,0.05); }
.btn-vote-like { border-color: #2e7d32; color: #2e7d32; }
.btn-vote-dislike { border-color: #c62828; color: #c62828; }
.btn-vote .count { margin-left: 8px; color: #aaa; font-size: 0.9rem; font-weight: 500; }
.vote-hint { color: #888; font-size: 12px; }
.comment-meta { display: flex; justify-content: space-between; margin-bottom: 6px; border-bottom: 1px solid var(--border-color); padding-bottom: 6px; font-size: 14px; }
.comment-actions.under-date { margin: 6px 0 8px; }
.btn-small { padding: 4px 8px; font-size: 12px; }
.username { font-weight: bold; color: #d0d0d0; }
.timestamp { color: #888; font-size: 0.85em; }
.comment-text { line-height: 1.6; font-size: 0.95em; color: #e0e0e0; }
.comment-text { overflow-wrap: anywhere; word-break: break-word; }

/* Responsive formatting */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        gap: 20px;
        padding: 16px;
    }
    
    .surveys-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        order: -1;
    }
    
    .sidebar-content {
        padding: 16px;
    }
    
    .surveys-list {
        max-height: 400px;
        overflow-y: auto;
    }
}

@media (max-width: 960px) {
    body { padding-top: 66px; }
    .comment-form { padding: 14px 16px; }
    .comments-sort { padding: 0 20px; }
    #comments-list { padding: 0 20px; gap: 14px; margin-bottom: 64px; }
    .auth-section { padding: 0 20px; }
}

@media (max-width: 680px) {
    .main-container {
        padding: 12px;
        gap: 16px;
    }
    
    .sidebar-content {
        padding: 12px;
    }
    
    .sidebar-content h3 {
        font-size: 1rem;
    }
    
    .survey-item {
        padding: 12px;
    }
    
    .survey-question {
        font-size: 0.9rem;
    }
    
    .create-survey-form h4 {
        font-size: 0.9rem;
    }
    
    .survey-form textarea,
    .survey-form input[type="text"] {
        padding: 8px;
        font-size: 0.85rem;
    }
    
    .surveys-list {
        gap: 12px;
        max-height: 300px;
    }
    
    .user-bar { flex-direction: column; align-items: stretch; gap: 10px; }
    .user-bar form button { width: 100%; }
    .auth-cards { gap: 12px; }
    .comment-item { padding: 14px; }
    .comment-meta { font-size: 13px; margin-bottom: 4px; padding-bottom: 4px; }
    .comment-form { padding: 12px 16px; }
    #comments-list { gap: 12px; padding: 0 16px; }
    .auth-card input, .auth-card button, .comment-form textarea, .comment-form button { padding: 9px; }
}

/* SPECIAL CELEBRATION */
#special-celebration { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3000; }
#sto-lat { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 15vw; font-weight: bold; color: white; text-shadow: 0 0 10px rgba(255,255,255,0.8), 0 0 20px rgba(255,0,0,0.8), 0 0 30px rgba(255,255,0,0.8), 0 0 40px rgba(0,255,0,0.8), 0 0 50px rgba(0,0,255,0.8); animation: celebrate 2s infinite alternate; text-align: center; z-index: 3002; }
@keyframes celebrate { 0% { transform: translate(-50%, -50%) scale(1); } 100% { transform: translate(-50%, -50%) scale(1.1); } }
#confetti-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 3001; }
