/* ==== UI COMPONENTS ==== */

/* ==== ADMIN QUICK ACTIONS ==== */
.admin-quick-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .admin-quick-actions {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(74, 85, 104, 0.3);
}

.admin-quick-actions .btn {
    transition: all 0.3s ease;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
}

.admin-quick-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .admin-quick-actions {
        flex-direction: column;
        gap: 10px;
        margin: 15px 0;
        padding: 12px;
    }
    
    .admin-quick-actions .btn {
        width: 100%;
        padding: 12px;
    }
}

/* ==== SESSION STATS ==== */
.session-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.dark-mode .stat-item {
    background: #2d3748;
    border-color: #4a5568;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

body.dark-mode .stat-label {
    color: #a0aec0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #495057;
}

body.dark-mode .stat-value {
    color: #e0e6ed;
}

@media (max-width: 768px) {
    .session-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
}

/* ==== LOBBY/WAITING ROOM ==== */
.lobby-room {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 20px;
}

.lobby-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
}

body.dark-mode .lobby-content {
    background: rgba(30, 41, 59, 0.95);
    color: #e0e6ed;
}

.lobby-header h2 {
    color: #667eea;
    margin-bottom: 10px;
}

body.dark-mode .lobby-header h2 {
    color: #90cdf4;
}

.lobby-header p {
    color: #6c757d;
    margin-bottom: 30px;
}

body.dark-mode .lobby-header p {
    color: #a0aec0;
}

.lobby-info {
    margin: 30px 0;
}

.room-details {
    margin-bottom: 30px;
}

.waiting-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.waiting-animation p {
    color: #6c757d;
    font-style: italic;
}

body.dark-mode .waiting-animation p {
    color: #a0aec0;
}

