:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --card-bg: rgba(15, 23, 42, 0.6);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Animations */
.background-orbs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #3b82f6, #8b5cf6);
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #10b981, #0ea5e9);
    animation-delay: -5s;
}

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

/* Main Container */
.container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    z-index: 1;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.highlight {
    color: var(--primary);
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 5px;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-5px);
}

/* Status Indicator */
.status-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.status-indicator {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.status-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--text-muted);
    z-index: 2;
    transition: background-color 0.4s ease;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(148, 163, 184, 0.2);
    z-index: 1;
    transform: scale(0);
    transition: background-color 0.4s ease;
}

.status-connected .status-dot {
    background-color: var(--success);
    box-shadow: 0 0 20px var(--success);
}

.status-connected .pulse-ring {
    background-color: rgba(16, 185, 129, 0.2);
    animation: pulse 2s infinite;
}

.status-disconnected .status-dot {
    background-color: var(--danger);
    box-shadow: 0 0 20px var(--danger);
}

@keyframes pulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

#statusText {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Button Controls */
.controls-section {
    width: 100%;
    margin-bottom: 30px;
}

.toggle-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 10px 20px -10px var(--primary);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.toggle-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px var(--primary);
}

.toggle-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toggle-btn.btn-danger {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    box-shadow: 0 10px 20px -10px #e11d48;
}

.toggle-btn.btn-danger:hover:not(:disabled) {
    box-shadow: 0 15px 25px -10px #e11d48;
}

.toggle-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: linear-gradient(135deg, #64748b, #475569);
    box-shadow: none;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

.loading .spinner {
    display: block;
}

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

/* Stats Grid */
.stats-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.stats-grid.active {
    opacity: 1;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.full-width {
    grid-column: span 2;
}

.stat-icon {
    font-size: 1.5rem;
    margin-right: 12px;
    background: rgba(255,255,255,0.1);
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Toast */
.toast-notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 1000;
}

.toast-notification.show {
    bottom: 30px;
}

/* Actions Grid */
.actions-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    padding: 12px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.action-btn .icon {
    font-size: 1.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    max-width: 90%;
    width: 350px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    padding: 30px;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--text-color);
}

#qrContainer {
    background: white;
    padding: 15px;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

#qrCanvas {
    display: block;
    margin: 0 auto;
}

/* System Resources */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 25px 0 15px 0;
    color: var(--text-color);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.system-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.sys-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sys-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sys-icon {
    font-size: 1.2rem;
}

.sys-label {
    flex-grow: 1;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sys-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.speed-value {
    font-size: 1.1rem;
    color: var(--accent-blue);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 4px;
    transition: width 0.5s ease-out;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}
