/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    position: relative;
    background: #0d0d0d;
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 0, 255, 0.4) rgba(255, 255, 255, 0.03);
}

/* Global webkit scrollbar (Chrome/Safari/Edge) — use !important to beat macOS native overlay */
html, body {
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 0, 255, 0.5) rgba(255, 255, 255, 0.04);
}

::-webkit-scrollbar {
    width: 10px !important;
    height: 10px !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04) !important;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(120, 0, 255, 0.55) !important;
    border-radius: 5px;
    border: 2px solid rgba(15, 15, 20, 0.6);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 0, 255, 0.85) !important;
}

::-webkit-scrollbar-corner {
    background: transparent !important;
}

/* Room Modal */
.room-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.98), rgba(20, 10, 30, 0.98));
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
}

.room-modal.show {
    display: flex;
}

.room-modal-content {
    background: linear-gradient(165deg, rgba(35, 35, 45, 0.95), rgba(20, 20, 28, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 45px 40px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6), 0 0 60px rgba(120, 0, 255, 0.1);
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 0, 255, 0.4) transparent;
}

.room-modal-content::-webkit-scrollbar {
    width: 8px;
}

.room-modal-content::-webkit-scrollbar-track {
    background: transparent;
    margin: 12px 0;
}

.room-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(120, 0, 255, 0.4), rgba(255, 0, 128, 0.3));
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.room-modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(120, 0, 255, 0.6), rgba(255, 0, 128, 0.5));
}

