* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(
        125deg,
        #000000 0%,
        #200730 10%,
        #001B3D 15%,
        #071f3a 30%,
        #13816d 45%,
        #000000 60%,
        #073a5a 75%,
        #4d085e 90%,
        #000000 100%
    );
    background-size: 400% 400%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    animation: subtleWave 30s ease infinite;
}

@keyframes subtleWave {
    0% {
        background-position: 0% 50%;
        filter: brightness(1) saturate(1);
    }
    25% {
        background-position: 50% 25%;
        filter: brightness(1.1) saturate(1.1);
    }
    50% {
        background-position: 100% 50%;
        filter: brightness(1.2) saturate(1.2);
    }
    75% {
        background-position: 50% 75%;
        filter: brightness(1.1) saturate(1.1);
    }
    100% {
        background-position: 0% 50%;
        filter: brightness(1) saturate(1);
    }
}

.login-container {
    position: relative;
    z-index: 2;
    background: rgba(8, 32, 50, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 2.2em;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 157, 255, 0.2);
    letter-spacing: 1px;
}

.login-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95em;
}

.form-group {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(0, 157, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 157, 255, 0.1);
}

.button-container {
    width: 100%;
    display: flex;
    justify-content: center;
}
.room-buttons-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.room-button {
    width: 100%;
    padding: 16px 28px;
    border: none;
    border-radius: 16px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.room-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.room-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: rgba(65, 89, 97, 0.15);
}

.room-button:hover::before {
    left: 100%;
}

.create-room {
    background: linear-gradient(135deg, rgba(88, 43, 255, 0.2), rgba(33, 150, 243, 0.2));
    border: 1px solid rgba(88, 43, 255, 0.3);
}

.join-room {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(156, 39, 176, 0.2));
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.divider {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}

.divider span {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
}

.divider .orb {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: relative;
    animation: pulse 2s infinite;
}

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

.room-button:active {
    transform: scale(0.98);
}

.join-room-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.join-room-modal.active {
    opacity: 1;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: linear-gradient(145deg, 
        rgba(23, 32, 42, 0.95), 
        rgba(28, 40, 51, 0.95)
    );
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 
        0 0 30px rgba(52, 152, 219, 0.25),
        0 0 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 20px rgba(255, 255, 255, 0.05);
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: visible;
}

.join-room-modal.active .modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding-top: 0.5rem;
}

.modal-header h2 {
    color: #fff;
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: linear-gradient(to right, #3498db, #2980b9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.close-btn {
    position: absolute;
    right: -12px;
    top: -12px;
    width: 32px;
    height: 32px;
    background: rgba(231, 76, 60, 0.95);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
    z-index: 1002;
}

.close-btn:hover {
    background: #e74c3c;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

.code-input-container {
    margin-bottom: 1.5rem;
    position: relative;
}

.room-code-input {
    width: 100%;
    padding: 1.2rem;
    font-size: 2rem;
    text-align: center;
    letter-spacing: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(52, 152, 219, 0.3);
    border-radius: 12px;
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 transparent;
}

.room-code-input:focus {
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(52, 152, 219, 0.2);
    outline: none;
}

.room-code-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: normal;
}

.join-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
    position: relative;
    overflow: hidden;
}

.join-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.join-btn:hover {
    background: linear-gradient(135deg, #2980b9, #2475a7);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(52, 152, 219, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.1);
}

.join-btn:hover::before {
    left: 100%;
}

.join-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.modal-body {
    padding: 0 1rem;
}

/* Mobile optimization */
@media screen and (max-width: 480px) {
    .modal-content {
        width: 95%;
        padding: 2rem;
    }

    .room-code-input {
        font-size: 1.75rem;
        padding: 1rem;
    }

    .join-btn {
        padding: 1rem;
        font-size: 1.1rem;
    }

    .close-btn {
        right: -8px;
        top: -8px;
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        background-size: 200% 200%;
        animation: none;
    }
    .login-container {
        width: 90%;
        max-width: 350px;
        padding: 25px;
        margin: 15px auto;
        transform: translateX(-2%);
    }

    .form-group input {
        padding: 12px 16px;
        font-size: 15px;
        height: 44px;
    }

    .login-button {
        padding: 12px 16px;
        font-size: 14px;
        height: 44px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .login-container {
        width: 85%;
        padding: 20px;
        margin: 10px auto;
    }

    .login-header h1 {
        font-size: 1.6em;
    }

    .login-header p {
        font-size: 0.85em;
    }
}

/* Add support for different screen orientations */
@media (orientation: landscape) and (max-height: 600px) {
    .login-container {
        padding: 20px;
        margin: 10px;
    }

    .login-header {
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 15px;
    }
}

/* Add support for high-DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login-container {
        backdrop-filter: blur(12px);
    }
}

/* Ensure animations run smoothly on mobile */
@media (prefers-reduced-motion: no-preference) {
    .login-button:hover {
        transition: all 0.3s ease;
    }
}

/* Optimize for devices that prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    body {
        animation: subtleWave 45s ease infinite;
    }

    .login-button:hover {
        transform: none;
    }
}

/* Add touch device optimizations */
@media (hover: none) {
    .login-button:active {
        background: linear-gradient(135deg, #0067B5, #004C98);
        transform: translateY(1px);
    }
}

/* Ensure minimum touch target sizes for mobile */
@media (pointer: coarse) {
    .login-button {
        min-height: 44px;
    }

    .form-group input {
        min-height: 44px;
    }
}
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(8, 32, 50, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px 20px;
    color: white;
    font-size: 14px;
    z-index: 9999;
    transform: translateX(120%);
    animation: notificationSlideIn 0.3s forwards;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 300px;
}

.notification.error {
    border-left: 4px solid #e74c3c;
}

.notification.success {
    border-left: 4px solid #2ecc71;
}

.notification.info {
    border-left: 4px solid #3498db;
}

.notification .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.notification .progress-bar::after {
    content: '';
    position: absolute;
    height: 100%;
    width: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.8),
        rgba(255, 255, 255, 0.6)
    );
    transform-origin: left;
    animation: progress 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.notification.error .progress-bar::after {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.notification.success .progress-bar::after {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.notification.info .progress-bar::after {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.notification.fade-out {
    animation: notificationSlideOut 0.3s forwards;
}

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

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

@keyframes progress {
    0% {
        transform: scaleX(1);
    }
    100% {
        transform: scaleX(0);
    }
}



/* ROOM MANAGER CSS  */
.room-manager-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.room-manager-overlay.active {
    opacity: 1;
    visibility: visible;
}

.room-manager-modal {
    background: rgba(23, 32, 42, 0.95);
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: all 0.3s ease;
    animation: modalSlideIn 0.3s ease;
    position: relative;
}

.room-manager-overlay.active .room-manager-modal {
    transform: translateY(0);
}

.room-manager-header {
    text-align: center;
    margin-bottom: 2rem;
}

.room-manager-header h2 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.room-manager-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.room-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.room-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(52, 152, 219, 0.1);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.room-item:hover {
    border-color: rgba(52, 152, 219, 0.3);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.room-info {
    flex: 1;
}

.room-code {
    color: #3498db;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

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

.room-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    justify-content: flex-end;
    min-width: 160px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.room-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    min-width: 70px;
}

.join-btn {
    background: #3498db;
    color: white;
}

.join-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.delete-btn {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.delete-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.1);
}

.create-new-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.create-new-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.create-new-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.no-rooms-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-style: italic;
}

.room-manager-modal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.room-manager-modal.loading::after {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: none;
}

.room-manager-modal.loading .loading-spinner {
    display: block;
}