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

body {
    font-family: 'Inter', sans-serif;
    background: #000000;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Animation */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #1a0a1a 100%);
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 20s linear infinite;
}

.nebula {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(25, 25, 112, 0.15) 0%, transparent 70%);
    animation: nebulaFloat 15s ease-in-out infinite;
}

@keyframes twinkle {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-100px); }
}

@keyframes nebulaFloat {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.3; }
    50% { transform: scale(1.1) rotate(180deg); opacity: 0.6; }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out;
}

.logo {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(45deg, #4a0080, #191970, #8b0000);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.2rem;
    color: #a0a0a0;
    font-weight: 300;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

/* Main Content */
.main-content {
    text-align: center;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-section h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.hero-section p {
    font-size: 1.1rem;
    color: #b0b0b0;
    margin-bottom: 2rem;
}

/* Login Button */
.login-btn {
    background: linear-gradient(45deg, #4a0080, #191970);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(74, 0, 128, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(74, 0, 128, 0.4);
}

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

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    background: rgba(10, 10, 20, 0.95);
    border: 1px solid rgba(74, 0, 128, 0.3);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.popup-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.close-btn {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #ffffff;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(74, 0, 128, 0.3);
    border-radius: 10px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: #4a0080;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(74, 0, 128, 0.3);
}

.input-group input::placeholder {
    color: #a0a0a0;
}

.input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #4a0080, #191970);
    transition: width 0.3s ease;
}

.input-group input:focus + .input-border {
    width: 100%;
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(45deg, #4a0080, #191970);
    border: none;
    padding: 1rem;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(74, 0, 128, 0.4);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #a0a0a0;
    font-size: 0.9rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(160, 160, 160, 0.3);
}

.login-divider span {
    padding: 0 1rem;
}

/* Biometric Login Button */
.biometric-btn {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(138, 43, 226, 0.5);
    border-radius: 50px;
    color: #8a2be2;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.biometric-btn:hover {
    background: rgba(138, 43, 226, 0.1);
    border-color: #8a2be2;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.3);
}

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

.biometric-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #1a0a1a 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.5s ease;
}

.loading-screen.active {
    display: flex;
}

.loading-content {
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

/* Logo Animation */
.serververse-logo {
    margin-bottom: 2rem;
}

.logo-circle {
    width: 120px;
    height: 120px;
    border: 3px solid transparent;
    border-radius: 50%;
    background: linear-gradient(45deg, #4a0080, #191970, #8b0000) border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: rotate 2s linear infinite;
    position: relative;
}

.logo-circle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(45deg, #4a0080, #191970, #8b0000);
    animation: rotate 2s linear infinite reverse;
    z-index: -1;
}

.logo-inner {
    width: 100px;
    height: 100px;
    background: rgba(10, 10, 20, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #4a0080, #191970);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Loading Text */
.loading-text h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #4a0080;
    border-radius: 50%;
    animation: dotPulse 1.5s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Progress Bar */
.loading-progress {
    margin-top: 2rem;
}

.progress-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #4a0080, #191970);
    border-radius: 2px;
    width: 0%;
    animation: progressFill 3s ease-in-out forwards;
}

.progress-text {
    color: #a0a0a0;
    font-size: 0.9rem;
    animation: textChange 3s ease-in-out infinite;
}

@keyframes progressFill {
    0% { width: 0%; }
    25% { width: 30%; }
    50% { width: 60%; }
    75% { width: 85%; }
    100% { width: 100%; }
}

@keyframes textChange {
    0%, 20% { content: "Initializing..."; }
    25%, 45% { content: "Connecting..."; }
    50%, 70% { content: "Loading assets..."; }
    75%, 95% { content: "Almost ready..."; }
    100% { content: "Welcome!"; }
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 3rem;
    }
    
    .hero-section h2 {
        font-size: 2rem;
    }
    
    .popup-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .logo-circle {
        width: 100px;
        height: 100px;
    }
    
    .logo-inner {
        width: 80px;
        height: 80px;
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    .progress-bar {
        width: 250px;
    }
}
