:root {
    --primary-gradient-start: #667eea;
    --primary-gradient-end: #764ba2;
    --accent-color: #f093fb;
    --background-light: #f8f9ff;
    --background-dark: #0e1326;
    --background-dark-strong: #070d1d;
    --background-dark-mid: #0c1530;
    --background-dark-accent: #0a1224;
    --card-bg-light: #ffffff;
    --card-bg-dark: #16213e;
    --text-primary-light: #2d3748;
    --text-secondary-light: #384152;
    --text-muted-light: #4a5568;
    --text-primary-dark: #e2e8f0;
    --text-secondary-dark: #cbd5ff;
    --text-muted-dark: #9fb5e3;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --border-radius: 16px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    /*padding-top: 2.4rem;*/
    scroll-behavior: smooth;
}

.LayoutContentContainer {
    margin-top: -13px;
    min-height: 95vh;
    width: 100%;
    background: linear-gradient(135deg, var(--background-light) 0%, #e8ebf7 100%);
    transition: var(--transition-smooth);
}

body[data-bs-theme='dark'] .LayoutContentContainer,
.theme-dark .LayoutContentContainer {
    background:
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.12), transparent 32%),
        radial-gradient(circle at 80% 10%, rgba(118, 75, 162, 0.12), transparent 28%),
        linear-gradient(145deg, var(--background-dark-strong) 0%, var(--background-dark-mid) 45%, var(--background-dark-accent) 100%);
}

body[data-bs-theme='dark'] .mud-popover,
.theme-dark .mud-popover {
    background-color: var(--card-bg-dark);
    color: var(--text-primary-dark);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

/* MudSelect input and dropdown text in dark mode */
body[data-bs-theme='dark'] .mud-select .mud-input-input,
.theme-dark .mud-select .mud-input-input,
body[data-bs-theme='dark'] .mud-select .mud-input-adornment,
.theme-dark .mud-select .mud-input-adornment,
body[data-bs-theme='dark'] .mud-select .mud-typography,
.theme-dark .mud-select .mud-typography {
    color: var(--text-primary-dark) !important;
}

body[data-bs-theme='dark'] .mud-popover .mud-typography,
.theme-dark .mud-popover .mud-typography,
body[data-bs-theme='dark'] .mud-popover .mud-list-item-text,
.theme-dark .mud-popover .mud-list-item-text {
    color: var(--text-primary-dark) !important;
}

body[data-bs-theme='dark'] .mud-popover .mud-list,
.theme-dark .mud-popover .mud-list {
    background-color: transparent;
    color: inherit;
}

body[data-bs-theme='dark'] .mud-popover .mud-list-item,
body[data-bs-theme='dark'] .mud-popover .mud-list-item-text,
.theme-dark .mud-popover .mud-list-item,
.theme-dark .mud-popover .mud-list-item-text {
    color: inherit;
}

.LayoutContentStyle {
    overflow-y: auto;
    margin-top: -5px;
    scroll-behavior: smooth;
}

.LayoutFooterStyle {
    position: fixed !important;
    bottom: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 0.75rem 2rem;
    font-size: 0.85em;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.05);
    color: #718096;
}

