:root {
    --bg: linear-gradient(135deg, #0b0e14 0%, #1a1d23 100%);
    --surface: rgba(255, 255, 255, 0.05);
    --card-bg: rgba(255, 255, 255, 0.05);
    --accent: #6366f1;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-border: rgba(255, 255, 255, 0.08);
    --modal-bg: #161b22;
    --nav-bg: rgba(11, 14, 20, 0.8);
    --modal-backdrop: rgba(0, 0, 0, 0.7);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --hover-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

body.light {
    --bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --surface: rgba(15, 23, 42, 0.05);
    --card-bg: rgba(255, 255, 255, 0.95);
    --accent: #4f46e5;
    --text: #0f172a;
    --muted: #475569;
    --glass-border: rgba(15, 23, 42, 0.12);
    --card-border: rgba(15, 23, 42, 0.16);
    --modal-bg: #ffffff;
    --nav-bg: rgba(248, 250, 252, 0.9);
    --modal-backdrop: rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 8px 30px 0 rgba(0, 0, 0, 0.15);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.glass-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.nav-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
            flex-direction: row;

}

div#auth-section {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    align-content: center;
    justify-content: center;
    align-items: center;
}

 .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
        flex-direction: column;

}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--accent), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo span {
    color: var(--accent);
}

.action-bar {
    margin: 2rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

div#user-info {
    display: flex;
    gap: 10px;
}

.filter-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex: 1;
}

.filter-group .glass-input {
    flex: 1;
    max-width: 250px;
}

#joke-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.joke-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.joke-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: var(--accent);
}

.card-summary {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.joke-category {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.joke-main-text {
    font-size: 1.25rem;
    margin: 1rem 0;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.joke-full-text {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 500;
}

.card-note {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-style: italic;
}

.like-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.like-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--muted);
    transition: fill 0.2s ease;
}

.like-btn.liked svg {
    fill: #efd544;
}

.like-btn:hover svg {
    fill: #efd544;
}

.like-count {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 500;
}

.answer-wrapper {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--glass-border);
}

.upside-down {
    display: inline-block;
    transform: rotate(180deg);
    transition: transform 0.5s ease;
    color: var(--muted);
    font-size: 0.95rem;
    cursor: help;
}



.version-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.version-item:last-child {
    border-bottom: none;
}

.no-versions {
    color: var(--muted);
    margin: 0;
    font-style: italic;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 3rem 1rem;
    font-size: 1.1rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-backdrop);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--modal-bg);
    padding: 2.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    position: relative;
    border: 1px solid var(--glass-border);
    box-shadow: var(--hover-shadow);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hidden {
    display: none !important;
}

/* Components */
.btn-primary {
    background: linear-gradient(45deg, var(--accent), #7c3aed);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--card-border);
    color: var(--text);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.btn-edit-small,
.btn-version {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-edit-small:hover,
.btn-version:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

#share-btn {
    margin-top: 1rem;
    width: 100%;
}

.glass-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 0.75rem;
    border-radius: 12px;
    margin: 0.5rem 0;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.glass-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

select.glass-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%236366f1" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    cursor: pointer;
}

body.light select.glass-input {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%234f46e5" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.modal-error {
    color: #ef4444;
    margin: 0 0 1rem;
    min-height: 1.2rem;
    font-size: 0.9rem;
}

.verify-note {
    margin-top: 1.5rem;
    color: #f59e0b;
    font-size: 0.95rem;
    font-style: italic;
}

.modal-header {
    display: grid;
    gap: 1.5rem;
}

.user-details {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.user-status {
    color: #f59e0b;
    font-size: 0.9rem;
    font-weight: 500;
}

#theme-toggle {
    margin-left: 0.75rem;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
        width: 40px;
    height: 40px;
}

.close-modal:hover {
    background: var(--surface);
    color: var(--text);
}

@media (max-width: 768px) {
    #joke-feed {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .nav-content, .container {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .filter-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-group .glass-input {
        max-width: none;
    }

    .modal-content {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
}

.verify-note {
    margin-top: 1rem;
    color: #fbbf24;
    font-size: 0.95rem;
}
