/* ProxyPass - Global Styles */
/* Colors from Design System */
:root {
    --color-bg-primary: #0F172A;
    --color-bg-secondary: #1E293B;
    --color-border: #334155;
    --color-border-subtle: #1E293B;
    --color-text-primary: #F8FAFC;
    --color-text-secondary: #E2E8F0;
    --color-text-muted: #94A3B8;
    --color-text-subtle: #64748B;
    --color-text-dim: #CBD5E1;
    --color-accent-orange: #F59E0B;
    --color-accent-red: #EF4444;
    --color-gradient: linear-gradient(90deg, #F59E0B, #EF4444);
}

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

/* Remove all focus outlines */
*:focus,
*:focus-visible {
    outline: none !important;
}

/* Only show focus outlines on interactive elements for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-accent-orange) !important;
    outline-offset: 2px;
}

html, body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Utility Classes */
.gradient-text {
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-bg {
    background: var(--color-gradient);
}

.gradient-border {
    border: 2px solid transparent;
    background: linear-gradient(var(--color-bg-primary), var(--color-bg-primary)) padding-box,
                var(--color-gradient) border-box;
}

/* Buttons */
.btn-primary {
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-text-primary);
    background: var(--color-gradient);
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

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

.btn-cta {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--color-bg-primary);
    background: var(--color-gradient);
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(245, 158, 11, 0.3);
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--color-text-muted);
    vertical-align: middle;
    margin-left: 0.25rem;
}

.btn-icon:hover {
    color: var(--color-accent-orange);
}

/* Links */
a {
    color: var(--color-text-muted);
    text-decoration: none;
}

a:hover {
    color: var(--color-accent-orange);
}

/* Error Handling */
.blazor-error-boundary {
    background: var(--color-accent-red);
    padding: 1rem;
    color: white;
    border-radius: 8px;
    margin: 1rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

#blazor-error-ui {
    background: var(--color-accent-red);
    color: white;
    padding: 0.5rem 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    display: none;
}

#blazor-error-ui[data-nosnippet] {
    display: none;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}

/* Forms */
.form-control {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent-orange);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.form-control::placeholder {
    color: var(--color-text-subtle);
}

/* Cards */
.card {
    padding: 2rem;
    border-radius: 12px;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
}

/* Reconnect Modal */
.reconnect-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.reconnect-modal.visible {
    opacity: 1;
    visibility: visible;
}

.reconnect-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
}

.reconnect-content {
    position: relative;
    text-align: center;
    padding: 3rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
}

.reconnect-icon {
    margin-bottom: 1.5rem;
}

.reconnect-logo {
    width: 80px;
    height: 80px;
}

/* Animated dots for reconnecting state */
.reconnect-modal:not(.reconnect-failed-modal) .dot {
    animation: dotPulse 1.5s ease-in-out infinite;
}

.dot-1 { animation-delay: 0s; }
.dot-2 { animation-delay: 0.2s; }
.dot-3 { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Transform origin for dots */
.dot-1 { transform-origin: 20px 32px; }
.dot-2 { transform-origin: 32px 32px; }
.dot-3 { transform-origin: 46px 32px; }

.reconnect-icon-failed .reconnect-logo {
    opacity: 0.6;
}

.reconnect-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.reconnect-message {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.reconnect-progress {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.reconnect-progress-bar {
    height: 100%;
    width: 30%;
    background: var(--color-gradient);
    border-radius: 2px;
    animation: progressSlide 1.5s ease-in-out infinite;
}

@keyframes progressSlide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

.reconnect-reload {
    margin-top: 0.5rem;
}

.reconnect-retry {
    margin-top: 1.5rem;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.reconnect-retry:hover:not(:disabled) {
    border-color: var(--color-accent-orange);
    color: var(--color-accent-orange);
}

.reconnect-retry:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .reconnect-content {
        padding: 2rem;
    }

    .reconnect-logo {
        width: 64px;
        height: 64px;
    }
}
