/* CSS Variables for theming */
:root {
    --primary-color: #4a90d9;
    --primary-dark: #357abd;
    --primary-light: #6ba3e0;
    --secondary-color: #f5f7fa;
    --accent-color: #ffd700;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e1e5eb;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* Theme variations */
.theme-purple {
    --primary-color: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
}

.theme-green {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
}

.theme-orange {
    --primary-color: #f59e0b;
    --primary-dark: #d97706;
    --primary-light: #fbbf24;
}

.theme-dark {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #1f2937;
    --text-color: #f3f4f6;
    --text-light: #9ca3af;
    --bg-color: #111827;
    --card-bg: #1f2937;
    --border-color: #374151;
}

/* Font style variations */
.font-comic {
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
}

.font-elegant {
    font-family: 'Georgia', 'Times New Roman', serif;
}

.font-playful {
    font-family: 'Trebuchet MS', 'Lucida Sans', sans-serif;
    letter-spacing: 0.5px;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--bg-color) 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
    transition: var(--transition);
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.header {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-top: 5px;
}

/* Main content */
.main-content {
    flex: 1;
}

/* Section styles */
section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

section h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
}

section h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 12px;
    text-align: center;
}

/* Category buttons */
.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

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

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

/* Customization options */
.customization-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.9rem;
}

.option-group select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.option-group select:hover,
.option-group select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Joke card */
.joke-section {
    text-align: center;
}

.joke-card {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    color: white;
    padding: 40px 30px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow-hover);
}

.joke-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.joke-content {
    text-align: center;
}

.joke-setup {
    font-size: 1.4rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.joke-punchline {
    font-size: 1.3rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.joke-punchline.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-btn {
    margin-top: 15px;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

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

/* Generate button */
.generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

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

.btn-icon {
    font-size: 1.4rem;
}

/* Rating section */
.star-rating {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.star {
    font-size: 2.5rem;
    background: none;
    border: none;
    color: var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    padding: 5px;
}

.star:hover,
.star.active {
    color: var(--accent-color);
    transform: scale(1.2);
}

.star.hovered {
    color: var(--accent-color);
}

.rating-text {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.rating-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Share section */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.facebook {
    background: #4267b2;
}

.share-btn.copy {
    background: #6b7280;
}

.share-btn.email {
    background: #ea4335;
}

.copy-feedback {
    margin-top: 10px;
    color: var(--primary-color);
    font-size: 0.9rem;
    min-height: 24px;
}

/* Favorites section */
.favorites-list {
    max-height: 300px;
    overflow-y: auto;
}

.no-favorites {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

.favorite-item {
    background: var(--secondary-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
}

.favorite-item .joke-text {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.favorite-item .joke-category {
    font-size: 0.8rem;
    color: var(--text-light);
}

.favorite-item .remove-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.favorite-item .remove-favorite:hover {
    color: #ef4444;
}

.clear-favorites-btn {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
}

.clear-favorites-btn:hover {
    background: #dc2626;
}

/* Stats section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-card {
    background: var(--secondary-color);
    padding: 20px 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 25px 20px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer a:hover {
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .logo {
        width: 45px;
        height: 45px;
    }

    .tagline {
        font-size: 0.95rem;
    }

    section {
        padding: 20px 15px;
    }

    .category-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .joke-card {
        padding: 30px 20px;
        min-height: 180px;
    }

    .joke-setup {
        font-size: 1.2rem;
    }

    .joke-punchline {
        font-size: 1.1rem;
    }

    .generate-btn {
        padding: 12px 30px;
        font-size: 1.1rem;
    }

    .star {
        font-size: 2rem;
    }

    .share-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .stat-card {
        padding: 15px 10px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .customization-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    .app-container {
        padding: 10px;
    }

    .header {
        padding: 20px 10px;
    }

    .logo-container {
        flex-direction: column;
        gap: 10px;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }
}

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

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

.joke-card.new-joke {
    animation: fadeIn 0.5s ease;
}

.generate-btn:active .btn-icon {
    animation: pulse 0.3s ease;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
