/* ByteVerse Hackathon - Mobile-First Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --secondary-gradient: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    --button-gradient: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    --accent-gradient: linear-gradient(45deg, #63b3ed, #4299e1, #3182ce);
    --dark-bg: #0d1117;
    --darker-bg: #010409;
    --card-bg: rgba(45, 55, 72, 0.15);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f7fafc;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --accent-color: #4299e1;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #e53e3e;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.8);
    --border: 1px solid rgba(255, 255, 255, 0.06);
    --glow: 0 0 20px rgba(66, 153, 225, 0.2);
    --subtle-glow: 0 0 10px rgba(66, 153, 225, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--darker-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(66, 153, 225, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(72, 187, 120, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(49, 130, 206, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: float 12s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg) scale(1); }
    25% { transform: translateY(-10px) rotate(0.5deg) scale(1.01); }
    50% { transform: translateY(-20px) rotate(1deg) scale(1.02); }
    75% { transform: translateY(-10px) rotate(0.5deg) scale(1.01); }
}

/* Main Container */
.container {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    animation: gradientShift 6s ease-in-out infinite;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 15px rgba(66, 153, 225, 0.3));
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.8;
}

/* Joke Card */
.joke-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: var(--border);
    box-shadow: var(--shadow);
    padding: 30px 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.joke-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    background-size: 200% 200%;
    animation: gradientShift 8s ease-in-out infinite;
    border-radius: 20px 20px 0 0;
}

.joke-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.02), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 20px;
    pointer-events: none;
}

.joke-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover), var(--subtle-glow);
    border-color: rgba(66, 153, 225, 0.15);
}

.joke-card:hover::after {
    opacity: 1;
}

.joke-card:active {
    transform: translateY(-3px) scale(1.01);
    transition: all 0.1s ease;
}

.joke-text {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 25px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
    font-weight: 500;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.joke-text:hover {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(66, 153, 225, 0.1);
}

.joke-language {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(66, 153, 225, 0.1);
    color: var(--accent-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(66, 153, 225, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 3;
}

.joke-language:hover {
    transform: scale(1.02);
    background: rgba(66, 153, 225, 0.15);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.2);
}

/* Button */
.hack-button {
    width: 100%;
    padding: 16px 30px;
    background: var(--button-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 20px rgba(66, 153, 225, 0.25);
    z-index: 1;
}

.hack-button::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 cubic-bezier(0.4, 0, 0.2, 1);
}

.hack-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.hack-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(66, 153, 225, 0.4);
    background: linear-gradient(135deg, #63b3ed 0%, #4299e1 100%);
}

.hack-button:hover::before {
    left: 100%;
}

.hack-button:hover::after {
    opacity: 1;
}

.hack-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 15px rgba(66, 153, 225, 0.3);
    transition: all 0.1s ease;
}

.hack-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 10px rgba(66, 153, 225, 0.15);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(20px);
    padding: 10px 20px;
    border-radius: 25px;
    border: 1px solid rgba(66, 153, 225, 0.15);
    font-size: 0.85rem;
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.status-bar:hover {
    transform: translateX(-50%) translateY(-1px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(72, 187, 120, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 6px var(--success-color);
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.1);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 15px;
        gap: 25px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .joke-card {
        padding: 25px 20px;
    }
    
    .joke-text {
        font-size: 1.1rem;
        min-height: 70px;
    }
    
    .hack-button {
        padding: 16px 25px;
        font-size: 1rem;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 10px;
    }
    
    .logo {
        font-size: 1.8rem;
    }
    
    .joke-card {
        padding: 20px 15px;
    }
    
    .joke-text {
        font-size: 1rem;
        min-height: 60px;
    }
}

/* Landscape Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .container {
        gap: 20px;
        justify-content: flex-start;
        padding-top: 30px;
    }
    
    .header {
        margin-bottom: 10px;
    }
    
    .logo {
        font-size: 2rem;
        margin-bottom: 5px;
    }
    
    .status-bar {
        bottom: 10px;
    }
}

/* Error State */
.error-state {
    color: var(--error-color);
    font-style: italic;
    opacity: 0.9;
}

/* Success Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.5s ease-out;
}