/* Base styles */
:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-800);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-600);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Room cards */
.room-card {
    background-color: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
}

.room-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Room user list styling */
.room-user-list {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-700);
    font-size: 0.875rem;
    color: var(--gray-400);
    line-height: 1.5;
    max-height: 250px;
    overflow-y: auto;
}

.room-user {
    display: flex;
    align-items: center;
    padding: 4px;
    margin-bottom: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.room-user:hover {
    background-color: var(--gray-700);
}

.room-user-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    margin-right: 8px;
    flex-shrink: 0;
}

.room-user-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Buttons */
button {
    transition: all 0.2s ease-in-out;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.join-room-btn {
    min-width: 80px;
}

/* Volume meter */
#volumeMeter {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, 
        #22c55e 0%,    /* Green for low levels */
        #f59e0b 50%,   /* Orange for mid levels */
        #ef4444 100%   /* Red for high levels */
    );
    transition: height 0.1s ease-out;
    border-radius: 2px;
}

/* NVIDIA AI active state */
#volumeMeter.nvidia-active {
    background: linear-gradient(to top, 
        #22c55e 0%,    /* Green for low levels */
        #f59e0b 50%,   /* Orange for mid levels */
        #ef4444 100%   /* Red for high levels */
    );
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    position: relative;
}

#volumeMeter.nvidia-active::after {
    content: 'AI';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    opacity: 0.8;
}

.volume-meter-container {
    position: relative;
    width: 20px;
    height: 100px;
    background-color: #1f2937;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #374151;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}

.volume-meter-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 100%
    );
    pointer-events: none;
}

.volume-meter-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 4px,
        rgba(0, 0, 0, 0.1) 4px,
        rgba(0, 0, 0, 0.1) 8px
    );
    pointer-events: none;
}

/* Input styling */
input[type="text"],
input[type="range"],
select {
    transition: all 0.2s ease-in-out;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Range input styling */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--gray-700);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* User list styling */
#userList {
    max-height: 300px;
    overflow-y: auto;
}

.user-card {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Status indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-connected {
    background-color: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.status-disconnected {
    background-color: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Room view transitions */
#roomView {
    transition: all 0.3s ease-in-out;
}

#roomView.hidden {
    opacity: 0;
    transform: translateY(20px);
}

/* Audio controls */
.audio-controls {
    display: grid;
    gap: 1rem;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-control label {
    min-width: 100px;
}

/* Responsive design */
@media (max-width: 640px) {
    .room-card {
        margin-bottom: 1rem;
    }

    #userList {
        max-height: 200px;
    }

    .volume-control {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Loading states */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: inherit;
}

/* Error states */
.error {
    border-color: var(--danger);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.user-card {
    background-color: #2d3748;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid #4a5568;
}

.user-card .user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-card .user-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.user-card .user-status.connected {
    background-color: #48bb78;
    box-shadow: 0 0 8px #48bb78;
}

.user-card .user-status.disconnected {
    background-color: #e53e3e;
}

.user-card .user-name {
    font-weight: 500;
}

#muteButton.muted {
    background-color: #4a5568;
}

#muteButton.muted:hover {
    background-color: #2d3748;
}

#screenShareContainer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1600px;
    height: 90vh;
    background-color: rgba(0, 0, 0, 0.95);
    border-radius: 8px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#screenShareContainer.active,
#screenShareContainer:not(.hidden) {
    display: flex;
    opacity: 1;
    visibility: visible;
}

#screenShareVideo {
    width: 100%;
    height: calc(100% - 40px);
    object-fit: contain;
    background-color: #000;
}

#screenShareUser {
    padding: 12px;
    color: white;
    background-color: rgba(0, 0, 0, 0.8);
    font-size: 14px;
}

#closeScreenShare {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    z-index: 1001;
}

#closeScreenShare:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Chat styles */
#chatMessages {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-600) var(--gray-800);
    padding-bottom: 10px;
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
}

#chatMessages::-webkit-scrollbar {
    width: 6px;
}

#chatMessages::-webkit-scrollbar-track {
    background: var(--gray-800);
}

