:root {
    --bg-color: #0b1121;
    /* Darker, richer blue-black */
    --text-color: #e2e8f0;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    /* More subtle border */
    --glass-bg: rgba(255, 255, 255, 0.03);
    /* Lighter touch */
    --success-color: #10b981;
    --error-color: #f43f5e;
    --glow: 0 0 25px rgba(99, 102, 241, 0.4);
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-heading);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Background Animation */
.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(90px);
    opacity: 0.4;
    animation: float 12s infinite ease-in-out alternate;
}

.globe-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    top: -15%;
    left: -10%;
}

.globe-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #db2777 0%, transparent 70%);
    /* Pink-600 */
    bottom: -15%;
    right: -5%;
    animation-delay: -6s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, -40px) scale(1.05);
    }
}

.container {
    width: 100%;
    max-width: 480px;
    /* Slightly tighter for focus */
    padding: 24px;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
    animation: fadeInDown 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    background: rgba(99, 102, 241, 0.1);
    padding: 8px 16px;
    border-radius: 9999px;
    /* Pill shape */
    border: 1px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(4px);
}

h1 {
    font-size: 2.75rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

header p {
    color: #94a3b8;
    font-size: 1.1rem;
    max-width: 90%;
    margin: 0 auto;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s backwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.12);
}

.input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 2;
}

input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: var(--secondary-bg);
    border: 1px solid transparent;
    /* Cleaner start */
    border-radius: 16px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

input::placeholder {
    color: #64748b;
}

input:focus {
    outline: none;
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

input:focus+.input-icon {
    color: var(--primary-color);
}

/* Button Styling */
.cta-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #5b5ff5 0%, #3730a3 100%);
}

.cta-button:hover::before {
    opacity: 1;
}

.cta-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px -2px rgba(99, 102, 241, 0.3);
}

/* Results Area */
.hidden {
    display: none !important;
}

.result-container {
    margin-top: 1.5rem;
    animation: fadeIn 0.4s ease-out;
}

.success-message {
    color: var(--success-color);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    padding: 8px 16px;
    border-radius: 9999px;
    display: inline-flex;
    width: 100%;
}

.short-link-wrapper {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 6px 6px 6px 16px;
    /* Optimized padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.short-link-wrapper a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-family: monospace;
    /* Tech feel */
    font-size: 1.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.icon-button {
    background: #334155;
    border: none;
    color: #e2e8f0;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-button:hover {
    background: var(--primary-color);
    color: white;
}

.secondary-button {
    background: transparent;
    border: 1px dashed var(--glass-border);
    color: #94a3b8;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    border-color: #64748b;
}

.error-message {
    margin-top: 1.5rem;
    color: #fca5a5;
    /* Lighter red for dark mode */
    background: rgba(220, 38, 38, 0.1);
    /* Red-600 with opacity */
    border: 1px solid rgba(220, 38, 38, 0.2);
    padding: 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

footer {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    margin-top: auto;
    /* Push to bottom if content is short */
    padding-top: 10px;
}

/* Loaders & Animations */
.cta-button.loading {
    cursor: wait;
    opacity: 0.9;
}

.cta-button.loading i,
.cta-button.loading span {
    display: none;
}

.cta-button.loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-2px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(2px, 0, 0);
    }
}

/* Responsive Polish */
@media (max-width: 480px) {
    .container {
        padding: 16px;
        max-width: 100%;
    }

    .glass-card {
        padding: 2rem 1.5rem;
        border-radius: 24px;
    }

    h1 {
        font-size: 2.25rem;
    }

    header p {
        font-size: 1rem;
    }
}