:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.65);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-glow: #8b5cf6;
    --secondary-glow: #ec4899;
    --accent: #3b82f6;
}

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

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

/* Glassmorphism Depth with Animated Background Orbs */
.background-orbs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(90px);
}

.orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-glow);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary-glow);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(60px, 60px) scale(1.1);
    }
}

/* Main Container */
.container {
    width: 100%;
    max-width: 550px;
    padding: 3rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    z-index: 1;
    margin: 20px;
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.container:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

/* Typography Headings */
header {
    text-align: center;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.highlight {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 300;
}

/* API Setup Section */
.api-setup {
    display: flex;
    flex-direction: column;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

input:focus {
    border-color: var(--primary-glow);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
    background: rgba(0, 0, 0, 0.4);
}

.api-help {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Joke Generator Area */
.generator {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

/* Premium Button */
.generate-btn {
    position: relative;
    flex: 1;
    padding: 1.25rem;
    border: none;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:active {
    transform: translateY(1px);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Ryan Button Styles */
.ryan-btn {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.ryan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.5);
}

/* Michael Button Styles */
.michael-btn {
    background: linear-gradient(135deg, #3b82f6, #10b981);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.michael-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.5);
}

/* Andy Button Styles */
.andy-btn {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.andy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.5);
}

/* Circular Loader */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

.hidden {
    display: none !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Output Display Box */
.joke-display {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.7;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.placeholder-text {
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 300;
    opacity: 0.7;
}

.joke-text {
    font-weight: 400;
    color: #fff;
    width: 100%;
    margin: 0;
    white-space: pre-wrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Responsive Handling */
@media (max-width: 480px) {
    .container {
        padding: 2rem 1.5rem;
        border-radius: 20px;
        gap: 2rem;
    }

    .title {
        font-size: 2rem;
    }

    .button-group {
        flex-direction: column;
    }
}