:root {
    --bg-dark: #0a0a0a;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #2196f3;
    --accent-glow: rgba(33, 150, 243, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --error: #ff4d4d;
    --success: #00e676;
}

/* Splash Screen */
.splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.splash.fade-out {
    opacity: 0;
    visibility: hidden;
}

.pulse-logo {
    width: 120px;
    height: 120px;
    animation: pulse 1.5s infinite ease-in-out;
    border-radius: 24px;
    box-shadow: 0 0 30px var(--accent-glow);
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 500px;
    height: 100dvh;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    background: radial-gradient(circle at top right, #1a237e 0%, transparent 40%),
                radial-gradient(circle at bottom left, #311b92 0%, transparent 40%);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.screen {
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

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

/* Login Screen */
#login-screen {
    justify-content: center;
}

.logo-container {
    text-align: center;
    margin-bottom: 32px;
}

.app-logo {
    width: 90px;
    height: 90px;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 0 20px var(--accent-glow);
}

h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.logo-container p {
    color: var(--text-secondary);
    font-size: 14px;
}

.input-group {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: border-color 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.input-group i {
    color: var(--text-secondary);
    margin-right: 12px;
    pointer-events: none;
}

.input-group input {
    background: transparent;
    border: none;
    color: white;
    padding: 16px 0;
    flex: 1;
    min-width: 0;
    outline: none;
    font-size: 16px;
    z-index: 10;
    cursor: text;
}

.selected-command-view {
    margin-top: 20px;
}

#confirmation-msg {
    margin-bottom: 15px;
    font-size: 16px;
    text-align: center;
}

.msg-success { color: var(--success); }
.msg-error { color: var(--error); }

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-primary:active {
    transform: scale(0.98);
}

.error-msg {
    color: var(--error);
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
}

/* Checkbox Styling */
.remember-group {
    margin-top: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 32px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: -2px;
    left: 0;
    height: 22px;
    width: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--glass-border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--accent);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 2px;
    width: 5px;
    height: 11px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* Dashboard Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.accent {
    color: var(--accent);
}

.btn-icon {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.header-right {
    display: flex;
    gap: 8px;
}

/* Status Card */
.status-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.status-item {
    display: flex;
    justify-content: space-between;
}

.label {
    color: var(--text-secondary);
    font-size: 13px;
}

.online {
    color: var(--success);
    font-weight: bold;
}

/* Command Section */
h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.command-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.command-btn {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    color: white;
}

.command-btn i {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 50%;
    color: var(--accent);
}

.command-btn:hover, .command-btn.active {
    background: rgba(33, 150, 243, 0.1);
    border-color: var(--accent);
}

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

.cmd-desc {
    font-weight: 700;
    font-size: 19px; /* Increased from 16px */
    margin-bottom: 2px;
}

.cmd-code {
    color: var(--text-secondary);
    font-size: 11px; /* Decreased from 12px */
    opacity: 0.8;
}

/* Color Overrides (Always Visible) */
.command-btn.btn-blue i {
    color: var(--accent);
    background: rgba(33, 150, 243, 0.15);
}

.command-btn.btn-blue {
    border-color: rgba(33, 150, 243, 0.3);
}

.command-btn.btn-blue:hover, .command-btn.btn-blue.active {
    background: rgba(33, 150, 243, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.2);
}

.command-btn.btn-red i {
    color: #ff5252;
    background: rgba(255, 82, 82, 0.15);
}

.command-btn.btn-red {
    border-color: rgba(255, 82, 82, 0.3);
}

.command-btn.btn-red:hover, .command-btn.btn-red.active {
    background: rgba(255, 82, 82, 0.1);
    border-color: #ff5252;
    box-shadow: 0 0 15px rgba(255, 82, 82, 0.2);
}

.command-btn.btn-green i {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.15);
}

.command-btn.btn-green {
    border-color: rgba(76, 175, 80, 0.3);
}

.command-btn.btn-green:hover, .command-btn.btn-green.active {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4caf50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.2);
}

#action-confirm {
    text-align: center;
    padding: 24px;
    background: rgba(33, 150, 243, 0.05);
    border-radius: 16px;
    border: 1px dashed var(--accent);
    margin-top: 16px;
    animation: fadeIn 0.3s ease-out;
}

#confirmation-msg {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

.text-red { color: #ff5252; font-weight: bold; }
.text-green { color: #4caf50; font-weight: bold; }
.text-blue { color: var(--accent); font-weight: bold; }

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    padding: 24px;
}

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

.input-field-group {
    margin-bottom: 16px;
}

.input-field-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-field-group input {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px;
    color: white;
    outline: none;
}

.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent);
}

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

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}
