:root {
    --bg-gradient-start: #0a0b10;
    --bg-gradient-end: #161922;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #8c909a;
    --accent-glow: #6f5af6;
    --accent-glow-secondary: #ff3366;
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-focus-border: rgba(111, 90, 246, 0.5);
    --success: #00e676;
    --error: #ff1744;
    --connecting: #ffeb3b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 420px;
    min-height: 100vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* Header */
.brand-header {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.logo-icon {
    font-size: 3rem;
    color: var(--accent-glow);
    text-shadow: 0 0 20px rgba(111, 90, 246, 0.4);
    margin-bottom: 8px;
    animation: pulse 2.5s infinite alternate;
}

.brand-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Connection Card */
.connection-card {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Stats */
.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-item {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Form */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-group input, 
.input-group select {
    width: 100%;
    height: 48px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus, 
.input-group select:focus {
    border-color: var(--accent-glow);
    box-shadow: 0 0 10px rgba(111, 90, 246, 0.15);
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 48px;
}

.password-wrapper button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    outline: none;
}

/* Connect Action Area */
.connect-action-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn-connect {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none;
    transition: all 0.4s ease;
}

.btn-connect .btn-icon {
    font-size: 1.8rem;
    color: var(--text-primary);
}

.btn-connect.disconnected {
    background: linear-gradient(135deg, #1f2230 0%, #2f344d 100%);
    border: 4px solid var(--card-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-connect.connected {
    background: linear-gradient(135deg, #4b3cd3 0%, var(--accent-glow) 100%);
    border: 4px solid rgba(111, 90, 246, 0.4);
    box-shadow: 0 0 25px rgba(111, 90, 246, 0.6);
    animation: connecting-pulse 2s infinite;
}

.btn-connect.connecting {
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    border: 4px solid rgba(255, 143, 0, 0.4);
    box-shadow: 0 0 25px rgba(255, 143, 0, 0.6);
    animation: rotation 2s infinite linear;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.status-badge.connected {
    color: var(--success);
    border-color: rgba(0, 230, 118, 0.3);
    background: rgba(0, 230, 118, 0.05);
}

.status-badge.connecting {
    color: var(--connecting);
    border-color: rgba(255, 235, 59, 0.3);
    background: rgba(255, 235, 59, 0.05);
}

.status-badge.disconnected {
    color: var(--text-secondary);
}

.timer {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timer.visible {
    opacity: 1;
}

/* Footer */
.app-footer {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    opacity: 0.6;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.05);
        opacity: 1;
        text-shadow: 0 0 30px rgba(111, 90, 246, 0.6);
    }
}

@keyframes connecting-pulse {
    0% {
        box-shadow: 0 0 15px rgba(111, 90, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 35px rgba(111, 90, 246, 0.8);
    }
    100% {
        box-shadow: 0 0 15px rgba(111, 90, 246, 0.5);
    }
}

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