#chatMessages::-webkit-scrollbar-thumb {
    background-color: var(--gray-600);
    border-radius: 3px;
}

.message-bubble {
    max-width: 70%;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    margin-bottom: 12px;
    line-height: 1.4;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-bubble.own {
    background-color: var(--primary);
    border-radius: 12px 12px 2px 12px;
}

.message-bubble.other {
    background-color: var(--gray-700);
    border-radius: 12px 12px 12px 2px;
}

#emojiPicker {
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

#messageInput {
    min-height: 40px;
    resize: none;
    width: 100%;
    flex-grow: 1;
}

#messageInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.emoji-button {
    transition: transform 0.2s;
}

.emoji-button:hover {
    transform: scale(1.1);
}

.user-name-click {
    position: relative;
    padding: 2px 4px;
    border-radius: 4px;
}

.user-name-click:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.user-name-click:active {
    transform: translateY(1px);
}

.user-name-click[data-sharing="true"] {
    color: #60A5FA;
}

.user-name-click[data-sharing="true"]::after {
    content: '📺';
    position: absolute;
    top: -8px;
    right: -12px;
    font-size: 12px;
    opacity: 0.8;
}

/* Modal styles */
#createRoomModal,
#passwordModal,
#shareRoomModal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#createRoomModal.active,
#passwordModal.active,
#shareRoomModal.active {
    opacity: 1;
    visibility: visible;
}

/* Room type indicators */
.room-type-indicator {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.room-type-private {
    background-color: var(--danger);
    color: white;
}

.room-type-custom {
    background-color: var(--warning);
    color: black;
}

/* Empty room indicator */
.room-empty-warning {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    color: var(--danger);
    margin-left: 0.5rem;
    animation: pulse 2s infinite;
}

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

/* Share link */
#shareRoomLink {
    user-select: all;
}

.copy-success {
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Message expiration styles */
.message-expiring {
    opacity: 0.8;
    position: relative;
}

.message-expiring::after {
    content: '⏱️';
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0.7;
}

/* Message deletion styles */
.delete-message-btn {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

#chatMessages > div:hover .delete-message-btn {
    opacity: 0.7;
}

.delete-message-btn:hover {
    opacity: 1 !important;
}

.deleting {
    transition: all 0.3s ease-in-out;
}

/* Chat toggle styles */
#roomView .w-2\/3,
#roomView .w-1\/3 {
    transition: all 0.3s ease-in-out;
}

#toggleChatButton {
    transition: background-color 0.2s ease-in-out;
}

/* NVIDIA toggle specific styling */
#nvidiaNoiseSuppressionToggle:checked + .toggle-slider {
    background-color: #76b900; /* NVIDIA green */
}

#nvidiaNoiseSuppressionToggle:checked + .toggle-slider:before {
    background-color: white;
}

.nvidia-toggle-container {
    border-left: 2px solid #76b900;
    padding-left: 12px;
    margin-left: 4px;
}

/* Volume meter NVIDIA active state */
#volumeMeter.nvidia-active {
    background: linear-gradient(to top, 
        #22c55e 0%,    /* Green for low levels */
        #f59e0b 50%,   /* Orange for mid levels */
        #ef4444 100%   /* Red for high levels */
    );
    box-shadow: 0 0 10px rgba(118, 185, 0, 0.5); /* NVIDIA green glow */
    position: relative;
}

#volumeMeter.nvidia-active::after {
    content: 'RTX';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    opacity: 0.8;
}

.volume-meter {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.volume-meter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff00, #00ff88);
    transition: width 0.1s ease;
}

.volume-meter.nvidia-active {
    height: 6px;
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.volume-meter.nvidia-active::before {
    background: linear-gradient(90deg, #00ff88, #00ffff);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.rtx-indicator {
    position: absolute;
    top: -20px;
    right: 0;
    font-size: 12px;
    color: #00ff88;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
    font-weight: bold;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.volume-meter.nvidia-active .rtx-indicator {
    opacity: 1;
    transform: translateY(0);
} 