/* CSS Variables & Theme */
:root {
    /* Colors - Dark Theme (Default) */
    --bg-color: #0d1117;
    --text-primary: #ffffff;
    --text-secondary: #8b949e;
    --accent-primary: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.4);
    --surface-glass: rgba(22, 27, 34, 0.7);
    --surface-border: rgba(48, 54, 61, 0.6);
    --input-bg: rgba(13, 17, 23, 0.8);
    --error-color: #f85149;
    --success-color: #2ea043;
    
    /* Typography */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Spacing & Radius */
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Background Atmosphere */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.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: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.globe-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #bc8cff 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 50px); }
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 600px;
    width: 100%;
    margin: 40px auto;
}

.view {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}

.view.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

/* Typography */
.hero-text {
    text-align: center;
    margin-bottom: 40px;
}

.hero-text h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 16px;
    font-weight: 700;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #bc8cff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Card & Form */
.glass-panel {
    background: var(--surface-glass);
    border: 1px solid var(--surface-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-left: 4px;
}

.input-group input, 
.input-group select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Custom Select & Prefix */
.slug-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.domain-prefix {
    position: absolute;
    left: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
}

.slug-input-wrapper input {
    padding-left: 95px; /* Adjust based on domain length visual */
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    appearance: none;
    cursor: pointer;
}

.select-wrapper .chevron {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
}

.options-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    border: none;
    width: 100%;
}

.btn.primary {
    background: var(--accent-primary);
    color: #fff;
}

.btn.primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn.primary:active {
    transform: translateY(0);
}

.btn.secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border: 1px solid transparent;
}

.btn.secondary:hover {
    background: rgba(255,255,255,0.15);
}

.btn.ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn.ghost:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.btn.link-subtle {
    background: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 16px;
    text-decoration: underline;
    width: auto;
    padding: 0;
}

.btn.link-subtle:hover {
    color: var(--text-primary);
}

.icon-only {
    padding: 14px;
}

/* Result Box */
.result-box {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--surface-border);
    animation: slideDown 0.4s var(--transition-smooth);
}

.short-url-display {
    background: var(--input-bg);
    border: 1px solid var(--success-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.short-url-display .label {
    display: block;
    font-size: 0.75rem;
    color: var(--success-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    font-weight: 600;
}

.short-link-text {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    word-break: break-all;
}

.short-link-text:hover {
    text-decoration: underline;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.success-icon {
    display: none; /* Only used if we want a big check mark */
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Utility / Loading states */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255,255,255,0.1);
    border-bottom-color: var(--accent-primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 24px;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Error State */
.icon-box.error {
    background: rgba(248, 81, 73, 0.1);
    color: var(--error-color);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

#error-title {
    font-size: 2rem;
    margin-bottom: 8px;
}

#error-message {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Footer */
.footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 20px 0;
}

/* Responsive */
@media (max-width: 640px) {
    .hero-text h1 {
        font-size: 2.25rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .content-wrapper {
        margin: 20px auto;
    }
    
    .glass-panel {
        padding: 24px;
    }
}