.room-modal-content h2 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, rgba(200, 180, 255, 0.9));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.room-modal-content > p {
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

/* Input Wrapper - Global for modal */
.room-modal-content .input-wrapper {
    margin-bottom: 16px;
    text-align: left;
}

.room-modal-content .input-wrapper label {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.room-modal-content .input-wrapper input {
    width: 100%;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.room-modal-content .input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.room-modal-content .input-wrapper input:focus {
    outline: none;
    border-color: rgba(120, 0, 255, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 20px rgba(120, 0, 255, 0.15);
}

/* Room Divider */
.room-divider {
    position: relative;
    margin: 24px 0;
    text-align: center;
}

.room-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.room-divider span {
    background: rgba(28, 28, 36, 1);
    padding: 0 18px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
}

/* Buttons in modal */
.room-modal-content .btn {
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    z-index: 10;
}

.room-modal-content .btn-primary {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.room-modal-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.45);
}

.room-modal-content .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.room-modal-content .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Google Button */
.btn-google {
    background: linear-gradient(135deg, #fff 0%, #f8f8f8 100%) !important;
    color: #333 !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    position: relative;
    z-index: 10;
    cursor: pointer;
}

.btn-google:hover {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%) !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.btn-google:active {
    transform: translateY(0);
}

/* Room Tabs (Create / Join) */
.room-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 4px;
}

.room-tab {
    flex: 1;
    padding: 10px 14px;
    background: transparent !important;
    border: none !important;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.room-tab.active {
    background: linear-gradient(135deg, rgba(120, 0, 255, 0.35), rgba(255, 0, 128, 0.3)) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(120, 0, 255, 0.25);
}

.room-tab:hover:not(.active) {
    color: rgba(255, 255, 255, 0.85) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

/* Login Section Styling */
#loginSection p,
#loggedInSection > p {
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(168, 85, 247, 0.05));
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 16px;
    margin-bottom: 24px;
}

.user-info img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(124, 58, 237, 0.5);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.user-details {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-details span {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    font-size: 0.8rem;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25) !important;
}

/* My Rooms Section */
.my-rooms-section {
    margin-bottom: 20px;
    text-align: left;
}

.my-rooms-section h3 {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.my-rooms-list {
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.my-rooms-list .no-rooms {
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    padding: 24px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
}

.room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.room-item:hover {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.25);
    transform: translateX(4px);
}

.room-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.room-item-name {
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
}

.room-item-code {
    color: rgba(124, 58, 237, 0.7);
    font-size: 0.75rem;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    letter-spacing: 1px;
}

.room-item-actions {
    display: flex;
    gap: 6px;
}

.room-item-actions button {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-enter {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.btn-enter:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Participants Panel */
.participants-panel {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
}

.participants-header h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

.participants-section h4 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.pending-list, .active-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.no-items {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    padding: 15px;
    font-size: 0.85rem;
}

.participant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.participant-name {
    color: #fff;
    font-weight: 500;
}

.participant-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    margin-left: 10px;
}

.participant-actions {
    display: flex;
    gap: 6px;
}

.participant-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.participant-status {
    padding: 4px 10px;
    background: rgba(0, 200, 83, 0.2);
    color: #00c853;
    border-radius: 20px;
    font-size: 0.75rem;
}

/* Room Info Bar */
.room-info-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.room-info-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.room-code-display {
    background: linear-gradient(135deg, #7800ff, #ff0080);
    padding: 6px 14px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.95rem;
    letter-spacing: 2px;
}

.room-name-display {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.room-role {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

.room-info-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.room-viewers {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.btn-small {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger-small {
    background: rgba(255, 50, 50, 0.2);
}

.btn-danger-small:hover {
    background: rgba(255, 50, 50, 0.4);
}

/* Adjust container when room bar is visible */
.room-info-bar ~ .container,
body:has(.room-info-bar[style*="flex"]) .container {
    margin-top: 50px;
}

/* Pending Requests Panel */
.pending-requests-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 320px;
    max-height: 400px;
    background: rgba(25, 25, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.pending-requests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(120, 0, 255, 0.1);
}

.pending-requests-header h3 {
    font-size: 1rem;
    color: #fff;
    margin: 0;
}

.pending-requests-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 10px;
}

.pending-requests-list .no-requests {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 30px;
    font-size: 0.9rem;
}

.request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 8px;
}

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

.request-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.request-name {
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
}

.request-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

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

.request-actions button {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-approve {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #fff;
}

.btn-approve:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
}

.btn-reject {
    background: linear-gradient(135deg, #ff1744, #ff5252);
    color: #fff;
}

.btn-reject:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 23, 68, 0.4);
}

/* Waiting Screen */
.waiting-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.waiting-content {
    text-align: center;
    padding: 40px;
}

.waiting-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #7800ff;
    border-radius: 50%;
    margin: 0 auto 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.waiting-content h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.waiting-content p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.waiting-room-name {
    color: #7800ff;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 30px !important;
}

#pendingRequestsBtn {
    background: linear-gradient(135deg, #ff6b00, #ff9800) !important;
    animation: pulse-notification 2s infinite;
}

@keyframes pulse-notification {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255, 107, 0, 0); }
}

/* Blackout Mode */
body.blackout {
    background: #000 !important;
}

body.blackout::before,
body.blackout .particles,
body.blackout .container {
    display: none !important;
}

body.blackout .blackout-screen {
    display: flex !important;
}

.blackout-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.blackout-screen span {
    color: rgba(255,255,255,0.3);
    font-size: 1.2rem;
}

/* Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(120, 0, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 0%, rgba(255, 0, 128, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(0, 150, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: floatUp 15s infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 14s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 11s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 16s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 13s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 15s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2s; animation-duration: 12s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4s; animation-duration: 14s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1s; animation-duration: 11s; }
.particle:nth-child(10) { left: 15%; animation-delay: 3s; animation-duration: 16s; }
.particle:nth-child(11) { left: 25%; animation-delay: 0s; animation-duration: 13s; }
.particle:nth-child(12) { left: 75%; animation-delay: 2s; animation-duration: 15s; }

@keyframes floatUp {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* Container & Header */
.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 8px;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 40px rgba(255, 255, 255, 0.2); }
    100% { text-shadow: 0 0 60px rgba(255, 255, 255, 0.4), 0 0 100px rgba(120, 0, 255, 0.3); }
}

/* Quick Action Buttons */
.quick-actions {
    display: flex;
    gap: 10px;
}

.quick-btn {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.quick-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.quick-btn svg {
    width: 20px;
    height: 20px;
}

.quick-btn.active {
    background: rgba(255, 71, 87, 0.3);
    border-color: #ff4757;
}

/* Signal Lights */
.signal-lights {
    display: flex;
    gap: 8px;
    margin-left: 20px;
}

.signal-light {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid rgba(255,255,255,0.2);
}

.signal-light.green { background: rgba(46, 204, 113, 0.3); }
.signal-light.yellow { background: rgba(241, 196, 15, 0.3); }
.signal-light.red { background: rgba(231, 76, 60, 0.3); }

.signal-light.green.active { background: #2ecc71; box-shadow: 0 0 20px #2ecc71; }
.signal-light.yellow.active { background: #f1c40f; box-shadow: 0 0 20px #f1c40f; }
.signal-light.red.active { background: #e74c3c; box-shadow: 0 0 20px #e74c3c; }

/* Tab System */
.tabs-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tabs {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px 12px 0 0;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: tabSlideIn 0.3s ease-out;
}

@keyframes tabSlideIn {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-bottom-color: transparent;
}

.tab .tab-name {
    cursor: text;
    padding: 2px 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.tab .tab-name:hover { background: rgba(255, 255, 255, 0.1); }
.tab .tab-name:focus { outline: none; background: rgba(255, 255, 255, 0.2); }

.tab .close-tab {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.5);
}

.tab .close-tab:hover {
    background: #ff4757;
    color: #fff;
}

.add-tab {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-tab:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

/* Timer Card */
.timer-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(40px);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
    animation: cardFadeIn 0.4s ease-out;
}

.timer-card.active { display: block; }

@keyframes cardFadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Live Message */
.live-message {
    position: relative;
    text-align: center;
    padding: 15px 40px 15px 15px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 1.5rem;
    color: #fff;
    display: none;
    animation: fadeIn 0.3s;
}

.live-message.show { display: flex; align-items: center; justify-content: center; }

.live-message .close-message {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.live-message .close-message:hover {
    background: rgba(255, 71, 87, 0.5);
    color: #fff;
}

.live-message.flash {
    animation: flashMessage 0.5s infinite;
}

@keyframes flashMessage {
    0%, 100% { opacity: 1; background: rgba(255, 71, 87, 0.3); }
    50% { opacity: 0.5; background: rgba(255, 71, 87, 0.1); }
}

/* Timer Display */
.timer-display {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.timer-mode-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.timer-display .time {
    font-size: 7rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 5px;
    transition: all 0.3s ease;
    color: #fff;
    text-shadow: 0 0 60px rgba(255, 255, 255, 0.3);
}

.timer-display .time.negative { color: #ff4757; }

.timer-display .time.warning {
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.02); }
}

.timer-display .label {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
}

.speed-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

/* Progress */
.progress-wrapper {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.progress-container {
    flex: 1;
    max-width: 400px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-circle {
    width: 80px;
    height: 80px;
    position: relative;
}

.progress-circle svg {
    transform: rotate(-90deg);
    width: 80px;
    height: 80px;
}

.progress-circle .bg {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 6;
}

.progress-circle .progress {
    fill: none;
    stroke: rgba(255,255,255,0.5);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 226;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.3s;
}

.progress-circle .percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Fine Tune Controls */
.fine-tune {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.fine-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.fine-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.fine-btn.minus { color: #ff6b6b; }
.fine-btn.plus { color: #51cf66; }

.fine-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.3) !important;
}

.fine-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3) !important;
}

/* Settings Panel */
.settings-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.setting-group {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.setting-group h3 {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-group h3 svg {
    width: 18px;
    height: 18px;
}

/* Input Styles */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.input-wrapper {
    flex: 1;
}

.input-wrapper label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

.input-wrapper input, .input-wrapper select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-wrapper input:focus, .input-wrapper select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.input-wrapper select option {
    background: #1a1a1a;
    color: #fff;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-option {
    flex: 1;
    min-width: 80px;
}

.mode-option input { display: none; }

.mode-option label {
    display: block;
    padding: 10px;
    text-align: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.mode-option input:checked + label {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-top: 8px;
}

.checkbox-group input { display: none; }

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.checkbox-group input:checked + .checkbox-custom {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.checkbox-custom svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.checkbox-group input:checked + .checkbox-custom svg { opacity: 1; }

.checkbox-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker::-webkit-color-swatch {
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Buttons */
.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.sticky-controls {
    position: sticky;
    bottom: 0;
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    margin: 0 -30px -30px -30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.btn {
    padding: 14px 35px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

.btn-danger {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.btn-danger:hover { background: rgba(255, 71, 87, 0.2); }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Presets */
.presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.preset-btn {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    padding: 18px 25px;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateX(400px);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification.show { transform: translateX(0); }

.notification svg {
    width: 22px;
    height: 22px;
}

/* Message Modal */
.message-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.message-modal.show { display: flex; }

.message-modal-content {
    background: rgba(30,30,30,0.95);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    border: 1px solid rgba(255,255,255,0.1);
}

.message-modal h3 {
    margin-bottom: 20px;
    color: #fff;
}

.message-modal input {
    width: 100%;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.message-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Scheduled Indicator */
.scheduled-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 20px;
    color: #2ecc71;
    font-size: 0.85rem;
    margin-bottom: 15px;
    justify-content: center;
}

.scheduled-indicator.show { display: flex; }

/* Theme Settings */
.theme-settings {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.theme-colors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

.theme-color-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-color-item label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.theme-color-item .color-picker {
    width: 100%;
    height: 35px;
}

/* Fullscreen Mode */
.fullscreen-timer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 5000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fullscreen-timer.show { display: flex; }

.fullscreen-timer .time {
    font-size: 15vw;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #fff;
}

.fullscreen-timer .label {
    font-size: 2vw;
    color: rgba(255,255,255,0.5);
    margin-top: 20px;
}

.fullscreen-timer .progress-bar-full {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 10px;
    background: rgba(255,255,255,0.5);
    transition: width 0.3s;
}

.fullscreen-timer .exit-hint {
    position: absolute;
    bottom: 30px;
    color: rgba(255,255,255,0.3);
    font-size: 0.9rem;
}

.fullscreen-messages {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: auto;
}

.fullscreen-messages::-webkit-scrollbar {
    width: 8px;
}

.fullscreen-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.fullscreen-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.fullscreen-message-item {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInMessage 0.3s ease-out;
}

@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutMessage {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .timer-display .time { font-size: 4rem; }
    header h1 { font-size: 1.5rem; }
    .timer-card { padding: 20px; }
    .btn { padding: 12px 20px; font-size: 0.9rem; }
    .progress-wrapper { flex-direction: column; }
    .progress-circle { display: none; }
}

@media (max-width: 480px) {
    .timer-display .time { font-size: 3rem; }
    .settings-panel { grid-template-columns: 1fr; }
}

/* Chat Messages Container */
.chat-messages-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.chat-messages-container::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.chat-messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-empty {
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    padding: 40px 20px;
    font-size: 0.9rem;
}

.chat-message {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 15px;
    animation: slideInChat 0.3s ease-out;
}

.chat-message-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.chat-message-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    text-align: right;
}

@keyframes slideInChat {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .chat-panel {
        right: 10px;
        width: 280px;
        top: 70px;
    }
}