body[data-bs-theme='dark'] .LayoutFooterStyle,
.theme-dark .LayoutFooterStyle {
    background: rgba(26, 26, 46, 0.95);
    color: #a0aec0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

    .LayoutFooterStyle a {
        color: #667eea;
        margin-left: 1rem;
        text-decoration: none;
        font-weight: 500;
        transition: var(--transition-smooth);
    }

    .LayoutFooterStyle a:hover {
        color: var(--primary-gradient-end);
        text-decoration: none;
    }

    body[data-bs-theme='dark'] .LayoutFooterStyle a,
    .theme-dark .LayoutFooterStyle a {
        color: #8b9eff;
    }

.logo {
    margin-top: 10px;
    margin-right: 10px;
}

@media screen and (max-width: 1024px) {
    .hideIfNarrow {
        display: none !important;
    }
}

@media screen and (max-width: 800px) {
    .hideIfReallyNarrow {
        display: none !important;
    }
}

.paddedDiv {
    padding: 10px;
}

.top-bar {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: stretch;
    color: white;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    padding: 0 3rem;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.navbar-brand {
    font-size: 1.5em;
    color: white;
    margin: 15px 15px 10px 10px;
    text-decoration: none;
    min-width: 350px;
}

    .navbar-brand:hover {
        color: #CCCCCC;
        text-decoration: none;
    }

    .navbar-brand:visited {
        color: white;
        text-decoration: none;
    }

.navbar-login {
    margin-left: 50px;
    margin-top: 22px;
}

    .navbar-login a {
        color: white;
        text-decoration: none;
    }

        .navbar-login a:visited {
            color: white;
            text-decoration: none;
        }



.top-bar .oi {
    width: 2rem;
    font-size: 2.0rem;
    vertical-align: text-top;
    top: -2px;
    margin-bottom: 5px;
    text-align: center;
}

.nav-item a.active {
    background-color: #f0f0f0;
    color: black;
}

.nav-item a:hover {
    background-color: grey;
    color: #0366d6;
}

.nav-tab-top {
    margin: 5px 0 0 0;
    padding: 0.5rem 1.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    text-decoration: none;
    transition: var(--transition-smooth);
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

    .nav-tab-top:hover {
        color: white;
        text-decoration: none;
        background-color: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
    }

    .nav-tab-top.active {
        background-color: rgba(255, 255, 255, 0.25);
        color: #ffffff;
        font-weight: 600;
    }

    .nav-tab-top img {
        height: 2rem;
        margin-bottom: 0.25rem;
    }

    .nav-tab-top.active img {
        filter: brightness(0) saturate(100%) invert(93%) sepia(18%) saturate(797%) hue-rotate(316deg) brightness(109%) contrast(101%);
    }

    .nav-tab-top.active:after {
        content: "";
        position: absolute;
        bottom: -1rem;
        z-index: 1;
        width: 0px;
        height: 0px;
        border-left: 0.6rem solid transparent;
        border-right: 0.6rem solid transparent;
        border-top: 1rem solid #5D6C90; /* #33A145; */ /*rgb(205,51,51);*/
    }

.wideButton {
    width: 250px;
}

.JokeCard {
    background: var(--card-bg-light);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.JokeCard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-gradient-start), var(--accent-color), var(--primary-gradient-end));
}

.JokeCard:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

body[data-bs-theme='dark'] .JokeCard,
.theme-dark .JokeCard {
    background: var(--card-bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.JokeText {
    color: var(--text-primary-light);
    font-size: 1.1rem;
    line-height: 1.8;
    font-weight: 400;
}

body[data-bs-theme='dark'] .JokeText,
.theme-dark .JokeText {
    color: var(--text-primary-dark);
}

.JokeCategory {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    width: auto;
    display: inline-block;
    margin-bottom: 1rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.EditButton {
    border: none;
    float: right;
    color: black;
    font-size: x-small;
    top: -20px;
    position: relative;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1 {
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

h1:focus {
    outline: none;
}

h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary-light);
}

body[data-bs-theme='dark'] h2,
body[data-bs-theme='dark'] h3,
body[data-bs-theme='dark'] h4,
body[data-bs-theme='dark'] h5,
body[data-bs-theme='dark'] h6,
.theme-dark h2,
.theme-dark h3,
.theme-dark h4,
.theme-dark h5,
.theme-dark h6 {
    color: var(--text-primary-dark);
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #7c8ff0, #8b5dc2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.form-control {
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    padding: 0.75rem 1rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--primary-gradient-start);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.valid.modified:not([type=checkbox]) {
    outline: none;
    border: 2px solid #26b050;
    box-shadow: 0 0 0 4px rgba(38, 176, 80, 0.1);
}

.invalid {
    outline: none;
    border: 2px solid #f56565;
    box-shadow: 0 0 0 4px rgba(245, 101, 101, 0.1);
}

.validation-message {
    color: #f56565;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.WhiteIcon {
    color: white;
    margin-left: 5px;
}

.GrayIcon {
    color: gray;
    margin-left: 5px;
}

.LightGrayIcon {
    color: lightgray;
    margin-left: 5px;
}

.BorderlessGrayButtonMiddle {
    margin: 15px 0 5px 5px;
    color: gray;
}

.BorderlessGrayButtonRight {
    margin: 15px 30px 5px 5px;
    color: gray;
}

.submitButton {
    margin: 0 5px 0 5px;
}

.smallTopMargin {
    margin-top: 10px;
}

.mediumTopMargin {
    margin-top: 15px;
}

.largeTopMargin {
    margin-top: 25px;
}

.smallLeftMargin {
    margin-left: 10px;
}

.mediumLeftMargin {
    margin-left: 15px;
}

.largeLeftMargin {
    margin-left: 25px;
}

.divClear {
    clear: both;
}

.divFloatLeft {
    float: left;
}

.fullWidth {
    width: 100%;
}

.almostFullWidth {
    width: 99%;
}

.smallGrayText {
    color: gray;
    font-size: 0.7em;
}

.selectBoxTight {
    margin: -5px 0 10px 10px;
}

/* Loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .page-container,
    .search-container,
    .about-container {
        padding: 2rem 1rem;
    }

    .top-bar {
        padding: 0 1rem;
    }

    .navbar-brand {
        font-size: 1.2em;
        min-width: auto;
    }

    .nav-tab-top {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
    }

    .joke-image {
        max-width: 100%;
        width: 100%;
    }

    h1 {
        font-size: 2rem;
    }
}

#blazor-error-ui {
    background: #fee;
    bottom: 0;
    box-shadow: var(--shadow-lg);
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 3px solid #f56565;
    border-radius: 8px 8px 0 0;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 1rem;
        top: 1rem;
        color: #c53030;
        font-weight: bold;
        font-size: 1.5rem;
        transition: var(--transition-smooth);
    }

    #blazor-error-ui .dismiss:hover {
        color: #742a2a;
    }

.blazor-error-boundary {
    background: linear-gradient(135deg, #f56565, #c53030);
    padding: 1.5rem 2rem;
    color: white;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    box-shadow: var(--shadow-md);
}

    .blazor-error-boundary::after {
        content: "⚠️ An error has occurred. Please try refreshing the page.";
        font-weight: 600;
    }

/* ============================================
   90's THEME STYLES
   ============================================ */

.theme-nineties {
    font-family: 'Comic Sans MS', 'Comic Sans', 'Trebuchet MS', 'Arial', 'Verdana', sans-serif !important;
}

.theme-nineties * {
    font-family: 'Comic Sans MS', 'Comic Sans', 'Trebuchet MS', 'Arial', 'Verdana', sans-serif !important;
}

.theme-nineties .LayoutContentContainer {
    background-color: #000080 !important;
    background-image: none !important;
}

.theme-nineties .LayoutFooterStyle {
    background: #000080 !important;
    border-top: 5px ridge #ff00ff !important;
    color: #00ff00 !important;
    font-weight: bold;
    text-shadow: 1px 1px #000000;
}

.theme-nineties .LayoutFooterStyle .build-number {
    color: #00ff00 !important;
    text-shadow: 1px 1px #000000 !important;
}

.theme-nineties .JokeCard,
.theme-nineties .CategoryCard,
.theme-nineties .card {
    background: linear-gradient(135deg, #ff00ff, #00ffff) !important;
    border: 5px ridge #ffff00 !important;
    box-shadow: 0 0 20px #ff00ff, 0 0 30px #00ffff !important;
    color: #000000 !important;
    font-weight: bold;
    animation: card-pulse 2s ease-in-out infinite;
}

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

.theme-nineties .JokeCard h3,
.theme-nineties .CategoryCard h3,
.theme-nineties h2:not(.under-construction-banner h2),
.theme-nineties h3,
.theme-nineties h4 {
    color: #ff00ff !important;
    text-shadow: 3px 3px #00ffff, 6px 6px #ffff00;
    animation: blink 1.5s linear infinite;
}

.theme-nineties .under-construction-banner h2 {
    color: #000000 !important;
    text-shadow: none !important;
    animation: none !important;
}

.theme-nineties h1 {
    color: #ff00ff !important;
    text-shadow: 3px 3px #00ffff, 6px 6px #ffff00;
    display: inline-block;
    transition: transform 0.3s ease;
}

.theme-nineties h1:hover {
    animation: title-spin 0.5s linear infinite;
}

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

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 99% { opacity: 0.3; }
}

.theme-nineties .mud-typography,
.theme-nineties p,
.theme-nineties span,
.theme-nineties label {
    color: #000000 !important;
    font-weight: bold;
    text-shadow: 1px 1px #ffffff;
}


.theme-nineties .nav-tab-top {
    background: #000080 !important;
    border: 3px outset #000000 !important;
    margin: 0 5px;
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: none !important;
}

.theme-nineties .nav-tab-top,
.theme-nineties .nav-tab-top * {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: none !important;
}

.theme-nineties .navbar,
.theme-nineties .top-row {
    background: #000080 !important;
    border-bottom: 3px ridge #ff00ff !important;
}


.theme-nineties .btn,
.theme-nineties button {
    background: linear-gradient(135deg, #ff00ff, #ffff00) !important;
    border: 3px outset #00ffff !important;
    color: #000000 !important;
    font-weight: bold;
    text-shadow: 1px 1px #ffffff;
    box-shadow: 0 0 10px #ff00ff;
}

.theme-nineties .btn:hover,
.theme-nineties button:hover {
    animation: button-pulse 0.5s ease-in-out infinite;
}

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

/* Webring style links */
.theme-nineties a {
    color: #0000ff !important;
    text-decoration: underline !important;
    font-weight: bold;
}

.theme-nineties a:visited {
    color: #800080 !important;
}

.theme-nineties a:hover {
    color: #ff00ff !important;
    animation: link-pulse 0.5s ease-in-out infinite;
}

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

/* MUD Blazor component overrides for 90's theme */
.theme-nineties .mud-button {
    background: linear-gradient(135deg, #ff00ff, #ffff00) !important;
    border: 3px outset #00ffff !important;
    color: #000000 !important;
    font-weight: bold !important;
    box-shadow: 0 0 10px #ff00ff !important;
}

.theme-nineties .mud-button:hover {
    animation: button-wiggle 0.3s ease-in-out infinite;
}

@keyframes button-wiggle {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

/* Input fields */
.theme-nineties .mud-input,
.theme-nineties input,
.theme-nineties textarea,
.theme-nineties select {
    background: #ffff99 !important;
    border: 3px inset #ff00ff !important;
    color: #000000 !important;
    font-weight: bold !important;
}

/* Dropdown menus */
.theme-nineties .dropdown-menu {
    background: linear-gradient(135deg, #ff00ff, #00ffff) !important;
    border: 5px ridge #ffff00 !important;
}

.theme-nineties .dropdown-item {
    color: #000000 !important;
    font-weight: bold !important;
    text-shadow: 1px 1px #ffffff;
}

.theme-nineties .dropdown-item:hover {
    background: #ffff00 !important;
}

/* Make scrollbars colorful */
.theme-nineties ::-webkit-scrollbar {
    width: 16px;
}

.theme-nineties ::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #ff00ff, #00ffff, #ffff00, #00ff00);
}

.theme-nineties ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ffff00, #ff00ff);
    border: 2px solid #000000;
    border-radius: 0;
}

.theme-nineties ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00ffff, #ff00ff);
}

/* Add some sparkle to tables */
.theme-nineties table {
    border: 5px ridge #ff00ff !important;
}

.theme-nineties th {
    background: linear-gradient(90deg, #ff00ff, #ffff00) !important;
    color: #000000 !important;
    font-weight: bold !important;
    border: 3px outset #00ffff !important;
}

.theme-nineties td {
    border: 2px solid #ff00ff !important;
    background: #ffff99 !important;
    color: #000000 !important;
}

.theme-nineties tr:hover td {
    background: #00ffff !important;
    animation: row-flash 0.5s linear infinite;
}

@keyframes row-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}