/* ==== PENDING MEMBERS SECTION ==== */
.pending-members-section {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid #ffc107;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

body.dark-mode .pending-members-section {
    background: rgba(255, 193, 7, 0.15);
    border-color: #e0a800;
}

.pending-members-section h3 {
    color: #856404;
    margin-bottom: 15px;
}

body.dark-mode .pending-members-section h3 {
    color: #ffc107;
}

.pending-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.pending-member-card {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode .pending-member-card {
    background: rgba(30, 41, 59, 0.9);
    border-color: #4a5568;
}

.pending-member-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pending-member-name {
    font-weight: bold;
    color: #495057;
}

body.dark-mode .pending-member-name {
    color: #e0e6ed;
}

.pending-member-time {
    font-size: 0.8rem;
    color: #6c757d;
}

body.dark-mode .pending-member-time {
    color: #a0aec0;
}

.pending-member-actions {
    display: flex;
    gap: 8px;
}

.btn-approve {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-approve:hover {
    background: #218838;
    transform: scale(1.05);
}

.btn-deny {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-deny:hover {
    background: #c82333;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .lobby-content {
        padding: 30px 20px;
    }
    
    .pending-members-grid {
        grid-template-columns: 1fr;
    }
    
    .pending-member-card {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* ==== WELCOME PANEL ==== */
.welcome-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    padding: 0;
    margin: 0;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
    overflow: hidden;
    animation: slideInDown 0.5s ease-out;
    z-index: 1000;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.welcome-header {
    background: rgba(255,255,255,0.1);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.welcome-title {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.welcome-icon {
    font-size: 1.5rem;
}

.welcome-title h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.welcome-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

.welcome-content {
    padding: 25px;
    background: rgba(255,255,255,0.95);
    color: #333;
}

body.dark-mode .welcome-content {
    background: rgba(30,41,59,0.95);
    color: #e0e6ed;
}

.share-item {
    margin-bottom: 20px;
}

.share-item:last-child {
    margin-bottom: 0;
}

.share-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
    font-size: 0.9rem;
}

body.dark-mode .share-item label {
    color: #e0e6ed;
}

.share-value {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

body.dark-mode .share-value {
    background: #2d3748;
    border-color: #4a5568;
}

.code-display {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    letter-spacing: 2px;
}

.url-display {
    font-family: monospace;
    font-size: 0.85rem;
    color: #495057;
    word-break: break-all;
    flex: 1;
}

body.dark-mode .url-display {
    color: #e0e6ed;
}

.copy-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.qr-section {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

body.dark-mode .qr-section {
    border-top-color: #4a5568;
}

.welcome-qr-code {
    display: flex;
    justify-content: center;
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.download-qr-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-qr-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.welcome-footer {
    background: rgba(255,255,255,0.1);
    padding: 15px 25px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.auto-copy-notice {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ==== ENHANCED SHARING DETAILS PANEL ==== */
.sharing-details-panel {
    background: rgba(255,255,255,0.98);
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 0;
    margin: 20px 0;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    backdrop-filter: blur(15px);
    overflow: hidden;
}

body.dark-mode .sharing-details-panel {
    background: rgba(30,41,59,0.98);
    border-color: #4a5568;
    color: #e0e6ed;
}

.sharing-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sharing-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.sharing-content {
    padding: 25px;
}

.share-section {
    margin-bottom: 25px;
}

.share-section:last-child {
    margin-bottom: 0;
}

.share-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #495057;
    font-size: 1rem;
}

body.dark-mode .share-section label {
    color: #e0e6ed;
}

.share-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    font-family: monospace;
    font-size: 0.9rem;
    background: #f8f9fa;
    color: #495057;
    transition: all 0.3s ease;
}

.share-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

body.dark-mode .share-input {
    background: #2d3748;
    border-color: #4a5568;
    color: #e0e6ed;
}

body.dark-mode .share-input:focus {
    background: #1a202c;
    border-color: #667eea;
}

.qr-code-content {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-top: 15px;
}

body.dark-mode .qr-code-content {
    background: #2d3748;
}

.sharing-qr-code {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.qr-code-content p {
    margin: 15px 0;
    color: #6c757d;
    font-size: 0.95rem;
}

body.dark-mode .qr-code-content p {
    color: #a0aec0;
}

/* ==== COPY SUCCESS ANIMATION ==== */
.copy-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    z-index: 10000;
    animation: copySuccessAnim 2s ease-out forwards;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

@keyframes copySuccessAnim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* ==== ENHANCED ANIMATIONS ==== */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-out {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
    transition: all 0.3s ease !important;
}

/* ==== ENHANCED CLOSE BUTTON ==== */
.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.sharing-header .close-btn {
    color: white;
}

.sharing-header .close-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ==== ADVANCED ADMIN CONTROLS ==== */
.admin-advanced-controls {
    background: rgba(255,255,255,0.95);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

body.dark-mode .admin-advanced-controls {
    background: rgba(30,41,59,0.95);
    border-color: #4a5568;
    color: #e0e6ed;
}

/* Timer Section */
.timer-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

body.dark-mode .timer-section {
    border-bottom-color: #4a5568;
}

.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.timer-header h4 {
    margin: 0;
    color: #495057;
}

body.dark-mode .timer-header h4 {
    color: #e0e6ed;
}

.timer-display {
    font-size: 1.2rem;
    font-weight: bold;
}

.timer-active {
    color: #28a745;
    animation: pulse 2s infinite;
}

.timer-urgent {
    color: #dc3545 !important;
    animation: urgentPulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes urgentPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.timer-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-timer {
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-timer:hover {
    background: #138496;
    transform: translateY(-2px);
}

/* Player Timer Display */
.player-timer-display {
    text-align: center;
    margin-bottom: 15px;
}

.player-timer {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    display: inline-block;
    border: 2px solid #17a2b8;
}

.player-timer.urgent {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-color: #dc3545;
    animation: urgentPulse 1s infinite;
}

/* Story Input Section */
.story-input-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

body.dark-mode .story-input-section {
    border-bottom-color: #4a5568;
}

.story-input-section h4 {
    margin: 0 0 15px 0;
    color: #495057;
}

body.dark-mode .story-input-section h4 {
    color: #e0e6ed;
}

.story-input-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.story-input-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

body.dark-mode .story-input-group textarea {
    background: rgba(30,41,59,0.8);
    border-color: #4a5568;
    color: #e0e6ed;
}

body.dark-mode .story-input-group textarea::placeholder {
    color: #a0aec0;
}

/* Current Story Display */
.current-story-section {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}

body.dark-mode .current-story-section {
    background: rgba(102, 126, 234, 0.15);
}

.story-description h3 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1.1rem;
}

.story-description p {
    margin: 0;
    line-height: 1.5;
    color: #495057;
}

body.dark-mode .story-description p {
    color: #e0e6ed;
}

/* Room Settings Panel */
.room-settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 16px;
    padding: 25px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
}

body.dark-mode .room-settings-panel {
    background: #1e293b;
    border-color: #4a5568;
    color: #e0e6ed;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

body.dark-mode .settings-header {
    border-bottom-color: #4a5568;
}

.settings-header h4 {
    margin: 0;
    color: #495057;
}

body.dark-mode .settings-header h4 {
    color: #e0e6ed;
}

.settings-content {
    color: #495057;
}

body.dark-mode .settings-content {
    color: #e0e6ed;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.setting-item select {
    margin-left: 10px;
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
}

body.dark-mode .setting-item select {
    background: #2d3748;
    border-color: #4a5568;
    color: #e0e6ed;
}

/* Player Management */
.btn-kick {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.btn-kick:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ==== STORY TIMER SECTION ==== */

/* Admin Timer Display */
.timer-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
}

.timer-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    position: relative;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.2);
}

.clickable-timer {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.clickable-timer:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.clickable-timer:active {
    transform: scale(0.98);
}

.timer-circle.running {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.timer-circle.paused {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.3);
}

.timer-time {
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.timer-label {
    color: rgba(255,255,255,0.9);
    font-size: 0.65rem;
    margin-top: 1px;
}

.timer-progress {
    width: 150px;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 1s ease;
    width: 100%;
}

.timer-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 5px;
}

.timer-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(102, 126, 234, 0.4);
}

/* Global Timer Display for All Users */
.global-timer-display {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.global-timer-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    position: relative;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.global-timer-circle.warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    box-shadow: 0 6px 15px rgba(255, 193, 7, 0.4);
    animation: pulse 1s infinite;
}

.global-timer-circle.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.4);
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.global-timer-time {
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.global-timer-label {
    color: rgba(255,255,255,0.9);
    font-size: 0.7rem;
    margin-top: 1px;
}

.global-timer-progress {
    width: 120px;
    height: 5px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 10px;
}

.global-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 3px;
    transition: width 1s ease;
    width: 100%;
}

.global-progress-bar.warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.global-progress-bar.danger {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.voting-progress {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
}

body.dark-mode .voting-progress {
    color: #e0e6ed;
}

/* ==== AD SPACES ==== */
.ad-space {
    background: rgba(248, 249, 250, 0.8);
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin: 15px 0;
    color: #6c757d;
    font-size: 0.85rem;
    min-height: 100px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ad-space:hover {
    background: rgba(248, 249, 250, 0.9);
    border-color: #adb5bd;
}

.ad-space.banner {
    min-height: 90px;
    max-width: 728px;
    margin: 15px auto;
}

.ad-space.sidebar {
    min-height: 250px;
    width: 300px;
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
}

.ad-space.mobile-banner {
    min-height: 50px;
    display: flex;
}

body.dark-mode .ad-space {
    background: rgba(45, 55, 72, 0.8);
    border-color: #4a5568;
    color: #a0aec0;
}

@media (max-width: 768px) {
    .ad-space.sidebar {
        width: 250px;
        min-height: 200px;
        position: static;
        margin: 15px auto;
        transform: none;
    }
    
    .ad-space.banner {
        min-height: 50px;
        max-width: 320px;
    }
}

@media (min-width: 1400px) {
    .ad-space.sidebar {
        display: flex;
    }
}

.inactive-indicator {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

body.dark-mode .inactive-indicator {
    color: #a0aec0;
}

/* ==== THEME SELECTOR ==== */
.theme-selector {
    background: rgba(255,255,255,0.9);
    border: 2px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.theme-selector:hover {
    border-color: #667eea;
    background: white;
}

body.dark-mode .theme-selector {
    background: rgba(30,41,59,0.9);
    border-color: #4a5568;
    color: #e0e6ed;
}

body.dark-mode .theme-selector:hover {
    border-color: #667eea;
    background: rgba(30,41,59,1);
}

/* ==== DARK MODE TOGGLE ==== */
.dark-mode-toggle {
    background: rgba(255,255,255,0.9);
    border: 2px solid #dee2e6;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dark-mode-toggle:hover {
    border-color: #667eea;
    background: white;
}

body.dark-mode .dark-mode-toggle {
    background: rgba(30,41,59,0.9);
    border-color: #4a5568;
    color: #e0e6ed;
}

body.dark-mode .dark-mode-toggle:hover {
    border-color: #667eea;
    background: rgba(30,41,59,1);
}

/* ==== ANALYTICS COMPONENTS ==== */
.analytics-section {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

body.dark-mode .analytics-section {
    background: rgba(30,41,59,0.95);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.analytics-header h3 {
    color: #333;
    margin: 0;
}

body.dark-mode .analytics-header h3 {
    color: #e0e6ed;
}

.analytics-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.analytics-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* ==== ANALYTICS GRID ==== */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #667eea;
}

body.dark-mode .stat-card {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
}

body.dark-mode .stat-card:hover {
    border-color: #667eea;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

body.dark-mode .stat-value {
    color: #90cdf4;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

body.dark-mode .stat-label {
    color: #a0aec0;
}

/* ==== ANALYTICS CHART ==== */
.analytics-chart {
    margin-bottom: 20px;
}

.analytics-chart h4 {
    color: #333;
    margin-bottom: 15px;
}

body.dark-mode .analytics-chart h4 {
    color: #e0e6ed;
}

.chart-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    height: 200px;
    position: relative;
}

body.dark-mode .chart-container {
    background: #2d3748;
}

.chart-bars {
    display: flex;
    align-items: end;
    height: 100%;
    gap: 5px;
    justify-content: space-around;
}

.chart-bar {
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 4px 4px 0 0;
    min-width: 20px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-bar:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.chart-bar-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

body.dark-mode .chart-bar-label {
    color: #a0aec0;
}

.chart-bar-value {
    position: absolute;
    top: -25px;
    font-size: 0.8rem;
    color: #333;
    font-weight: bold;
}

body.dark-mode .chart-bar-value {
    color: #e0e6ed;
}

/* ==== UPGRADE PROMPT ==== */
.upgrade-prompt {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    margin-top: 20px;
}

.upgrade-icon {
    font-size: 2rem;
}

.upgrade-text {
    flex: 1;
}

.upgrade-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-btn:hover {
    background: white;
    color: #19547b;
    transform: translateY(-2px);
}

/* ==== QR CODE SECTION (Legacy Support) ==== */
.qr-code-section {
    background: rgba(255,255,255,0.95);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

body.dark-mode .qr-code-section {
    background: rgba(30,41,59,0.95);
    border-color: #4a5568;
    color: #e0e6ed;
}

.qr-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

body.dark-mode .qr-code-header {
    border-bottom-color: #4a5568;
}

.qr-code-header h4 {
    margin: 0;
    color: #495057;
}

body.dark-mode .qr-code-header h4 {
    color: #e0e6ed;
}

.qr-code-canvas {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ==== BRANDING PANEL ==== */
.branding-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 16px;
    padding: 0;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

body.dark-mode .branding-panel {
    background: #1e293b;
    border-color: #4a5568;
    color: #e0e6ed;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 14px 14px 0 0;
}

.panel-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.panel-content {
    padding: 25px;
}

.branding-section {
    margin-bottom: 20px;
}

.branding-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

body.dark-mode .branding-section label {
    color: #e0e6ed;
}

.branding-section input[type="text"],
.branding-section input[type="color"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
}

body.dark-mode .branding-section input[type="text"] {
    background: #2d3748;
    border-color: #4a5568;
    color: #e0e6ed;
}

.btn-upload {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-upload:hover {
    background: #138496;
    transform: translateY(-2px);
}

.logo-preview {
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid #dee2e6;
}

body.dark-mode .logo-preview {
    border-color: #4a5568;
}

.branding-preview {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

body.dark-mode .branding-preview {
    background: #2d3748;
}

.preview-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body.dark-mode .preview-card {
    background: #1a202c;
}

.preview-header {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-logo {
    border-radius: 50%;
}

.team-name {
    font-weight: 600;
    color: white;
}

.preview-content {
    padding: 15px;
}

.preview-button {
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.branding-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

body.dark-mode .branding-actions {
    border-top-color: #4a5568;
}

.btn-save {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-reset {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* ==== ACHIEVEMENTS PANEL ==== */
.achievements-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 16px;
    padding: 0;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

body.dark-mode .achievements-panel {
    background: #1e293b;
    border-color: #4a5568;
    color: #e0e6ed;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 20px;
}

.achievement-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.achievement-card.unlocked {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

body.dark-mode .achievement-card {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
}

body.dark-mode .achievement-card.unlocked {
    border-color: #48bb78;
    background: linear-gradient(135deg, #22543d 0%, #2f855a 100%);
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.achievement-card.unlocked .achievement-icon {
    opacity: 1;
}

.achievement-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

body.dark-mode .achievement-title {
    color: #e0e6ed;
}

.achievement-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
}

body.dark-mode .achievement-description {
    color: #a0aec0;
}

.achievement-points {
    font-size: 0.8rem;
    font-weight: bold;
    color: #667eea;
}

body.dark-mode .achievement-points {
    color: #90cdf4;
}

.points-display {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
}

/* ==== ACHIEVEMENT NOTIFICATIONS ==== */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    z-index: 10000;
    animation: achievementSlideIn 0.5s ease-out;
    max-width: 300px;
    overflow: hidden;
}

.achievement-content {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 15px;
}

.achievement-notification .achievement-icon {
    font-size: 2rem;
    opacity: 1;
}

.achievement-text {
    flex: 1;
}

.achievement-notification .achievement-title {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 3px;
    color: white;
}

.achievement-notification .achievement-name {
    font-weight: 600;
    margin-bottom: 3px;
    color: white;
}

.achievement-notification .achievement-points {
    font-size: 0.8rem;
    color: white;
    opacity: 0.9;
}

@keyframes achievementSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==== RESPONSIVE DESIGN ==== */
@media (max-width: 768px) {
    /* Welcome Panel Responsive */
    .welcome-panel, .sharing-details-panel {
        margin: 15px 0;
        border-radius: 15px;
    }
    
    .welcome-header, .sharing-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .welcome-content, .sharing-content {
        padding: 20px;
    }
    
    .share-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .share-input {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    
    .copy-btn {
        width: 100%;
        justify-content: center;
    }
    
    .url-display {
        font-size: 0.8rem;
    }
    
    .welcome-qr-code, .sharing-qr-code {
        padding: 10px;
    }
    
    /* Admin Controls Responsive */
    .admin-advanced-controls {
        padding: 15px;
        margin: 15px 0;
    }
    
    .timer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .timer-controls {
        justify-content: center;
        width: 100%;
    }
    
    .room-settings-panel, .branding-panel {
        padding: 20px;
        max-width: 350px;
    }
    
    /* Analytics Responsive */
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .upgrade-prompt {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    /* Achievements Responsive */
    .achievements-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .achievement-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    /* Close buttons responsive */
    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .share-value {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .code-display, .url-display {
        text-align: center;
    }
    
    .timer-controls {
        flex-direction: column;
    }
    
    .btn-timer {
        width: 100%;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}