/* Advanced page styles */
body.advanced {
    font-family: monospace;
    padding: 20px;
    background: #1e1e1e;
    color: #d4d4d4;
    margin: 0;
}

body.advanced h1 {
    margin-top: 0;
}

body.advanced .status {
    margin: 10px 0;
}

body.advanced .connected {
    color: #4ec9b0;
}

body.advanced .disconnected {
    color: #f48771;
}

body.advanced .section {
    margin-top: 30px;
    padding: 15px;
    background: #252526;
    border-radius: 4px;
}

body.advanced .section h3 {
    margin-top: 0;
}

body.advanced .key-display {
    margin: 10px 0;
    padding: 10px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    word-break: break-all;
    font-size: 0.9em;
    max-height: 200px;
    overflow-y: auto;
}

body.advanced button {
    background: #0e639c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    margin-right: 10px;
    margin-top: 10px;
}

body.advanced button:hover {
    background: #1177bb;
}

body.advanced button:disabled {
    background: #3e3e42;
    cursor: not-allowed;
}

body.advanced button.danger-button {
    background: #dc2626;
    font-weight: bold;
}

body.advanced button.danger-button:hover:not(:disabled) {
    background: #b91c1c;
}

body.advanced .alert {
    padding: 12px;
    margin: 10px 0;
    border-radius: 4px;
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

body.advanced .success {
    background: #d1fae5;
    color: #065f46;
    border-left-color: #10b981;
}

body.advanced .error {
    background: #fee2e2;
    color: #991b1b;
    border-left-color: #ef4444;
}

/* Mobile-first main page styles */
body.mobile-first {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #ffffff;
    margin: 0;
}

body.mobile-first * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.mobile-first .container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

body.mobile-first h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

body.mobile-first .version {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 3rem;
}

body.mobile-first .auth-status {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

body.mobile-first .auth-status.authenticated {
    background: rgba(72, 187, 120, 0.2);
}

body.mobile-first .auth-status.not-authenticated {
    background: rgba(245, 101, 101, 0.2);
}

body.mobile-first .button-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

body.mobile-first button {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border: none;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    -webkit-tap-highlight-color: transparent;
}

body.mobile-first button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: #ffffff;
}

body.mobile-first button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.mobile-first button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.mobile-first button.primary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    font-size: 1.5rem;
    padding: 1.5rem 2rem;
}

body.mobile-first button.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

body.mobile-first button.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.875rem;
    padding: 0.75rem 1.5rem;
}

body.mobile-first .status-message {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

body.mobile-first .status-message.error {
    background: rgba(245, 101, 101, 0.2);
}

body.mobile-first .status-message.success {
    background: rgba(72, 187, 120, 0.2);
}

body.mobile-first .status-message.info {
    background: rgba(66, 153, 225, 0.2);
}

body.mobile-first .advanced-link {
    margin-top: 2rem;
}

body.mobile-first .advanced-link a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 2px;
    transition: all 0.3s ease;
}

body.mobile-first .advanced-link a:hover {
    color: white;
    border-bottom-color: white;
}

body.mobile-first .loading {
    opacity: 0.7;
    pointer-events: none;
}

@media (max-width: 480px) {
    body.mobile-first h1 {
        font-size: 1.75rem;
    }

    body.mobile-first button {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    body.mobile-first button.primary {
        font-size: 1.25rem;
        padding: 1.25rem 1.5rem;
    }
}

/* Mobile index page styles - same design as advanced */
body.mobile-index {
    font-family: monospace;
    padding: 0;
    background: #1e1e1e;
    color: #d4d4d4;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.mobile-index .main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

body.mobile-index .icon-button {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

body.mobile-index .icon-button:active {
    transform: scale(0.95);
}

body.mobile-index .icon-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.mobile-index .icon-display {
    text-align: center;
}

body.mobile-index .icon-large {
    width: 200px;
    height: 200px;
}

body.mobile-index .power-icon {
    color: #0e639c;
}

body.mobile-index .key-image {
    width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

body.mobile-index .key-image.pending {
    opacity: 0.4;
    filter: grayscale(100%);
}

body.mobile-index .key-image.ready {
    opacity: 1;
    filter: brightness(1.1) saturate(1.2);
}

body.mobile-index .icon-label {
    font-size: 2rem;
    font-weight: bold;
    color: #d4d4d4;
    text-align: center;
}

body.mobile-index .status-text {
    font-size: 1.5rem;
    color: #d4d4d4;
    text-align: center;
}

body.mobile-index .advanced-link-bottom {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: #4a9eff;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid #4a9eff;
    border-radius: 4px;
    transition: all 0.2s ease;
}

body.mobile-index .advanced-link-bottom:hover {
    background: #4a9eff;
    color: #1e1e1e;
}

body.mobile-index .error-toast {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #f48771;
    color: #1e1e1e;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 0.875rem;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

@media (max-width: 480px) {
    body.mobile-index .icon-button,
    body.mobile-index .icon-display {
        width: 150px;
        height: 150px;
    }

    body.mobile-index .icon-label {
        font-size: 1.5rem;
    }

    body.mobile-index .status-text {
        font-size: 1.25rem;
    }

    body.mobile-index .main-container {
        gap: 1.5rem;
    }
}