/* RandomJoke - Clean Modern Design */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success: #10b981;
    --error: #ef4444;
}

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.nav {
    display: flex;
    gap: 0.75rem;
}

/* Main */
.main {
    flex: 1;
    padding: 3rem 0;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.select {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.select:hover {
    border-color: var(--primary);
}

.select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Joke Card */
.joke-card {
    background: white;
    border-radius: 1rem;
    padding: 3rem 2.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 0.8s linear infinite;
}

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

.loading p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Joke Content */
.joke-content {
    animation: fadeIn 0.4s ease-out;
}

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

.joke-text {
    margin-bottom: 2.5rem;
}

.setup {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.punchline {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--primary);
    animation: slideIn 0.4s ease-out;
}

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

/* Actions */
.joke-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-ghost:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    flex: 1;
}

.btn-block {
    width: 100%;
}

/* Footer */
.joke-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

.vote-buttons,
.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    background: white;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.vote-btn.voted-up {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.vote-btn.voted-down {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
    color: var(--gray-900);
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
}

.footer p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

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

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    padding: 2rem;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2.5rem;
    max-width: 500px;
    margin: 2rem auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    animation: modalSlide 0.3s ease-out;
}

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

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--gray-100);
    border-radius: 0.5rem;
    color: var(--gray-600);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.modal p {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.checkbox-group label:hover {
    background: var(--gray-50);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--gray-900);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 2000;
    display: none;
    animation: toastSlide 0.3s ease-out;
}

@keyframes toastSlide {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.show {
    display: block;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .joke-card {
        padding: 2rem 1.5rem;
    }

    .setup {
        font-size: 1.5rem;
    }

    .punchline {
        font-size: 1.25rem;
    }

    .joke-actions {
        flex-direction: column;
    }

    .joke-footer {
        flex-direction: column;
        gap: 1rem;
    }

    .vote-buttons,
    .share-buttons {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        padding: 2rem 1.5rem;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .toast {
        left: 1rem;
        right: 1rem;
    }
}
