/* CSS Variables */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #f59e0b;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --nav-bg: #1e293b;
    --nav-text: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

/* Dark Mode */
.dark-mode {
    --background: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --nav-bg: #020617;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text-color);
    text-align: center;
    min-height: 100vh;
    transition: var(--transition);
    line-height: 1.6;
}

/* Navigation */
nav {
    background: var(--nav-bg);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

nav .logo {
    color: var(--nav-text);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

nav .nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: var(--nav-text);
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

nav a.active {
    background: var(--primary-color);
}

/* Dark Mode Button */
.dark-mode-btn {
    background: transparent;
    border: 2px solid var(--nav-text);
    color: var(--nav-text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.dark-mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Container */
.container {
    max-width: 800px;
    margin: 80px auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    padding: 3rem 1rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Joke Display */
.joke-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.joke-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

#joke {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.joke-setup {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.joke-punchline {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

button, .btn {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Loading Spinner */
#loading {
    display: none;
    margin: 2rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--card-bg);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Category Select */
.category-select {
    margin-bottom: 1.5rem;
}

select {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    outline: none;
}

/* Favorites Section */
.favorites-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.favorites-section h2 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.joke-card {
    background: var(--background);
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    text-align: left;
}

.remove-btn {
    background: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.no-favorites {
    color: var(--text-secondary);
    font-style: italic;
}

/* Contact Form */
form {
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

input, textarea {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-color);
    transition: var(--transition);
}

.dark-mode input, 
.dark-mode textarea {
    border-color: #334155;
    background: var(--background);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

.form-success {
    background: #10b981;
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: none;
}

/* About Page */
.about-content {
    text-align: left;
    max-width: 700px;
    margin: 0 auto;
}

.about-content h2 {
    color: var(--primary-color);
    margin: 1.5rem 0 1rem;
}

.about-content ul {
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

.about-content li {
    margin: 0.5rem 0;
}

/* Footer */
footer {
    background: var(--nav-bg);
    color: var(--nav-text);
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
}

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    nav .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    nav .nav-links a {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .container {
        padding: 1rem;
        margin-top: 180px;
    }
    
    .joke-container {
        padding: 1.5rem;
    }
    
    #joke, .joke-setup, .joke-punchline {
        font-size: 1.1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    button, .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Feature cards on mobile */
    .feature-card {
        padding: 1rem;
    }
    
    .feature-card span {
        font-size: 2rem;
    }
    
    .feature-card h3 {
        font-size: 1rem;
    }
    
    .feature-card p {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.75rem;
    }
    
    nav a {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    nav .logo {
        font-size: 1.2rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .container {
        margin-top: 200px;
        padding: 0.75rem;
    }
    
    .joke-container {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .testimonial {
        padding: 1rem;
    }
}

/* Feature Cards */
.feature-card {
    padding: 1.5rem;
    background: var(--background);
    border-radius: 12px;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

/* Category Badge */
.category-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-left: 1rem;
}

/* Testimonials */
.testimonial {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: left;
    border-left: 4px solid var(--primary-color);
}

.testimonial p {
    font-style: italic;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.testimonial cite {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Keyboard shortcut kbd */
kbd {
    background: var(--background);
    border: 1px solid var(--text-secondary);
    border-radius: 4px;
    padding: 0.125rem 0.5rem;
    font-family: monospace;
    font-size: 0.875rem;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
}

/* Stats Section */
.stats-section {
    text-align: center;
}

.stats-section h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

/* Share Section */
.share-section p {
    margin-bottom: 1rem;
}

/* Hint text */
.hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Error state */
.error {
    color: #ef4444;
}

.error button {
    background: #6366f1;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 1rem;
}

/* Additional animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-slide-up {
    animation: slideUp 0.5s ease forwards;
}

