:root {
    --bg-color: #0f0f13;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #6c5ce7;
    --primary-hover: #5649c0;
    --secondary: #2d3436;
    --text-main: #ffffff;
    --text-muted: #b2bec3;
    --error: #ff7675;
    --success: #55efc4;
    --font-family: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none; /* Custom focus styles instead */
}

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

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

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.globe-1 {
    width: 400px;
    height: 400px;
    background: #6c5ce7;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.globe-2 {
    width: 500px;
    height: 500px;
    background: #00cec9;
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.globe-3 {
    width: 300px;
    height: 300px;
    background: #fd79a8;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -50px); }
    66% { transform: translate(-20px, 20px); }
}

/* Container */
.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    margin-bottom: 40px;
}

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

.logo span {
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    display: none; /* Hidden by default */
    animation: fadeIn 0.5s ease-out forwards;
}

.card.active {
    display: block;
}

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

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 400;
}

.description {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Form Elements */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

input[type="text"] {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    font-size: 2.5rem; /* Huge text for code */
    color: white;
    text-align: center;
    letter-spacing: 10px;
    font-family: monospace;
    transition: all 0.3s ease;
    width: 100%;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.2);
}

.btn-primary, .btn-secondary {
    padding: 18px 32px;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    font-family: var(--font-family);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    margin-top: 15px;
}

.btn-secondary:hover, .btn-secondary:focus {
    background: rgba(255, 255, 255, 0.2);
}

/* Result Box */
.result-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 30px;
    text-align: left;
}

.result-box .label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.code-display {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--success);
    word-break: break-all;
    user-select: all;
}

/* Error Message */
.error-msg {
    margin-top: 15px;
    color: var(--error);
    font-weight: 600;
    min-height: 24px;
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

footer {
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

/* TV Focus States - Critical */
*:focus {
    outline: none;
}

/* Explicit focus indicators for keyboard/remote nav */
button:focus-visible, input:focus-visible {
    outline: 4px solid var(--primary);
    outline-offset: 4px;
}
