/* CRISIS Launcher - Clean & Professional */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #1f2940;
    --accent-primary: #4a9eff;
    --accent-secondary: #e74c3c;
    --accent-success: #2ecc71;
    --text-primary: #ecf0f1;
    --text-secondary: #a0a8b0;
    --text-muted: #6c7a89;
    --border-color: #2c3e50;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Main Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
}

/* Hide background effects */
.background-grid,
.scan-line {
    display: none;
}

/* Logo Section */
.logo-section {
    text-align: center;
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* Status Section */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator.offline .status-dot {
    background: var(--accent-secondary);
}

.status-indicator.online .status-dot {
    background: var(--accent-success);
}

.status-indicator.online .status-text {
    color: var(--accent-success);
}

/* Login Section */
.login-section {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.login-box h2 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

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

input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="password"]:focus {
    border-color: var(--accent-primary);
}

input[type="password"]::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn-primary:hover {
    background: #3a8ae8;
}

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

.error-message {
    margin-top: 12px;
    color: var(--accent-secondary);
    font-size: 0.9rem;
    min-height: 20px;
}

/* Control Panel */
.control-panel {
    width: 100%;
    max-width: 550px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
}

.control-panel.hidden {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-logout {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--text-muted);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.panel-section {
    margin-bottom: 20px;
}

.panel-section h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Module Grid */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.module-card {
    padding: 14px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.module-card:hover {
    border-color: var(--accent-primary);
}

.module-card.selected {
    border-color: var(--accent-primary);
    background: rgba(74, 158, 255, 0.1);
}

.module-card .module-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.module-card .module-path {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Config Display */
.config-display {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 15px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.85rem;
}

.config-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.config-label {
    color: var(--text-secondary);
}

.config-value {
    color: var(--accent-primary);
    font-weight: 500;
    word-break: break-all;
    text-align: right;
    max-width: 55%;
}

/* Access Toggle */
.access-section {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
}

.access-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 26px;
}

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

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

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.access-status {
    font-size: 1rem;
    font-weight: 600;
}

.access-status.open {
    color: var(--accent-success);
}

.access-status.closed {
    color: var(--accent-secondary);
}

.access-description {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Action Buttons */
.actions-section {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reload {
    background: var(--accent-primary);
    color: white;
}

.btn-reload:hover {
    background: #3a8ae8;
}

.btn-enter {
    background: var(--accent-success);
    color: white;
    text-decoration: none;
}

.btn-enter:hover {
    background: #27ae60;
}

.btn-action.hidden {
    display: none;
}

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

/* Action Status */
.action-status {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-status.success {
    background: rgba(46, 204, 113, 0.15);
    color: var(--accent-success);
}

.action-status.error {
    background: rgba(231, 76, 60, 0.15);
    color: var(--accent-secondary);
}

.action-status.info {
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent-primary);
}

/* Simulation Active Section */
.simulation-active {
    text-align: center;
}

.simulation-active.hidden {
    display: none;
}

.active-indicator {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    position: relative;
}

.active-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--accent-success);
    border-radius: 50%;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 2px solid var(--accent-success);
    border-radius: 50%;
    opacity: 0.4;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

.simulation-active h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-success);
    margin-bottom: 8px;
}

.simulation-active p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.active-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: 2px solid var(--accent-primary);
    border-radius: 8px;
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--accent-primary);
    color: white;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 500px) {
    .container {
        padding: 20px 15px;
    }
    
    .title {
        font-size: 1.6rem;
    }
    
    .module-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .btn-action {
        width: 100%;
    }
    
    .actions-section {
        flex-direction: column;
    }
}
