:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-bg: #0f0f15;
    --dark-card: #1a1a24;
    --dark-surface: #242435;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --border-color: rgba(139, 92, 246, 0.2);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 35px 60px -12px rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 90%;
    text-align: center;
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--primary-gradient);
    opacity: 0.6;
}

.modal h2 {
    margin-bottom: 30px;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--dark-surface);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    transform: translateY(-1px);
}

.btn {
    background: var(--primary-gradient);
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 6px;
    min-width: 140px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 32px 64px -12px rgba(139, 92, 246, 0.4);
}

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

.btn-secondary {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-danger {
    background: var(--secondary-gradient);
}

/* SVG Icons */
.icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Public Rooms List */
.rooms-list {
    max-height: 320px;
    overflow-y: auto;
    margin: 24px 0;
    padding-right: 8px;
}

.room-item {
    background: rgba(26, 26, 36, 0.8);
    backdrop-filter: blur(20px);
    margin-bottom: 12px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.room-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.room-item:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.15);
    background: rgba(26, 26, 36, 0.95);
}

.room-item:hover::before {
    opacity: 1;
}

.room-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.room-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.room-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-creator {
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 0.8;
}

.room-users {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
}

.room-users .icon {
    width: 12px;
    height: 12px;
    color: var(--success);
}

.no-rooms {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Share Modal */
.share-info {
    background: rgba(16, 185, 129, 0.1);
    padding: 24px;
    border-radius: 16px;
    margin: 24px 0;
    border-left: 4px solid #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.share-url {
    background: var(--dark-bg);
    padding: 16px;
    border-radius: 12px;
    font-family: 'Monaco', 'Menlo', monospace;
    word-break: break-all;
    margin: 12px 0;
    border: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

.copy-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    margin-left: 12px;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-purple);
    animation: spin 1s ease-in-out infinite;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--dark-surface);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    z-index: 3000;
    animation: toastSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.fade-out {
    animation: toastSlideOut 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .modal-content {
        margin: 20px;
        padding: 32px;
    }

    .btn {
        min-width: 120px;
        padding: 12px 24px;
    }
}

@media (max-width: 480px) {
    .modal h2 {
        font-size: 24px;
    }

    .btn {
        min-width: 100px;
        padding: 12px 20px;
        font-size: 14px;
    }

    .toast {
        top: 16px;
        right: 16px;
        left: 16px;
    }
}

/* Scrollbar Styling */
.rooms-list::-webkit-scrollbar {
    width: 6px;
}

.rooms-list::-webkit-scrollbar-track {
    background: transparent;
}

.rooms-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.rooms-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}