:root {
    --primary: #00f2fe;
    --primary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-gradient: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-muted: #a0aec0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Animated Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.6;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    background: #4facfe;
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
}

.blob-2 {
    background: #10b981;
    width: 250px;
    height: 250px;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

#app {
    width: 400px;
    height: 800px;
    max-height: 95vh;
    border-radius: 40px;
    background: rgba(10, 10, 15, 0.6);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 30px 20px;
    z-index: 10;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#status-indicator {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
}

.status-offline { color: var(--danger); }
.status-connecting { color: var(--warning); }
.status-online { 
    color: var(--success); 
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.4) !important;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: opacity 0.4s ease, transform 0.4s ease;
    animation: fadeIn 0.4s ease forwards;
}

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

.hidden {
    display: none !important;
}

/* Typography & Forms */
h2 {
    text-align: center;
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 1.4rem;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 15px 15px 15px 45px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input::placeholder {
    color: rgba(255,255,255,0.3);
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.2);
}

/* Toggle Switch */
.switch-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.switch-group label {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    width: 46px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: .4s;
    border: 1px solid var(--glass-border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

input:checked + .slider {
    background: var(--primary-gradient);
    border-color: transparent;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Buttons */
.btn {
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    color: white;
}

.btn:active { transform: scale(0.96); }

.btn-primary { background: var(--primary-gradient); }
.btn-primary:hover { box-shadow: 0 5px 15px rgba(0, 242, 254, 0.4); }

.btn-success { background: var(--success); }
.btn-success:hover { box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4); }

.btn-secondary { background: rgba(255, 255, 255, 0.15); border: 1px solid var(--glass-border); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.25); }

.btn-small { padding: 8px 12px; font-size: 0.85rem; width: auto; border-radius: 8px; gap: 5px; }

.btn-circle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    font-size: 1.5rem;
    padding: 0;
}

/* Dialpad */
.active-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

#current-username { color: var(--text); font-weight: bold; }

.dialpad-display {
    position: relative;
    margin-bottom: 25px;
}

#target-number {
    font-size: 2.2rem;
    text-align: center;
    letter-spacing: 2px;
    padding: 5px 45px;
    background: transparent;
    border: none;
    font-weight: 300;
}

.dialpad-delete {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.4rem;
    transition: color 0.2s;
}

.dialpad-delete:hover, .dialpad-delete:active { color: var(--danger); }

.dialpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    flex-grow: 1;
}

.dial-key {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    aspect-ratio: 1;
    color: var(--text);
    font-size: 1.8rem;
    font-weight: 400;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dial-key span {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
    letter-spacing: 1px;
}

.dial-key:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.dial-key:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.92);
}

/* Active Call */
.call-pulse {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.call-avatar {
    font-size: 6rem;
    color: var(--primary);
    text-shadow: 0 0 30px rgba(0, 242, 254, 0.5);
    z-index: 2;
    position: relative;
    background: rgba(10, 10, 15, 0.8);
    border-radius: 50%;
}

.call-pulse::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0,242,254,0.4) 0%, rgba(0,242,254,0) 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite ease-out;
}

@keyframes pulse {
    0% { width: 100px; height: 100px; opacity: 1; }
    100% { width: 300px; height: 300px; opacity: 0; }
}

.call-number {
    font-size: 2.2rem;
    text-align: center;
    font-weight: 300;
    margin-bottom: 5px;
}

.call-duration {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: auto;
    font-variant-numeric: tabular-nums;
}

.call-actions, .incoming-actions {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

/* Incoming Modal Override */
.incoming-modal {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 32, 39, 0.95);
    z-index: 100;
    backdrop-filter: blur(20px);
    border-radius: 40px;
    justify-content: center;
    border: none;
}

.ringing-animation {
    font-size: 5rem;
    color: var(--success);
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
    animation: ring 1s infinite ease-in-out alternate;
}

@keyframes ring {
    0% { transform: scale(1) rotate(-15deg); }
    100% { transform: scale(1.1) rotate(15deg); }
}

.caller-id {
    font-size: 2.5rem;
    text-align: center;
    font-weight: 300;
    color: var(--text);
    margin-bottom: 40px;
}

#mute-btn.muted {
    background: var(--danger);
    color: white;
    border-color: transparent;
}
