/* assets/style.css - TabNook Main Stylesheet */
/* Version: 1.13 - Fixed mobile landscape layout to prevent widget z-axis stacking */

/* ===== CSS Variable Definitions ===== */
:root {
    /* These theme variables are set inline in index.php from database values */
    /* Listed here for reference:
     --tn-primary-900, --tn-primary-700, --tn-primary-500, --tn-primary-300
     --tn-accent-700, --tn-accent-600, --tn-accent-500
     --tn-background, --tn-danger, --tn-border, --tn-success
     --widget-bg, --widget-fg, --page-bg, --page-fg
  */

    /* Legacy variable mappings */
    --tn-teal-900: var(--tn-primary-900);
    --tn-teal-700: var(--tn-primary-700);
    --tn-teal-500: var(--tn-primary-500);
    --tn-teal-300: var(--tn-primary-300);
    --tn-orange-700: var(--tn-accent-700);
    --tn-orange-600: var(--tn-accent-600);
    --tn-orange-500: var(--tn-accent-500);
    --tn-cream: var(--tn-background);
    --tn-add: var(--tn-success);

    /* Layout dimensions */
    --sidebar-w: 260px;
    --sidebar-collapsed: 28px;
}

/* ===== Base Styles ===== */
body {
    background: var(--tn-background) !important;
}

/* ===== Background Image Support ===== */
/* Uses pseudo-element to allow opacity control without affecting page content */
/* z-index: -1 places it behind all content */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-image: var(--page-bg-image, none);
    background-size: var(--page-bg-size, cover);
    background-position: var(--page-bg-position, center center);
    background-repeat: no-repeat;
    opacity: var(--page-bg-opacity, 1);
    pointer-events: none;
}

/* ===== Form Select Dropdown Arrow ===== */
/* Custom dropdown arrow for all select elements to clearly indicate they are dropdowns */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23495057' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Dark theme dropdown arrow - lighter color for visibility */
body[data-theme-id="8"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23F3F4F6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* ===== Navbar ===== */
.navbar {
    background: linear-gradient(90deg, var(--tn-primary-900), var(--tn-primary-700));
    flex-wrap: nowrap !important;
    /* Prevent wrapping */
    gap: 0.5rem;
}

/* Right side container - protect from shrinking */
.navbar>.ms-auto {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.navbar-brand {
    flex: 0 0 auto;
    /* Don't grow or shrink */
    margin-left: 30px;
}

.brand-img {
    height: 84px;
    display: block;
    transition: height 0.3s ease, opacity 0.3s ease;
}

.brand-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.brand-tagline {
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    margin-top: 0.25rem;
    white-space: nowrap;
    transition: font-size 0.3s ease;
}

/* Nook video replaces logo on hover */
.brand-nook-video {
    position: absolute;
    top: -7px;
    left: -70px;
    height: 89px;
    width: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.navbar-brand:hover .brand-img,
.navbar-brand:focus .brand-img {
    opacity: 0;
}

.navbar-brand:hover .brand-nook-video,
.navbar-brand:focus .brand-nook-video {
    opacity: 1;
}

.brand-audio-toggle {
    position: absolute;
    bottom: 22px;
    left: 75px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.brand-audio-toggle:hover {
    background: rgba(0, 0, 0, 0.8);
}

.navbar-brand:hover .brand-audio-toggle,
.navbar-brand:focus .brand-audio-toggle {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Navbar Icon Buttons ===== */
.nav-icon-btn {
    padding: 0.35rem 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-icon-btn img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.nav-icon-btn i {
    font-size: 1.5rem;
}

.nav-icon-btn:hover {
    transform: scale(1.05);
}

/* Responsive navbar adjustments */
@media (max-width: 1500px) {
    .navbar .btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.875rem;
    }

    .navbar .btn img {
        width: 24px !important;
        height: 24px !important;
    }

    .nav-icon-btn {
        padding: 0.3rem 0.45rem;
    }

    .nav-icon-btn img {
        width: 34px !important;
        height: 34px !important;
    }

    .nav-icon-btn i {
        font-size: 1.35rem;
    }
}

@media (max-width: 1300px) {
    .navbar .btn {
        padding: 0.3rem 0.55rem;
        font-size: 0.85rem;
    }

    .navbar .btn img {
        width: 22px !important;
        height: 22px !important;
    }

    .nav-icon-btn {
        padding: 0.25rem 0.4rem;
    }

    .nav-icon-btn img {
        width: 30px !important;
        height: 30px !important;
    }

    .nav-icon-btn i {
        font-size: 1.25rem;
    }
}

@media (max-width: 1100px) {
    .brand-img {
        height: 75px;
    }

    .brand-nook-video {
        height: 80px;
    }

    .navbar .btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }

    .navbar .btn img {
        width: 20px !important;
        height: 20px !important;
    }

    .nav-icon-btn {
        padding: 0.2rem 0.35rem;
    }

    .nav-icon-btn img {
        width: 28px !important;
        height: 28px !important;
    }

    .nav-icon-btn i {
        font-size: 1.15rem;
    }
}

@media (max-width: 950px) {
    .brand-img {
        height: 70px;
    }

    .brand-nook-video {
        height: 75px;
    }

    .nav-icon-btn {
        padding: 0.2rem 0.3rem;
    }

    .nav-icon-btn img {
        width: 25px !important;
        height: 25px !important;
    }

    .nav-icon-btn i {
        font-size: 1.1rem;
    }
}

@media (max-width: 800px) {
    .brand-img {
        height: 60px;
    }

    .brand-nook-video {
        height: 65px;
    }

    .navbar .btn {
        padding: 0.25rem 0.45rem;
        font-size: 0.75rem;
    }

    .navbar .btn img {
        width: 18px !important;
        height: 18px !important;
    }

    .nav-icon-btn {
        padding: 0.15rem 0.25rem;
    }

    .nav-icon-btn img {
        width: 22px !important;
        height: 22px !important;
    }

    .nav-icon-btn i {
        font-size: 1rem;
    }
}


/* ===== DateTime and Weather Card ===== */
.datetime-weather-card {
    background: var(--weather-bg, #E8F4F8);
    border-radius: 10px;
    border: 2px solid var(--tn-primary-300);
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 6px rgba(30, 138, 122, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: 1rem;
    min-width: 0;
    flex: 0 1 auto;
    transition: all 0.3s ease;
}

.datetime-weather-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

/* DateTime Section */
.datetime-section {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    flex-shrink: 1;
}

/* Hide all datetime displays by default, show active one via JS */
.datetime-display {
    display: none;
}

.datetime-display.active {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.datetime-time-row {
    display: flex;
    align-items: baseline;
    gap: 0.15rem;
}

.datetime-time {
    color: var(--weather-fg, var(--tn-primary-900));
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
}

.datetime-ampm {
    color: var(--weather-fg, var(--tn-primary-700));
    font-size: 0.65rem;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
}

.datetime-date {
    color: var(--weather-fg, var(--tn-primary-700));
    font-size: 0.7rem;
    opacity: 0.85;
    white-space: nowrap;
}

.datetime-greeting {
    color: var(--weather-fg, var(--tn-primary-600));
    font-size: 0.65rem;
    opacity: 0.75;
    white-space: nowrap;
    font-style: italic;
}

/* Standalone Greeting (when datetime is hidden) */
.greeting-only-section {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    overflow: hidden;
}

.greeting-only-section .greeting-text {
    color: var(--weather-fg, var(--tn-primary-900));
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.greeting-only-section .greeting-name {
    color: var(--weather-fg, var(--tn-primary-700));
    font-size: 0.8rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== DateTime Style: Minimal ===== */
.datetime-minimal .datetime-time {
    font-family: inherit;
    font-weight: 600;
}

/* ===== DateTime Style: Digital ===== */
.datetime-digital {
    font-family: 'Courier New', 'Consolas', monospace;
}

.datetime-digital .datetime-time {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(180deg, var(--weather-fg, #1a1a2e) 0%, var(--weather-fg, #16213e) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.datetime-digital .datetime-seconds {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--weather-fg, var(--tn-primary-700));
    opacity: 0.7;
}

.datetime-digital .datetime-ampm {
    font-size: 0.6rem;
    letter-spacing: 1px;
    margin-left: 0.25rem;
}

.datetime-digital .datetime-date {
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ===== DateTime Style: Elegant ===== */
.datetime-elegant {
    font-family: 'Georgia', 'Times New Roman', serif;
}

.datetime-elegant .datetime-time-row {
    gap: 0;
}

.datetime-elegant .datetime-time {
    font-size: 1.3rem;
    font-weight: 400;
    font-style: italic;
}

.datetime-elegant .datetime-separator {
    font-size: 1.3rem;
    animation: elegant-blink 1s ease-in-out infinite;
    color: var(--tn-accent-500);
    margin: 0 0.1rem;
}

.datetime-elegant .datetime-minutes {
    font-size: 1.3rem;
    font-weight: 400;
    font-style: italic;
    color: var(--weather-fg, var(--tn-primary-900));
}

.datetime-elegant .datetime-ampm {
    font-size: 0.7rem;
    font-style: italic;
    margin-left: 0.3rem;
}

.datetime-elegant .datetime-date {
    font-size: 0.7rem;
    font-style: italic;
}

@keyframes elegant-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ===== DateTime Style: Bold ===== */
.datetime-bold .datetime-time {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--tn-primary-900);
}

.datetime-bold .datetime-ampm {
    font-size: 0.7rem;
    font-weight: 800;
    background: var(--tn-accent-500);
    color: white;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    margin-left: 0.3rem;
}

.datetime-bold .datetime-date {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== DateTime Style: Flip ===== */
.datetime-flip .datetime-time-row {
    gap: 0.15rem;
}

.datetime-flip .flip-card {
    background: linear-gradient(180deg, #2d2d2d 0%, #1a1a1a 50%, #2d2d2d 50%, #1a1a1a 100%);
    border-radius: 4px;
    padding: 0.2rem 0.35rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

.datetime-flip .flip-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(0, 0, 0, 0.4);
}

.datetime-flip .flip-digit {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.datetime-flip .flip-separator {
    font-size: 1rem;
    font-weight: 700;
    color: var(--weather-fg, var(--tn-primary-700));
    animation: flip-blink 1s step-end infinite;
}

.datetime-flip .datetime-ampm {
    font-size: 0.55rem;
    margin-left: 0.25rem;
    background: var(--tn-primary-700);
    color: white;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

.datetime-flip .datetime-date {
    margin-top: 0.25rem;
}

@keyframes flip-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ===== DateTime Style: Gradient ===== */
.datetime-gradient {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.datetime-gradient .datetime-time {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.datetime-gradient .datetime-ampm {
    font-size: 0.65rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 1;
}

.datetime-gradient .datetime-date {
    font-size: 0.68rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 1;
}

.datetime-gradient .datetime-greeting {
    font-size: 0.6rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.8;
}

/* ===== DateTime Style: Analog ===== */
.datetime-analog {
    align-items: center;
}

.datetime-analog .analog-clock {
    width: 50px;
    height: 50px;
}

.datetime-analog .analog-face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
    border: 2px solid var(--tn-primary-300);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Clock hour markers */
.datetime-analog .analog-face::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    width: 2px;
    height: 4px;
    background: var(--tn-primary-700);
    transform: translateX(-50%);
    box-shadow:
        0 38px 0 var(--tn-primary-700),
        -19px 19px 0 var(--tn-primary-500),
        19px 19px 0 var(--tn-primary-500);
}

.datetime-analog .analog-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 2px;
}

.datetime-analog .analog-hour {
    width: 3px;
    height: 14px;
    background: var(--tn-primary-900);
    margin-left: -1.5px;
}

.datetime-analog .analog-minute {
    width: 2px;
    height: 18px;
    background: var(--tn-primary-700);
    margin-left: -1px;
}

.datetime-analog .analog-second {
    width: 1px;
    height: 20px;
    background: var(--tn-accent-500);
    margin-left: -0.5px;
}

.datetime-analog .analog-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--tn-primary-900);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.datetime-analog .datetime-date {
    text-align: center;
    margin-top: 0.2rem;
    font-size: 0.6rem;
}

.weather-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 1px solid var(--tn-border);
    padding-left: 1rem;
    min-width: 0;
    flex-shrink: 1;
}

.weather-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #91ebfd;
    /* Much more opaque white */
    border: 1px solid rgba(30, 138, 122, 0.2);
    /* Subtle teal border */
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    /* Stronger shadow */
}

.weather-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    /* Add shadow to icon itself */
}

.weather-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    overflow: hidden;
}

.weather-temp {
    color: var(--weather-fg, var(--tn-primary-900));
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
}

.weather-desc {
    color: var(--weather-fg, var(--tn-primary-700));
    font-size: 0.7rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weather-location {
    color: var(--weather-fg, var(--tn-primary-700));
    font-size: 0.65rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weather-loading {
    color: var(--tn-primary-700);
    font-size: 0.8rem;
    font-style: italic;
}

.weather-error {
    color: var(--tn-danger);
    font-size: 0.75rem;
}

/* Responsive adjustments for datetime/weather card */
@media (max-width: 1920px) {
    .datetime-weather-card {
        padding: 0.7rem 0.95rem;
        gap: 0.9rem;
    }

    .weather-temp {
        font-size: 1.2rem;
    }

    .datetime-time {
        font-size: 1rem;
    }

    .brand-tagline {
        font-size: 0.7rem;
    }
}

@media (max-width: 1500px) {
    .datetime-weather-card {
        padding: 0.65rem 0.9rem;
        gap: 0.85rem;
    }

    .weather-temp {
        font-size: 1.15rem;
    }

    .datetime-time {
        font-size: 0.95rem;
    }

    .brand-tagline {
        font-size: 0.85rem;
    }
}

@media (max-width: 1300px) {
    .datetime-weather-card {
        padding: 0.6rem 0.8rem;
        gap: 0.75rem;
    }

    .weather-temp {
        font-size: 1.1rem;
    }

    .datetime-time {
        font-size: 0.9rem;
    }

    .brand-tagline {
        font-size: 0.75rem;
    }
}

@media (max-width: 1100px) {
    .datetime-weather-card {
        padding: 0.55rem 0.7rem;
        gap: 0.7rem;
    }

    .weather-icon-wrapper {
        width: 36px;
        height: 36px;
        padding: 4px;
        border-radius: 8px;
        background: #91ebfd;
        border: 1px solid rgba(30, 138, 122, 0.2);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }

    .weather-icon {
        width: 36px;
        height: 36px;
    }

    .weather-temp {
        font-size: 1.05rem;
    }

    .datetime-time {
        font-size: 0.85rem;
    }

    .datetime-date {
        font-size: 0.6rem;
    }

    .weather-desc,
    .weather-location {
        font-size: 0.65rem;
    }

    .brand-tagline {
        font-size: 0.65rem;
    }

    /* Scale down analog clock */
    .datetime-analog .analog-clock {
        width: 40px;
        height: 40px;
    }

    .datetime-analog .analog-hour {
        height: 11px;
    }

    .datetime-analog .analog-minute {
        height: 14px;
    }

    .datetime-analog .analog-second {
        height: 16px;
    }
}

@media (max-width: 950px) {
    .datetime-weather-card {
        padding: 0.5rem 0.65rem;
    }

    .weather-icon-wrapper {
        width: 32px;
        height: 32px;
        padding: 4px;
        border-radius: 8px;
        background: #91ebfd;
        border: 1px solid rgba(30, 138, 122, 0.2);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }

    .weather-icon {
        width: 32px;
        height: 32px;
    }

    .weather-temp {
        font-size: 1rem;
    }

    .datetime-time {
        font-size: 0.8rem;
    }

    .weather-desc,
    .weather-location {
        font-size: 0.6rem;
    }

    .brand-tagline {
        display: none;
    }

    /* Scale down analog clock further */
    .datetime-analog .analog-clock {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 1100px) {

    /* Hide datetime section on smaller screens, show only weather */
    .datetime-section {
        display: none;
    }

    .weather-section {
        border-left: none;
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    .datetime-weather-card {
        display: none;
    }
}

/* ===== Quotes Container ===== */
.quotes-container {
    flex: 1 1 0;
    margin: 0 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    justify-content: center;
    min-width: 0;
    /* Allow shrinking below content size */
    overflow: hidden;
    /* Hide overflow instead of letting it spill */
}

.quote-card {
    background: var(--quotes-bg, #FFF9F0);
    border-radius: 8px;
    border-left: 4px solid var(--tn-accent-500);
    padding: 0.7rem 0.9rem;
    padding-right: 2rem;
    padding-left: 1.5rem;
    box-shadow: 0 2px 8px rgba(239, 138, 23, 0.15);
    flex: 0 1 auto;
    /* Allow shrinking */
    width: auto;
    max-width: 450px;
    /* Start with a smaller default max */
    min-width: 180px;
    /* Minimum before hiding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    transition: opacity 0.3s ease, max-width 0.3s ease, padding 0.3s ease, font-size 0.3s ease;
}

.quote-card::before {
    content: '"';
    position: absolute;
    left: 0.3rem;
    top: -0.2rem;
    font-size: 2.5rem;
    color: var(--tn-accent-500);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.quote-card.hiding {
    opacity: 0;
}

.quote-close {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: transparent;
    border: none;
    color: var(--tn-primary-700);
    opacity: 0.5;
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
    font-size: 1rem;
    transition: opacity 0.2s;
}

.quote-close:hover {
    opacity: 0.8;
}

.quote-pin {
    position: absolute;
    bottom: 0.25rem;
    right: 0.25rem;
    background: transparent;
    border: none;
    color: var(--tn-primary-700);
    opacity: 0.4;
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
    font-size: 0.85rem;
    transition: opacity 0.2s, transform 0.2s;
}

.quote-pin:hover {
    opacity: 0.9;
    transform: rotate(-15deg);
}

.quote-text {
    color: var(--quotes-fg, #5D4E37);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    word-wrap: break-word;
}

.quote-author {
    color: var(--tn-primary-700);
    font-size: 0.8rem;
    text-align: right;
    margin-top: 0.25rem;
    opacity: 0.8;
    white-space: nowrap;
}

/* Responsive adjustments for quotes - progressive narrowing */
/* Start narrowing much earlier to prevent navbar wrapping */
@media (max-width: 1900px) {
    .quote-card {
        max-width: 380px;
        padding: 0.65rem 0.85rem;
        padding-right: 1.9rem;
        padding-left: 1.4rem;
    }

    .quote-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 1750px) {
    .quote-card {
        max-width: 340px;
        padding: 0.6rem 0.8rem;
        padding-right: 1.8rem;
        padding-left: 1.2rem;
    }

    .quote-text {
        font-size: 0.72rem;
    }

    .quote-card::before {
        font-size: 2rem;
    }
}

@media (max-width: 1600px) {
    .quote-card {
        max-width: 300px;
        padding: 0.55rem 0.75rem;
        padding-right: 1.7rem;
        padding-left: 1.1rem;
    }

    .quote-text {
        font-size: 0.7rem;
    }
}

@media (max-width: 1500px) {
    .quote-card {
        max-width: 270px;
        padding: 0.5rem 0.7rem;
        padding-right: 1.6rem;
        padding-left: 1rem;
    }

    .quote-text {
        font-size: 0.68rem;
        line-height: 1.3;
    }

    .quotes-container {
        gap: 0.6rem;
        margin: 0 0.8rem;
    }
}

@media (max-width: 1400px) {
    .quote-card {
        max-width: 240px;
        padding: 0.45rem 0.65rem;
        padding-right: 1.5rem;
        padding-left: 0.95rem;
    }

    .quote-text {
        font-size: 0.65rem;
        line-height: 1.25;
    }

    .quote-card::before {
        font-size: 1.75rem;
        left: 0.25rem;
    }

    .quotes-container {
        gap: 0.5rem;
        margin: 0 0.7rem;
    }
}

@media (max-width: 1300px) {
    .quote-card {
        max-width: 210px;
        padding: 0.4rem 0.6rem;
        padding-right: 1.4rem;
        padding-left: 0.85rem;
    }

    .quote-text {
        font-size: 0.62rem;
        line-height: 1.2;
    }

    .quote-card::before {
        font-size: 1.5rem;
        left: 0.2rem;
    }

    .quotes-container {
        gap: 0.4rem;
        margin: 0 0.6rem;
    }
}

@media (max-width: 1200px) {
    .quote-card {
        max-width: 190px;
        padding: 0.35rem 0.55rem;
        padding-right: 1.3rem;
        padding-left: 0.75rem;
    }

    .quote-text {
        font-size: 0.6rem;
        line-height: 1.15;
    }

    .quotes-container {
        gap: 0.35rem;
        margin: 0 0.5rem;
    }
}

@media (max-width: 1400px) {

    /* Hide third quote earlier */
    .quote-card:nth-child(3) {
        display: none;
    }

    .quote-card {
        max-width: 280px;
    }
}

@media (max-width: 1100px) {
    .quote-card {
        max-width: 240px;
        /* Give remaining quotes more room */
    }
}

@media (max-width: 1100px) {

    /* Hide second quote */
    .quote-card:nth-child(2) {
        display: none;
    }

    .quote-card {
        max-width: 320px;
        /* Give last quote more room */
    }
}

@media (max-width: 950px) {
    .quote-card {
        max-width: 280px;
    }
}

@media (max-width: 900px) {

    /* Hide all quotes completely */
    .quotes-container {
        display: none;
    }
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-collapsed);
    color: #fff;
    background: linear-gradient(180deg, var(--tn-primary-900), var(--tn-primary-700));
    min-height: calc(100vh - 92px);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .08);
    position: relative;
    overflow: hidden;
    transition: width .25s ease;
    flex: 0 0 auto;
}

.sidebar:hover,
.sidebar:focus-within {
    width: var(--sidebar-w);
}

.sidebar:not(:hover):not(:focus-within) .header,
.sidebar:not(:hover):not(:focus-within) #topicsList {
    opacity: 0;
    pointer-events: none;
    user-select: none;
}

/* Always visible sidebar styles */
.sidebar.always-visible {
    width: var(--sidebar-w) !important;
}

.sidebar.always-visible .header,
.sidebar.always-visible #topicsList {
    opacity: 1 !important;
    pointer-events: auto !important;
    user-select: auto !important;
}

.sidebar.always-visible .hover-hint {
    display: none !important;
}

.sidebar .hover-hint {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    font-size: .75rem;
    letter-spacing: .03em;
    padding: .35rem .3rem;
    border-radius: .375rem;
    transition: opacity .2s ease;
    pointer-events: none;
}

.sidebar:hover .hover-hint,
.sidebar:focus-within .hover-hint {
    opacity: 0;
}

.sidebar .header {
    padding: .75rem;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
}

.sidebar .header span {
    color: #ffc107;
}

.sidebar .topic-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem .35rem .25rem;
    user-select: none;
    white-space: nowrap;
}

.drag-handle {
    color: rgba(255, 255, 255, .8);
    cursor: grab;
    padding: .2rem .3rem;
}

.drag-handle:active {
    cursor: grabbing;
}

.sidebar .topic-link {
    flex: 1 1 auto;
    min-width: 0;
    padding: .35rem .5rem;
    color: #fff;
    text-decoration: none;
    border-radius: .375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .topic-link:hover {
    background: rgba(255, 255, 255, .10);
}

.sidebar .topic-link.active {
    background: rgba(255, 255, 255, .18);
}

.sidebar .topic-actions .icon-btn {
    color: #fff;
    opacity: .95;
}

.sidebar .empty {
    padding: .75rem;
    color: rgba(255, 255, 255, .85);
    font-size: .9rem;
}

/* ===== Buttons ===== */
.btn-outline-primary {
    --bs-btn-color: var(--tn-primary-300);
    --bs-btn-border-color: var(--tn-primary-300);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--tn-primary-300);
    --bs-btn-hover-border-color: var(--tn-primary-300);
    --bs-btn-bg: var(--tn-primary-700);
    background: var(--bs-btn-bg);
}

/* Background for AI buttons - prevents background image showing through */
.btn-outline-success {
    background: var(--tn-primary-700);
}

.btn-outline-info {
    background: var(--tn-primary-700);
}

.btn.btn-primary {
    background: var(--tn-accent-500);
    border-color: var(--tn-accent-500);
}

.btn.btn-primary:hover {
    background: var(--tn-accent-600);
    border-color: var(--tn-accent-600);
}

/* Icon button styles */
.btn img {
    vertical-align: middle;
    display: inline-block;
}

.btn-outline-light img {
    filter: brightness(0) invert(1);
}

.btn-outline-light:hover img {
    filter: brightness(0.9) invert(1);
}

.btn-outline-primary img,
.btn-outline-secondary img {
    opacity: 1;
}

.btn-outline-danger img {
    opacity: 1;
}

.btn-primary img {
    filter: brightness(0) invert(1);
}

/* ===== Navigation Tabs ===== */
.nav-tabs .nav-link.active {
    background: var(--widget-bg, #fff);
    border-color: var(--tn-primary-300) var(--tn-primary-300) var(--widget-bg, #fff);
    color: var(--widget-fg, var(--tn-primary-900));
    font-weight: 600;
}

.nav-tabs .nav-link {
    color: var(--tab-text-color, var(--tn-primary-300));
    cursor: pointer;
    background: var(--tn-primary-700);
}

/* Page dropdown menu button - matches active tab styling */
.page-menu-btn {
    background: var(--widget-bg, #fff);
    color: var(--widget-fg, var(--tn-primary-900));
    border-radius: 4px;
}

.nav-tabs .nav-link:hover {
    color: var(--tn-primary-300);
    background: var(--tn-primary-500);
}

/* Sortable styles for page tabs */
.nav-tabs .sortable-ghost {
    opacity: 0.4;
    background: var(--tn-primary-300);
}

.nav-tabs .sortable-chosen {
    background: rgba(30, 138, 122, 0.1);
}

/* Fallback drag clone (when forceFallback is enabled) */
.nav-tabs .sortable-fallback {
    opacity: 0.8;
    background: var(--tn-primary-500);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-tabs .sortable-drag {
    opacity: 0;
}

.nav-tabs .nav-item {
    cursor: move;
}

/* ===== Widgets Grid ===== */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
    gap: var(--gap-px, 8px);
    align-items: start;
}

.widgets-column {
    display: flex;
    flex-direction: column;
    gap: var(--gap-px, 8px);
}

.card {
    background: var(--widget-bg);
    color: var(--widget-fg);
    border: 2px solid var(--tn-primary-300);
    box-shadow: 0 2px 8px rgba(14, 90, 90, .06);
    display: flex;
    flex-direction: column;
    min-height: 150px;
    /* Minimum height for empty widgets */
    max-height: 80vh;
    /* Prevent widgets from being taller than viewport */
}

/* Widget list items should inherit theme colors */
.card .list-group-item {
    background: var(--widget-bg);
    color: var(--widget-fg);
    border-color: var(--tn-border);
}

/* Collapsed widget state */
.card.widget-collapsed {
    min-height: 0 !important;
    max-height: none !important;
}

.card.widget-collapsed .card-body {
    display: none !important;
}

.card.widget-collapsed .card-header {
    border-bottom: none;
    border-radius: var(--bs-card-border-radius);
}

.card-header {
    background: linear-gradient(90deg, var(--tn-primary-500), var(--tn-primary-300));
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .25);
    cursor: default;
}

.card[data-widget-type="1"] .card-body,
/* Links */
.card[data-widget-type="2"] .card-body {
    /* ToDos */
    flex: 0 1 auto;
    /* Allow shrinking but not growing beyond content */
    overflow: visible;
    max-height: none;
    /* background: linear-gradient(90deg, var(--tn-accent-600), var(--tn-accent-500)); */
}

/* Allow Links and ToDo widgets to grow beyond 80vh when needed */
.card[data-widget-type="1"],
.card[data-widget-type="2"] {
    max-height: none;
    overflow: visible;
}

/* Keep Notes widgets with scroll */
.card[data-widget-type="4"] .card-body {
    /* Notes */
    flex: 1 1 auto;
    overflow: auto;
    max-height: 500px;
    /* background: linear-gradient(90deg, var(--tn-accent-700), var(--tn-accent-600)); */
}

/* Only apply min-height when notes exist (ul is visible) */
.card[data-widget-type="4"] .card-body:has(.widget-notes:not(.d-none)) {
    min-height: 200px;
}

.card-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
}

.card-body>.list-group {
    flex: 1 1 auto;
    overflow: auto;
    min-height: 0;
}


/* ===== Links Widget ===== */
.links-flow {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .5rem;
    align-content: flex-start;
    padding-bottom: 0.5rem;
}

.link-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .5rem;
    border: 1px solid var(--tn-primary-300);
    border-radius: 999px;
    background: var(--task-item-bg, #fff);
    text-decoration: none;
    font-size: .9rem;
    line-height: 1.1;
    color: var(--task-item-fg, var(--tn-primary-700));
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    max-width: 100%;
}

.link-chip:hover {
    background: #f3fffd;
    border-color: var(--tn-primary-500);
    color: var(--tn-primary-900);
}

.link-chip .favicon {
    width: 16px;
    height: 16px;
    margin: 0;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}

.link-chip span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 16rem;
}

/* Link chip wrapper with delete button */
.link-chip-wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.link-chip-wrapper .link-chip {
    /* Keep full pill shape - delete button overlays on top */
    padding-right: .5rem;
}

.link-chip-delete {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--bs-danger, #dc3545);
    color: #fff;
    font-size: .65rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.link-chip-wrapper:hover .link-chip-delete {
    display: inline-flex;
}

.link-chip-delete:hover {
    background: #b02a37;
    transform: translateY(-50%) scale(1.1);
}

.link-chip-delete i {
    pointer-events: none;
}

.favicon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}

/* ===== Cross-Page Drag & Drop Styles ===== */
.drag-over {
    background: rgba(30, 138, 122, 0.15) !important;
    box-shadow: 0 0 0 2px var(--tn-primary-500) !important;
    transition: all 0.2s ease;
}

.nav-link.drag-over {
    background: rgba(30, 138, 122, 0.2) !important;
    border-color: var(--tn-primary-500) !important;
    transform: scale(1.05);
}

.topic-link.drag-over {
    background: rgba(255, 255, 255, 0.25) !important;
    border-radius: 0.375rem;
}

.card-header[draggable="true"] {
    cursor: move;
}

.card-header[draggable="true"]:active {
    cursor: grabbing;
}

.card[data-widget-id].dragging {
    opacity: 0.5;
}

#pageSelectionModal .list-group-item:hover {
    background: var(--tn-primary-300);
    color: white;
}

/* ===== Dropdown Submenu Styles ===== */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 0.1rem;
    min-width: 160px;
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-submenu:hover>.dropdown-menu,
.dropdown-submenu.show>.dropdown-menu {
    display: block;
}

.dropdown-submenu>.dropdown-item::after {
    content: "\276F";
    float: right;
    margin-left: 0.5rem;
}

/* Position submenu to the left if it would go off-screen */
@media (max-width: 768px) {
    .dropdown-submenu .dropdown-menu {
        left: auto;
        right: 100%;
        margin-left: 0;
        margin-right: 0.1rem;
    }
}

/* ===== Icon Buttons ===== */
.icon-btn {
    border: none;
    background: transparent;
    padding: .1rem .2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .07s ease, filter .1s ease;
}

.icon-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.btn-toggle-collapse i {
    color: #fff;
}

.icon-add i {
    color: var(--tn-add);
}

.icon-edit i {
    color: rgba(255, 255, 255, 0.75);
}

.card-body .icon-edit i {
    color: var(--tn-primary-500);
}

.icon-del i {
    color: rgba(255, 255, 255, 0.75);
}

.card-body .icon-del i {
    color: var(--tn-danger);
}

/* ===== Add Task Pill Button ===== */
.btn-add-pill {
    border: none;
    background: var(--tn-accent-500);
    color: #fff;
    padding: .15rem .5rem;
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.3;
    border-radius: 1rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    transition: transform .07s ease, filter .1s ease, background .15s ease;
    cursor: pointer;
}

.btn-add-pill:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
    background: var(--tn-accent-600);
}

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

.btn-add-pill i {
    font-size: .7rem;
}

/* Links widget pill button - uses primary color instead of accent */
.btn-add-pill.btn-links-pill {
    background: var(--tn-primary-700);
}

.btn-add-pill.btn-links-pill:hover {
    background: var(--tn-primary-900);
}

/* Photo widget pill button - uses success color */
.btn-add-pill.btn-photo-pill {
    background: var(--tn-success);
}

.btn-add-pill.btn-photo-pill:hover {
    background: color-mix(in srgb, var(--tn-success) 80%, black);
}

/* Files widget pill button - uses primary-500 */
.btn-add-pill.btn-files-pill {
    background: var(--tn-primary-500);
}

.btn-add-pill.btn-files-pill:hover {
    background: var(--tn-primary-700);
}

/* ===== Notes Widget ===== */
.note-title {
    font-weight: 600;
    margin-bottom: .1rem;
}

.note-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Note in-place editing */
.widget-notes .list-group-item[data-note-id] {
    cursor: pointer;
}

.widget-notes .list-group-item[data-note-id]:hover:not(.note-editing) {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.note-editing {
    cursor: default !important;
}

.note-content-wrapper {
    width: 100%;
    flex: 1;
    min-width: 0;
    min-height: 80px;
    padding: 0.5rem;
}

/* Note: The old :empty placeholder has been replaced by the Nook empty state */

.note-edit-textarea {
    width: 100%;
    resize: vertical;
    min-height: 80px;
}

.note-edit-buttons {
    display: flex;
    justify-content: flex-end;
}

/* ===== ToDos Widget (Nestable) ===== */
.dd {
    max-width: 100%;
    word-wrap: break-word;
}

/* Hide empty nestable containers */
.dd.todo-dd.d-none {
    display: none !important;
}

.dd-item>.dd-list {
    margin-left: 1rem;
}

.dd-handle {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--task-item-bg, #fff);
    color: var(--task-item-fg, #212529);
    border: 1px solid var(--tn-border);
    padding: .5rem .75rem;
    border-radius: .5rem;
    gap: .5rem;
    flex-wrap: nowrap;
    height: auto !important;
    line-height: 1.35;
    overflow: visible;
    word-break: break-word;
}

.min-w-0 {
    min-width: 0;
}

.todo-title {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin-top: .1rem;
}

/* ===== Todo Priority System ===== */
/* Priority indicator dot */
.todo-priority-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.35rem;
}

.todo-priority-dot.priority-1 {
    background-color: #ffc107;
    /* Yellow - Low */
}

.todo-priority-dot.priority-2 {
    background-color: #fd7e14;
    /* Orange - Medium */
}

.todo-priority-dot.priority-3 {
    background-color: #dc3545;
    /* Red - High */
}

/* Priority item left border highlight */
.dd-item.todo-priority-1>.dd-handle {
    border-left: 3px solid #ffc107;
    padding-left: calc(0.5rem - 3px);
}

.dd-item.todo-priority-2>.dd-handle {
    border-left: 3px solid #fd7e14;
    padding-left: calc(0.5rem - 3px);
}

.dd-item.todo-priority-3>.dd-handle {
    border-left: 3px solid #dc3545;
    padding-left: calc(0.5rem - 3px);
}

/* Priority button color based on current priority */
.dd-item.todo-priority-1 .btn-todo-priority i {
    color: #ffc107 !important;
}

.dd-item.todo-priority-2 .btn-todo-priority i {
    color: #fd7e14 !important;
}

.dd-item.todo-priority-3 .btn-todo-priority i {
    color: #dc3545 !important;
}

/* Priority selector in modals */
.todo-priority-selector {
    display: flex;
    gap: 0.5rem;
}

.todo-priority-selector .priority-option {
    cursor: pointer;
}

.todo-priority-selector .priority-option input[type="radio"] {
    display: none;
}

.todo-priority-selector .priority-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 2px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-body-bg, #fff);
    color: var(--bs-secondary-color, #6c757d);
    transition: all 0.15s ease;
}

.todo-priority-selector .priority-btn:hover {
    border-color: var(--bs-primary, #0d6efd);
}

.todo-priority-selector .priority-option input[type="radio"]:checked+.priority-btn {
    border-color: currentColor;
    background: currentColor;
    color: white;
}

.todo-priority-selector .priority-btn.priority-1 {
    color: #ffc107;
}

.todo-priority-selector .priority-btn.priority-2 {
    color: #fd7e14;
}

.todo-priority-selector .priority-btn.priority-3 {
    color: #dc3545;
}

.todo-priority-selector .priority-option input[type="radio"]:checked+.priority-btn.priority-1,
.todo-priority-selector .priority-option input[type="radio"]:checked+.priority-btn.priority-2,
.todo-priority-selector .priority-option input[type="radio"]:checked+.priority-btn.priority-3 {
    color: white;
}

.todo-priority-selector .priority-option input[type="radio"]:checked+.priority-btn.priority-1 {
    background: #ffc107;
    border-color: #ffc107;
}

.todo-priority-selector .priority-option input[type="radio"]:checked+.priority-btn.priority-2 {
    background: #fd7e14;
    border-color: #fd7e14;
}

.todo-priority-selector .priority-option input[type="radio"]:checked+.priority-btn.priority-3 {
    background: #dc3545;
    border-color: #dc3545;
}

/* Filter dropdown menu styling */
.todo-filter-menu .todo-filter-item {
    display: flex;
    align-items: center;
}

.todo-filter-menu .todo-filter-item.active {
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    font-weight: 500;
}

.todo-filter-menu .todo-priority-dot {
    margin-top: 0;
}

/* ===== Todo Completion Confetti Effect ===== */
/* Explosion trajectories - burst upward and outward, then fall */
@keyframes confetti-burst-1 {
    0% {
        transform: translate(0, 0) rotateZ(0deg);
        opacity: 1;
    }

    50% {
        transform: translate(-40px, -80px) rotateZ(360deg);
        opacity: 1;
    }

    65% {
        opacity: 0.5;
    }

    100% {
        transform: translate(-60px, 100px) rotateZ(720deg);
        opacity: 0;
    }
}

@keyframes confetti-burst-2 {
    0% {
        transform: translate(0, 0) rotateZ(0deg);
        opacity: 1;
    }

    50% {
        transform: translate(40px, -90px) rotateZ(-360deg);
        opacity: 1;
    }

    65% {
        opacity: 0.5;
    }

    100% {
        transform: translate(70px, 100px) rotateZ(-720deg);
        opacity: 0;
    }
}

@keyframes confetti-burst-3 {
    0% {
        transform: translate(0, 0) rotateZ(0deg);
        opacity: 1;
    }

    50% {
        transform: translate(-10px, -100px) rotateZ(360deg);
        opacity: 1;
    }

    65% {
        opacity: 0.5;
    }

    100% {
        transform: translate(-20px, 110px) rotateZ(720deg);
        opacity: 0;
    }
}

@keyframes confetti-burst-4 {
    0% {
        transform: translate(0, 0) rotateZ(0deg);
        opacity: 1;
    }

    50% {
        transform: translate(30px, -85px) rotateZ(-360deg);
        opacity: 1;
    }

    65% {
        opacity: 0.5;
    }

    100% {
        transform: translate(50px, 105px) rotateZ(-720deg);
        opacity: 0;
    }
}

@keyframes confetti-burst-5 {
    0% {
        transform: translate(0, 0) rotateZ(0deg);
        opacity: 1;
    }

    50% {
        transform: translate(-30px, -95px) rotateZ(360deg);
        opacity: 1;
    }

    65% {
        opacity: 0.5;
    }

    100% {
        transform: translate(-45px, 115px) rotateZ(720deg);
        opacity: 0;
    }
}

/* Large celebration trajectories - bigger, more dramatic */
@keyframes confetti-burst-large-1 {
    0% {
        transform: translate(0, 0) rotateZ(0deg) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(-60px, -120px) rotateZ(540deg) scale(1.3);
        opacity: 1;
    }

    55% {
        opacity: 0.6;
    }

    100% {
        transform: translate(-90px, 150px) rotateZ(1080deg) scale(1.5);
        opacity: 0;
    }
}

@keyframes confetti-burst-large-2 {
    0% {
        transform: translate(0, 0) rotateZ(0deg) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(70px, -130px) rotateZ(-540deg) scale(1.3);
        opacity: 1;
    }

    55% {
        opacity: 0.6;
    }

    100% {
        transform: translate(100px, 150px) rotateZ(-1080deg) scale(1.5);
        opacity: 0;
    }
}

@keyframes confetti-burst-large-3 {
    0% {
        transform: translate(0, 0) rotateZ(0deg) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(-20px, -140px) rotateZ(540deg) scale(1.3);
        opacity: 1;
    }

    55% {
        opacity: 0.6;
    }

    100% {
        transform: translate(-30px, 160px) rotateZ(1080deg) scale(1.5);
        opacity: 0;
    }
}

@keyframes confetti-burst-large-4 {
    0% {
        transform: translate(0, 0) rotateZ(0deg) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(50px, -125px) rotateZ(-540deg) scale(1.3);
        opacity: 1;
    }

    55% {
        opacity: 0.6;
    }

    100% {
        transform: translate(80px, 155px) rotateZ(-1080deg) scale(1.5);
        opacity: 0;
    }
}

@keyframes confetti-burst-large-5 {
    0% {
        transform: translate(0, 0) rotateZ(0deg) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(-50px, -135px) rotateZ(540deg) scale(1.3);
        opacity: 1;
    }

    55% {
        opacity: 0.6;
    }

    100% {
        transform: translate(-70px, 165px) rotateZ(1080deg) scale(1.5);
        opacity: 0;
    }
}

@keyframes confetti-burst-large-6 {
    0% {
        transform: translate(0, 0) rotateZ(0deg) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(15px, -145px) rotateZ(-540deg) scale(1.3);
        opacity: 1;
    }

    55% {
        opacity: 0.6;
    }

    100% {
        transform: translate(25px, 170px) rotateZ(-1080deg) scale(1.5);
        opacity: 0;
    }
}

@keyframes confetti-burst-large-7 {
    0% {
        transform: translate(0, 0) rotateZ(0deg) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(-40px, -115px) rotateZ(540deg) scale(1.3);
        opacity: 1;
    }

    55% {
        opacity: 0.6;
    }

    100% {
        transform: translate(-55px, 145px) rotateZ(1080deg) scale(1.5);
        opacity: 0;
    }
}

@keyframes confetti-burst-large-8 {
    0% {
        transform: translate(0, 0) rotateZ(0deg) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(65px, -110px) rotateZ(-540deg) scale(1.3);
        opacity: 1;
    }

    55% {
        opacity: 0.6;
    }

    100% {
        transform: translate(95px, 140px) rotateZ(-1080deg) scale(1.5);
        opacity: 0;
    }
}

@keyframes confetti-burst-large-9 {
    0% {
        transform: translate(0, 0) rotateZ(0deg) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(5px, -150px) rotateZ(540deg) scale(1.3);
        opacity: 1;
    }

    55% {
        opacity: 0.6;
    }

    100% {
        transform: translate(10px, 175px) rotateZ(1080deg) scale(1.5);
        opacity: 0;
    }
}

@keyframes confetti-burst-large-10 {
    0% {
        transform: translate(0, 0) rotateZ(0deg) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(-55px, -105px) rotateZ(-540deg) scale(1.3);
        opacity: 1;
    }

    55% {
        opacity: 0.6;
    }

    100% {
        transform: translate(-75px, 135px) rotateZ(-1080deg) scale(1.5);
        opacity: 0;
    }
}

.confetti-container {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.confetti-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    pointer-events: none;
    left: 50%;
    top: 10px;
}

/* Small confetti - apply different burst animations */
.confetti-particle.small {
    animation-duration: 1s;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation-fill-mode: forwards;
}

.confetti-particle.small:nth-child(1) {
    background: #ff6b6b;
    animation-name: confetti-burst-1;
}

.confetti-particle.small:nth-child(2) {
    background: #4ecdc4;
    animation-name: confetti-burst-2;
    animation-delay: 0.05s;
}

.confetti-particle.small:nth-child(3) {
    background: #ffe66d;
    animation-name: confetti-burst-3;
    animation-delay: 0.1s;
}

.confetti-particle.small:nth-child(4) {
    background: #a8e6cf;
    animation-name: confetti-burst-4;
    animation-delay: 0.15s;
}

.confetti-particle.small:nth-child(5) {
    background: #ff8ed4;
    animation-name: confetti-burst-5;
    animation-delay: 0.2s;
}

/* Large confetti - more dramatic burst */
.confetti-particle.large {
    animation-duration: 1.4s;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation-fill-mode: forwards;
    width: 7px;
    height: 7px;
}

.confetti-particle.large:nth-child(1) {
    background: #ff6b6b;
    animation-name: confetti-burst-large-1;
}

.confetti-particle.large:nth-child(2) {
    background: #4ecdc4;
    animation-name: confetti-burst-large-2;
    animation-delay: 0.05s;
}

.confetti-particle.large:nth-child(3) {
    background: #ffe66d;
    animation-name: confetti-burst-large-3;
    animation-delay: 0.1s;
}

.confetti-particle.large:nth-child(4) {
    background: #a8e6cf;
    animation-name: confetti-burst-large-4;
    animation-delay: 0.15s;
}

.confetti-particle.large:nth-child(5) {
    background: #ff8ed4;
    animation-name: confetti-burst-large-5;
    animation-delay: 0.2s;
}

.confetti-particle.large:nth-child(6) {
    background: #95e1d3;
    animation-name: confetti-burst-large-6;
    animation-delay: 0.25s;
}

.confetti-particle.large:nth-child(7) {
    background: #ffc8dd;
    animation-name: confetti-burst-large-7;
    animation-delay: 0.3s;
}

.confetti-particle.large:nth-child(8) {
    background: #ffafcc;
    animation-name: confetti-burst-large-8;
    animation-delay: 0.35s;
}

.confetti-particle.large:nth-child(9) {
    background: #bde0fe;
    animation-name: confetti-burst-large-9;
    animation-delay: 0.4s;
}

.confetti-particle.large:nth-child(10) {
    background: #cdb4db;
    animation-name: confetti-burst-large-10;
    animation-delay: 0.45s;
}

/* Star burst effect for large celebration */
@keyframes star-burst {
    0% {
        transform: translate(-50%, 0) scale(0) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -100px) scale(1.5) rotate(180deg);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -150px) scale(0.5) rotate(360deg);
        opacity: 0;
    }
}

.confetti-star {
    position: absolute;
    left: 50%;
    top: 10px;
    width: 16px;
    height: 16px;
    color: #ffd700;
    font-size: 16px;
    animation: star-burst 0.8s ease-out forwards;
    transform-origin: center;
    pointer-events: none;
}

.dd-handle .form-check-input {
    margin-top: .2rem;
}

.item-icons {
    flex: 0 0 auto;
    align-self: flex-start;
}

.dd-item>button[data-action="collapse"],
.dd-item>button[data-action="expand"] {
    border: none;
    background: none;
    cursor: pointer;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    font-size: 0;
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
}

.dd-item>button[data-action="collapse"]::before,
.dd-item>button[data-action="expand"]::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 12px;
    line-height: 1;
    display: inline-block;
    content: "";
}

.dd-item>button[data-action="collapse"]::before {
    content: "\f078";
}

.dd-item>button[data-action="expand"]::before {
    content: "\f054";
}

.dd-item.dd-collapsed>button[data-action="collapse"] {
    display: none !important;
}

.dd-item:not(.dd-collapsed)>button[data-action="expand"] {
    display: none !important;
}

/* ===== Settings Modal ===== */
.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section-title {
    color: var(--tn-primary-900);
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--tn-primary-300);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-card {
    background: white;
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 2px solid var(--tn-primary-300);
    box-shadow: 0 2px 8px rgba(14, 90, 90, 0.06);
}

.settings-card:hover {
    box-shadow: 0 4px 12px rgba(14, 90, 90, 0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

#settingsModal .form-control,
#settingsModal .form-select {
    border: 1px solid var(--tn-primary-300);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

#settingsModal .form-control:focus,
#settingsModal .form-select:focus {
    border-color: var(--tn-primary-500);
    box-shadow: 0 0 0 0.2rem rgba(30, 138, 122, 0.15);
}

#settingsModal .form-label {
    font-weight: 500;
    color: var(--tn-primary-700);
    margin-bottom: 0.35rem;
}

#settingsModal .modal-content {
    border: none;
    border-radius: 0.75rem;
    resize: both;
    overflow: visible;
    min-width: 600px;
    min-height: 400px;
}

/* Ensure modal body handles scrolling but allows select dropdowns to overflow */
#settingsModal .modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
}

#settingsModal .modal-dialog {
    max-width: 1140px;
}

#settingsModal .modal-header {
    border-bottom: none;
    padding: 1.25rem;
}

#settingsModal .modal-footer {
    padding: 1rem 1.25rem;
}

#settingsModal .btn-primary:hover {
    background: var(--tn-accent-600) !important;
    border-color: var(--tn-accent-600) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 138, 23, 0.25);
}

#settingsModal .btn-secondary {
    background: transparent;
    color: var(--tn-primary-700);
    border: 1px solid var(--tn-primary-300);
}

#settingsModal .btn-secondary:hover {
    background: var(--tn-primary-300);
    color: white;
    border-color: var(--tn-primary-300);
}

#settingsModal small.text-muted {
    font-size: 0.8rem;
    color: var(--tn-primary-700) !important;
    opacity: 0.7;
}

#settingsModal small.text-muted i {
    font-size: 0.9rem;
}

/* Required field indicator */
#settingsModal .form-label:has(+ input:required)::after {
    content: " *";
    color: var(--tn-danger);
}

/* Animate modal entrance */
#settingsModal .modal-dialog {
    animation: slideDown 0.3s ease;
}

/* ===== Location Search Autocomplete ===== */
#locationSearchResults {
    background: var(--widget-bg, white);
    border: 1px solid var(--tn-primary-300);
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    margin-top: -1px;
}

#locationSearchResults .list-group-item {
    border: none;
    border-bottom: 1px solid var(--tn-primary-100);
    padding: 0.65rem 1rem;
    cursor: pointer;
    background: transparent;
    color: var(--widget-fg, inherit);
    transition: background-color 0.15s ease;
}

#locationSearchResults .list-group-item:last-child {
    border-bottom: none;
    border-radius: 0 0 0.5rem 0.5rem;
}

#locationSearchResults .list-group-item:hover,
#locationSearchResults .list-group-item:focus {
    background-color: var(--tn-primary-100);
}

#locationSearchResults .list-group-item.text-muted {
    cursor: default;
}

#locationSearchResults .list-group-item.text-muted:hover {
    background: transparent;
}

#useMyLocationBtn {
    border-color: var(--tn-primary-300);
    color: var(--tn-primary-700);
}

#useMyLocationBtn:hover {
    background-color: var(--tn-primary-100);
    border-color: var(--tn-primary-500);
    color: var(--tn-primary-900);
}

#useMyLocationBtn .spinner-border {
    width: 1rem;
    height: 1rem;
}

/* Dark mode support for location search */
body[data-theme-mode="dark"] #locationSearchResults {
    background: var(--widget-bg, #1a1a2e);
    border-color: rgba(255, 255, 255, 0.15);
}

body[data-theme-mode="dark"] #locationSearchResults .list-group-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body[data-theme-mode="dark"] #locationSearchResults .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body[data-theme-mode="dark"] #useMyLocationBtn {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

body[data-theme-mode="dark"] #useMyLocationBtn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ===== Modal Base Styling ===== */
.modal-content {
    background: var(--widget-bg);
    color: var(--widget-fg);
    border: 2px solid var(--tn-primary-300);
    border-radius: 0.75rem;
    overflow: hidden;
    width: 100%;
}

.modal-header {
    background: linear-gradient(90deg, var(--tn-primary-900), var(--tn-primary-700));
    color: white;
    border-bottom: none;
    padding: 1.25rem;
}

/* Draggable modals */
.draggable-modal .modal-header {
    cursor: move;
}

.modal-footer {
    background: var(--tn-background);
    border-top: 2px solid var(--tn-primary-300);
    padding: 1rem 1.25rem;
}

.modal-body {
    background: var(--widget-bg);
    color: var(--widget-fg);
}

/* Form elements in modals */
.modal .form-control {
    background: var(--widget-bg);
    color: var(--widget-fg);
    border: 1px solid var(--tn-primary-300);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.modal .form-select {
    background-color: var(--widget-bg);
    color: var(--widget-fg);
    border: 1px solid var(--tn-primary-300);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.modal .form-control:focus {
    background: var(--widget-bg);
    color: var(--widget-fg);
    border-color: var(--tn-primary-500);
    box-shadow: 0 0 0 0.2rem rgba(30, 138, 122, 0.15);
}

.modal .form-select:focus {
    background-color: var(--widget-bg);
    color: var(--widget-fg);
    border-color: var(--tn-primary-500);
    box-shadow: 0 0 0 0.2rem rgba(30, 138, 122, 0.15);
}

.modal .form-label {
    font-weight: 500;
    color: var(--widget-fg);
    margin-bottom: 0.35rem;
}

/* Modal buttons */
.modal .btn-primary {
    background: var(--tn-accent-500);
    border-color: var(--tn-accent-500);
    color: white;
}

.modal .btn-primary:hover {
    background: var(--tn-accent-600);
    border-color: var(--tn-accent-600);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 138, 23, 0.25);
}

.modal .btn-secondary {
    background: transparent;
    color: var(--widget-fg);
    border: 1px solid var(--tn-primary-300);
}

.modal .btn-secondary:hover {
    background: var(--tn-primary-300);
    color: white;
    border-color: var(--tn-primary-300);
}

.modal .btn-outline-danger {
    color: var(--tn-danger);
    border-color: var(--tn-danger);
}

.modal .btn-outline-danger:hover {
    background: var(--tn-danger);
    border-color: var(--tn-danger);
    color: white;
}

/* Close button styling */
.modal .btn-close {
    filter: invert(1);
}

/* Specific modal enhancements */
.modal .text-muted {
    color: var(--widget-fg) !important;
    opacity: 0.7;
}

/* Table styling in modals */
.modal .table {
    color: var(--widget-fg);
}

.modal .table th {
    border-color: var(--tn-border);
    color: var(--widget-fg);
}

.modal .table td {
    border-color: var(--tn-border);
    color: var(--widget-fg);
}

.modal .table-responsive {
    border: 1px solid var(--tn-border);
    border-radius: 0.375rem;
}

/* ===== Settings Modal Specific ===== */
.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section-title {
    color: var(--widget-fg);
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--tn-primary-300);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-card {
    background: var(--widget-bg);
    color: var(--widget-fg);
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 2px solid var(--tn-primary-300);
    box-shadow: 0 2px 8px rgba(14, 90, 90, 0.06);
}

.settings-card:hover {
    box-shadow: 0 4px 12px rgba(14, 90, 90, 0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

#settingsModal small.text-muted {
    font-size: 0.8rem;
    color: var(--widget-fg) !important;
    opacity: 0.7;
}

#settingsModal small.text-muted i {
    font-size: 0.9rem;
}

/* Required field indicator */
.modal .form-label:has(+ input:required)::after {
    content: " *";
    color: var(--tn-danger);
}

/* Modal sizing overrides */
.modal-dialog.modal-lg {
    max-width: 800px;
    /* Limit large modals to reasonable width */
}

.modal-dialog {
    max-width: 500px;
    /* Standard modal width */
    /* Center all modals vertically */
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
    margin: 0.5rem auto;
}

@media (min-width: 576px) {
    .modal-dialog {
        min-height: calc(100% - 3.5rem);
        margin: 1.75rem auto;
    }
}

/* Specific modal width adjustments */
#manageLinksModal .modal-dialog {
    max-width: 700px;
    /* Links modal needs some extra width for the table */
}

#addHTMLNoteModal .modal-dialog,
#editHTMLNoteModal .modal-dialog {
    max-width: 800px;
    /* HTML note modals need more space for editor */
}

/* Settings tabs - scrollable when too many tabs */
#settingsModal #settingsTabs {
    scrollbar-width: thin;
    -ms-overflow-style: none;
}

#settingsModal #settingsTabs::-webkit-scrollbar {
    height: 4px;
}

#settingsModal #settingsTabs::-webkit-scrollbar-thumb {
    background: var(--tn-primary-300);
    border-radius: 2px;
}

#settingsModal #settingsTabs .nav-item {
    flex-shrink: 0;
}

/* Animate modal entrance */
.modal-dialog {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive improvements for smaller screens */
@media (max-width: 1400px) {
    .card {
        max-height: 70vh;
    }
}

@media (max-width: 992px) {
    .widgets-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card {
        max-height: 60vh;
    }
}

@media (max-width: 768px) {
    .widgets-grid {
        grid-template-columns: 1fr;
    }

    .card {
        max-height: 50vh;
    }
}

/* ===== Notes Widget (Rich Text) ===== */
.fancy-note-content {
    padding: 0.5rem;
    border: 1px solid var(--tn-border);
    border-radius: 0.375rem;
    background: var(--note-content-bg, rgba(255, 255, 255, 0.5));
    min-height: 60px;
    max-height: 400px;
    overflow-y: auto;
    flex: 1 1 auto;
    /* Match Quill editor styles for WYSIWYG consistency */
    font-size: 13px;
    line-height: 1.42;
}

/* Match Quill's paragraph reset for consistent rendering */
.fancy-note-content p {
    margin: 0;
    padding: 0;
}

/* Notes in-place editing */
.widget-htmlnotes .list-group-item[data-htmlnote-id] {
    cursor: pointer;
}

.widget-htmlnotes .list-group-item[data-htmlnote-id]:hover:not(.fancy-note-editing) {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.fancy-note-editing {
    cursor: default !important;
}

.fancy-note-content-wrapper {
    width: 100%;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Empty content placeholder removed - now using Nook empty state */

.fancy-note-inline-editor {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.fancy-note-quill-container {
    resize: vertical;
    overflow: auto;
    min-height: 150px;
    border: 1px solid var(--tn-border);
    border-radius: 0.375rem;
    background: white;
}

.fancy-note-quill-container .ql-toolbar {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    border-radius: 0.375rem 0.375rem 0 0;
    border-bottom: 1px solid var(--tn-border);
}

.fancy-note-quill-container .ql-container {
    border: none;
    border-radius: 0 0 0.375rem 0.375rem;
    min-height: 100px;
}

.fancy-note-edit-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Make Notes widget body flexible */
.card[data-widget-type="5"] .card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 100px;
}

.card[data-widget-type="5"] .widget-htmlnotes {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.card[data-widget-type="5"] .list-group-item {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.card[data-widget-type="5"] .list-group-item>div {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.card[data-widget-type="5"] .list-group-item .fancy-note-content-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: -webkit-fill-available;
}

/* Notes header gradient */
.card[data-widget-type="5"] .card-header {
    background: linear-gradient(90deg, var(--tn-primary-500), var(--tn-primary-300));
}

/* ===== Quill Editor Styles ===== */
.quill-resizable-container {
    min-height: 250px;
    min-width: 50%;
    width: 100%;
    max-width: none;
    /* Remove max-width constraint */
    max-height: none;
    /* Use viewport height for max */
    resize: both;
    overflow: auto;
    border: 1px solid var(--tn-border);
    border-radius: 0.375rem;
    position: relative;
}

/* Make modal adapt to resizable content */
#addHTMLNoteModal .modal-dialog,
#editHTMLNoteModal .modal-dialog {
    max-width: 90vw;
    width: auto;
    display: flex;
    justify-content: center;
}

#addHTMLNoteModal .modal-content,
#editHTMLNoteModal .modal-content {
    width: auto;
    min-width: 500px;
    /* Minimum width for usability */
    max-width: 90vw;
}

#addHTMLNoteModal .modal-body,
#editHTMLNoteModal .modal-body {
    width: auto;
    display: flex;
    flex-direction: column;
}

/* Ensure the form adapts to container width */
#addHTMLNoteForm,
#editHTMLNoteForm {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Ensure modal can accommodate expanded editor */
.modal-dialog.modal-lg {
    max-width: 90vw;
    /* Allow modal to grow wider */
}

.modal-body {
    overflow-x: auto;
    /* Allow horizontal scrolling if needed */
}

.ql-toolbar {
    border: 1px solid var(--tn-border);
    border-radius: 0.375rem 0.375rem 0 0;
    background: rgba(255, 255, 255, 0.9);
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    /* Ensure toolbar spans full width */
}

.ql-container {
    border: none;
    background: white;
    min-height: 200px;
    height: 100%;
    width: 100%;
    /* Ensure container spans full width */
}

.ql-editor {
    min-height: 200px;
}

.fancy-note-content h1 {
    font-size: 1.5rem;
}

.fancy-note-content h2 {
    font-size: 1.3rem;
}

.fancy-note-content h3 {
    font-size: 1.1rem;
}

.fancy-note-content h4 {
    font-size: 1rem;
}

/* ===== Midnight Dark Theme (Theme ID 8) ===== */
body[data-theme-id="8"] .card {
    background: var(--widget-bg) !important;
    color: var(--widget-fg) !important;
}

body[data-theme-id="8"] .card .list-group-item {
    background: #4B5563 !important;
    color: var(--widget-fg) !important;
    border-color: var(--tn-border) !important;
}

body[data-theme-id="8"] .modal-content {
    background: #374151 !important;
    color: #F3F4F6 !important;
}

body[data-theme-id="8"] .modal-header,
body[data-theme-id="8"] .modal-footer {
    border-color: var(--tn-border) !important;
}

body[data-theme-id="8"] .form-control {
    background: #1F2937 !important;
    color: #F3F4F6 !important;
    border-color: var(--tn-border) !important;
}

body[data-theme-id="8"] .form-select {
    background-color: #1F2937 !important;
    color: #F3F4F6 !important;
    border-color: var(--tn-border) !important;
}

body[data-theme-id="8"] .form-control:focus {
    background: #1F2937 !important;
    color: #F3F4F6 !important;
    border-color: var(--tn-primary-500) !important;
}

body[data-theme-id="8"] .form-select:focus {
    background-color: #1F2937 !important;
    color: #F3F4F6 !important;
    border-color: var(--tn-primary-500) !important;
}

body[data-theme-id="8"] .nav-tabs .nav-link {
    color: #D1D5DB !important;
}

body[data-theme-id="8"] .nav-tabs .nav-link.active {
    background: var(--widget-bg) !important;
    color: var(--widget-fg) !important;
    border-color: var(--tn-primary-300) var(--tn-primary-300) var(--widget-bg) !important;
}

body[data-theme-id="8"] .dd-handle {
    background: #4B5563 !important;
    border-color: var(--tn-border) !important;
    color: #F3F4F6 !important;
}

body[data-theme-id="8"] .link-chip {
    background: #4B5563 !important;
    border-color: var(--tn-primary-300) !important;
    color: #F3F4F6 !important;
}

body[data-theme-id="8"] .link-chip:hover {
    background: #6B7280 !important;
}

body[data-theme-id="8"] .dropdown-menu {
    background: #374151 !important;
    border-color: var(--tn-border) !important;
}

body[data-theme-id="8"] .dropdown-item {
    color: #F3F4F6 !important;
}

body[data-theme-id="8"] .dropdown-item:hover {
    background: #4B5563 !important;
}

body[data-theme-id="8"] .card-header {
    background: linear-gradient(90deg, #2D3748, #4A5568) !important;
    color: #F3F4F6 !important;
    border-bottom: 1px solid var(--tn-border) !important;
}

body[data-theme-id="8"] .card[data-widget-type="2"] .card-header {
    background: linear-gradient(90deg, #0c1d30, #0c2338) !important;
}

body[data-theme-id="8"] .card[data-widget-type="4"] .card-header {
    background: linear-gradient(90deg, #1d1337, #311c61) !important;
}

body[data-theme-id="8"] .card[data-widget-type="5"] .card-header {
    background: linear-gradient(90deg, #021d15, #042d1f) !important;
}

body[data-theme-id="8"] .weather-greeting-card {
    background: rgba(55, 65, 81, 0.95) !important;
}

body[data-theme-id="8"] .greeting-text,
body[data-theme-id="8"] .weather-temp {
    color: #F3F4F6 !important;
}

body[data-theme-id="8"] .greeting-name,
body[data-theme-id="8"] .weather-desc,
body[data-theme-id="8"] .weather-location {
    color: #D1D5DB !important;
}

body[data-theme-id="8"] .weather-section {
    border-left-color: var(--tn-border) !important;
}

body[data-theme-id="8"] .fancy-note-content {
    background: rgba(75, 85, 99, 0.5) !important;
    color: #F3F4F6 !important;
}

body[data-theme-id="8"] .ql-toolbar {
    background: #4B5563 !important;
    border-color: var(--tn-border) !important;
}

body[data-theme-id="8"] .ql-container {
    background: #374151 !important;
    color: #F3F4F6 !important;
    border-color: var(--tn-border) !important;
}

body[data-theme-id="8"] .ql-editor {
    color: #F3F4F6 !important;
}

body[data-theme-id="8"] .ql-toolbar .ql-stroke {
    stroke: #D1D5DB !important;
}

body[data-theme-id="8"] .ql-toolbar .ql-fill {
    fill: #D1D5DB !important;
}

body[data-theme-id="8"] .ql-toolbar .ql-picker-label {
    color: #D1D5DB !important;
}

.bi-plus-circle-fill {
    color: #ffffff !important;
}

/* ===== RemindToDo Styles ===== */
.remindtodo-topic {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
}

.remindtodo-widget {
    border-color: #ffc107;
    min-height: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.remindtodo-widget .card-header {
    background: linear-gradient(90deg, #ffc107, #ffca28);
    flex: 0 0 auto;
}

.remindtodo-widget .card-body {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

#remindtodoList {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
}

#remindtodoList .list-group {
    margin-bottom: 0;
}

#remindtodoList .icon-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}

#remindtodoList li:hover .icon-btn {
    opacity: 1;
}

.remindtodo-check {
    cursor: pointer;
}

/* Ensure the error and loading states don't overflow */
#remindtodoLoading,
#remindtodoError {
    flex: 0 0 auto;
}

/* ===== ToReadLater Styles ===== */
.toreadlater-topic {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
}

.toreadlater-toolbar {
    padding: 0;
    margin: 0;
}

.toreadlater-shell {
    display: flex;
    gap: 12px;
    align-items: stretch;
    height: calc(100vh - 250px);
}

.toreadlater-pane-left {
    flex: 0 0 360px;
    width: 360px;
}

.toreadlater-pane-right {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
}

/* ToReadLater email list */
.toreadlater-sidebar {
    height: calc(100vh - 400px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.msg-list-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.msg-list-item.active {
    background: var(--tn-primary-300) !important;
    opacity: 0.9;
}

.msg-list-item.unread {
    border-left: 3px solid #4CAF50;
    padding-left: 12px !important;
}

.msg-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72%;
}

.msg-title.unread {
    font-weight: 600;
}

.msg-meta {
    color: var(--tn-primary-700);
    opacity: 0.7;
}

.badge-soft {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.35);
}

.badge-unread {
    background: rgba(76, 175, 80, 0.25);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.45);
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* ToReadLater reading pane */
.toreadlater-reading-card {
    border: 2px solid var(--tn-primary-300);
    box-shadow: 0 2px 8px rgba(14, 90, 90, .06);
    background: var(--widget-bg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.toreadlater-reading {
    height: calc(100vh - 280px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
}

.reading-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

#messageBody {
    background: var(--tn-background);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--tn-border);
}

#messageBody img {
    max-width: 100%;
    height: auto;
}

#messageBody table {
    width: auto;
    max-width: 100%;
}

/* Light mode for reading pane */
.toreadlater-reading-card.light-mode {
    background: #ffffff;
    border: 1px solid #dee2e6;
}

.toreadlater-reading-card.light-mode .card-body {
    color: #212529;
}

.toreadlater-reading-card.light-mode .text-muted {
    color: #6c757d !important;
}

.toreadlater-reading-card.light-mode .badge-soft {
    background: rgba(13, 110, 253, .1);
    color: #0d6efd;
    border: 1px solid rgba(13, 110, 253, .2);
}

.toreadlater-reading-card.light-mode .badge-unread {
    background: rgba(13, 110, 253, .15);
    color: #0d6efd;
    border: 1px solid rgba(13, 110, 253, .3);
}

.toreadlater-reading-card.light-mode #messageBody {
    background: #f8f9fa;
    color: #212529;
}

/* Mode toggle button */
.btn-mode-toggle {
    background: transparent;
    border: 1px solid var(--tn-border);
    color: var(--tn-primary-700);
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--tn-primary-500);
    color: var(--tn-primary-900);
}

.toreadlater-reading-card.light-mode .btn-mode-toggle {
    border: 1px solid #dee2e6;
    color: #495057;
}

.toreadlater-reading-card.light-mode .btn-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: #adb5bd;
    color: #212529;
}

/* Label input row */
.label-row {
    display: flex;
    gap: 8px;
}

/* Pulse animation for fetch button hint */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    }

    100% {
        transform: scale(1);
    }
}

/* Responsive adjustments for ToReadLater */
@media (max-width: 992px) {
    .toreadlater-shell {
        flex-direction: column;
        height: auto;
    }

    .toreadlater-pane-left {
        flex: 1 1 auto;
        width: 100%;
        max-height: 300px;
    }

    .toreadlater-pane-right {
        flex: 1 1 auto;
        width: 100%;
    }

    .toreadlater-sidebar {
        height: 200px;
    }

    .toreadlater-reading {
        height: 400px;
    }
}

/* Dark theme adjustments for ToReadLater */
body[data-theme-id="8"] .toreadlater-reading-card {
    background: #374151 !important;
    border-color: var(--tn-border) !important;
}

body[data-theme-id="8"] .toreadlater-reading-card .card-body {
    color: #F3F4F6 !important;
}

body[data-theme-id="8"] .msg-list-item {
    background: #1F2937 !important;
    color: #F3F4F6 !important;
}

body[data-theme-id="8"] .msg-list-item.active {
    background: #4B5563 !important;
}

body[data-theme-id="8"] .msg-list-item:hover {
    background: #374151 !important;
}

body[data-theme-id="8"] #messageBody {
    background: #1F2937 !important;
    color: #F3F4F6 !important;
    border-color: var(--tn-border) !important;
}

/* ===== VideoDigest Styles ===== */
.videodigest-topic {
    background: rgba(255, 87, 34, 0.1);
    border-left: 3px solid #FF5722;
}

.videodigest-widget {
    border-color: #FF5722;
    min-height: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.videodigest-widget .card-header {
    background: linear-gradient(90deg, #FF5722, #FF7043);
    flex: 0 0 auto;
}

.videodigest-widget .card-body {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

#videodigestContent {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Dark theme adjustments for VideoDigest */
body[data-theme-id="8"] .videodigest-widget {
    background: #374151;
    border-color: #FF5722;
}

body[data-theme-id="8"] .videodigest-widget .card-body {
    color: #F3F4F6;
}

/* VideoDigest Two-Column Layout */
.videodigest-toolbar {
    padding: 0;
    margin: 0;
}

.videodigest-shell {
    display: flex;
    gap: 12px;
    align-items: stretch;
    height: calc(100vh - 250px);
}

.videodigest-pane-left {
    flex: 0 0 360px;
    width: 360px;
}

.videodigest-pane-right {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
}

/* VideoDigest video list */
.videodigest-sidebar {
    height: calc(100vh - 400px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.video-list-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.video-list-item.active {
    background: var(--tn-primary-300) !important;
    opacity: 0.9;
}

.video-list-item.video-unwatched {
    border-left: 3px solid #FF5722;
    padding-left: 12px !important;
}

.video-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: 0.95rem;
}

.video-title.video-unwatched {
    font-weight: 600;
}

.video-meta {
    color: var(--tn-primary-700);
    opacity: 0.7;
    font-size: 0.75rem;
}

.badge-unwatched {
    background: rgba(255, 87, 34, 0.25);
    color: #FF5722;
    border: 1px solid rgba(255, 87, 34, 0.45);
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* VideoDigest reading pane */
.videodigest-reading-card {
    border: 2px solid var(--tn-primary-300);
    box-shadow: 0 2px 8px rgba(14, 90, 90, .06);
    background: var(--widget-bg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.videodigest-reading {
    height: calc(100vh - 280px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
}

.reading-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.video-summary-content {
    background: var(--tn-background);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--tn-border);
    line-height: 1.6;
}

.video-summary-content p {
    margin-bottom: 1rem;
}

.video-summary-content p:last-child {
    margin-bottom: 0;
}

.video-summary-content h1,
.video-summary-content h2,
.video-summary-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--tn-primary-900);
}

.video-summary-content h1 {
    font-size: 1.5rem;
}

.video-summary-content h2 {
    font-size: 1.3rem;
}

.video-summary-content h3 {
    font-size: 1.1rem;
}

.video-summary-content ul,
.video-summary-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

/* Responsive adjustments for VideoDigest */
@media (max-width: 992px) {
    .videodigest-shell {
        flex-direction: column;
        height: auto;
    }

    .videodigest-pane-left {
        flex: 1 1 auto;
        width: 100%;
        max-height: 300px;
    }

    .videodigest-pane-right {
        flex: 1 1 auto;
        width: 100%;
    }

    .videodigest-sidebar {
        height: 200px;
    }

    .videodigest-reading {
        height: 400px;
    }
}

/* Dark theme adjustments for VideoDigest reading pane */
body[data-theme-id="8"] .videodigest-reading-card {
    background: #374151 !important;
    border-color: var(--tn-border) !important;
}

body[data-theme-id="8"] .videodigest-reading-card .card-body {
    color: #F3F4F6 !important;
}

body[data-theme-id="8"] .video-list-item {
    background: #1F2937 !important;
    color: #F3F4F6 !important;
}

body[data-theme-id="8"] .video-list-item.active {
    background: #4B5563 !important;
}

body[data-theme-id="8"] .video-list-item:hover {
    background: #374151 !important;
}

body[data-theme-id="8"] .video-summary-content {
    background: #1F2937 !important;
    color: #F3F4F6 !important;
    border-color: var(--tn-border) !important;
}

body[data-theme-id="8"] .video-summary-content h1,
body[data-theme-id="8"] .video-summary-content h2,
body[data-theme-id="8"] .video-summary-content h3 {
    color: #F3F4F6 !important;
}

/* ===== Kanban Board Styles ===== */
.kanban-topic {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid #6366F1;
}

.kanban-icon {
    width: 28px;
    height: 28px;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.kanban-header-icon {
    width: 28px;
    height: 28px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.kanban-toolbar {
    padding: 0;
    margin: 0;
}

.kanban-shell {
    min-height: calc(100vh - 280px);
}

.kanban-project-tabs {
    border-bottom: 2px solid var(--tn-border);
}

.kanban-project-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--page-fg);
    padding: 0.5rem 1rem;
    margin-bottom: -2px;
}

.kanban-project-tabs .nav-link:hover {
    border-bottom-color: var(--tn-primary-300);
}

.kanban-project-tabs .nav-link.active {
    border-bottom-color: var(--tn-primary-500);
    color: var(--tn-primary-700);
    font-weight: 500;
}

.kanban-board-toolbar {
    background: var(--widget-bg);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--tn-border);
}

.kanban-board {
    overflow-x: auto;
    padding-bottom: 1rem;
}

.kanban-columns {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 320px);
    padding: 0;
}

.kanban-column {
    flex: 0 0 280px;
    width: 280px;
    background: #e8eef4;
    border-right: 2px solid #c5d3e0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 320px);
}

.kanban-column:first-child {
    border-left: 2px solid #c5d3e0;
}

.kanban-column:last-child {
    border-right: 2px solid #c5d3e0;
}

.kanban-column-header {
    background: linear-gradient(90deg, var(--tn-primary-500), var(--tn-primary-300));
    color: #fff;
    padding: 0.75rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.kanban-column-header .column-title {
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kanban-column-header .column-count {
    font-size: 0.85rem;
}

.kanban-column-header .column-actions .btn {
    color: rgba(255, 255, 255, 0.8);
    padding: 0;
}

.kanban-column-header .column-actions .btn:hover {
    color: #fff;
}

.kanban-cards {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.5rem;
    min-height: 100px;
}

.kanban-card {
    background: #fff;
    border: none;
    border-radius: 6px;
    padding: 0;
    margin-bottom: 0.5rem;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
}

.kanban-card-header {
    background: linear-gradient(135deg, var(--tn-primary-900), var(--tn-primary-700));
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px 6px 0 0;
}

.kanban-card-body {
    padding: 0.75rem;
    border-radius: 0 0 6px 6px;
}

.kanban-card .dropdown-menu.show {
    z-index: 1050;
    position: fixed !important;
}

.kanban-card-header .card-title {
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.kanban-card-header .card-actions .btn {
    color: #fff;
}

.kanban-card-header .card-actions .btn:hover {
    color: var(--tn-primary-100, #e0e7ff);
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card .card-title {
    font-weight: 500;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.kanban-card .card-description {
    font-size: 0.85rem;
    line-height: 1.4;
}

.kanban-card .card-actions .btn {
    font-size: 0.85rem;
}

.kanban-card .card-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Priority badges */
.kanban-card .priority-1 {
    background: #ffc107;
    color: #212529;
    font-size: 0.7rem;
    padding: 2px 6px;
}

.kanban-card .priority-2 {
    background: #fd7e14;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
}

.kanban-card .priority-3 {
    background: #dc3545;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* Card drag states */
.kanban-card-ghost {
    opacity: 0.4;
    background: var(--tn-primary-100);
}

.kanban-card-chosen {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.kanban-card-drag {
    opacity: 1;
}

/* Card assignees */
.card-assignees {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

.assignee-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366F1, #818CF8);
    color: white;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.assignee-badge.assignee-more {
    background: #6c757d;
    font-size: 9px;
    width: auto;
    padding: 0 6px;
    border-radius: 10px;
}

/* Watch button in column header */
.btn-watch-column {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-watch-column:hover,
.btn-watch-column.watching {
    opacity: 1;
}

.btn-watch-column.watching i {
    color: #ffc107;
}

/* Column drag states */
.kanban-column-header {
    cursor: grab;
}

.kanban-column-header:active {
    cursor: grabbing;
}

.kanban-column-ghost {
    opacity: 0.5;
    background: var(--tn-primary-50);
}

.kanban-column-chosen {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Empty column placeholder */
.kanban-empty-column {
    border: 2px dashed var(--tn-border);
    border-radius: 6px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--page-fg);
    opacity: 0.5;
    font-size: 0.9rem;
}

/* Dark theme adjustments for Kanban */
body[data-theme-id="8"] .kanban-column {
    background: #1f2937;
    border-color: #374151;
}

body[data-theme-id="8"] .kanban-card {
    background: #374151;
    border: none;
    color: #F3F4F6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body[data-theme-id="8"] .kanban-card-header {
    background: linear-gradient(135deg, #4B5563, #6B7280);
}

body[data-theme-id="8"] .kanban-card-body {
    background: #374151;
}

body[data-theme-id="8"] .kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body[data-theme-id="8"] .kanban-card:hover .kanban-card-header {
    background: linear-gradient(135deg, #6B7280, #9CA3AF);
}

body[data-theme-id="8"] .kanban-board-toolbar {
    background: #374151;
    border-color: #4B5563;
}

body[data-theme-id="8"] .kanban-empty-column {
    border-color: #4B5563;
    color: #9CA3AF;
}

/* Responsive adjustments for Kanban */
@media (max-width: 768px) {
    .kanban-columns {
        flex-direction: column;
        gap: 0;
        min-height: auto;
    }

    .kanban-column {
        flex: 1 1 auto;
        width: 100%;
        min-height: auto;
        border-right: none;
        border-left: none;
        border-bottom: 2px solid #c5d3e0;
    }

    .kanban-column:first-child {
        border-left: none;
        border-top: 2px solid #c5d3e0;
    }

    .kanban-column:last-child {
        border-right: none;
    }

    .kanban-card {
        cursor: pointer;
    }

    .kanban-shell {
        min-height: auto;
    }

    .kanban-board-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .kanban-board-toolbar .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
/* Target phones and small tablets */
@media (max-width: 768px) {

    /* ===== Body and Layout ===== */
    body {
        overflow-x: hidden;
    }

    /* ===== Navbar Adjustments ===== */
    .navbar {
        padding: 0.5rem 0.75rem !important;
        flex-wrap: wrap !important;
    }

    .navbar-brand {
        order: 1;
    }

    .brand-img {
        height: 50px !important;
    }

    .brand-nook-video {
        height: 55px !important;
    }

    .brand-tagline {
        display: none;
    }

    /* Move navbar buttons to second row */
    .navbar .ms-auto {
        order: 3;
        width: 100%;
        margin-top: 0.5rem !important;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .navbar .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .nav-icon-btn {
        padding: 0.2rem 0.35rem;
    }

    .nav-icon-btn img {
        width: 26px !important;
        height: 26px !important;
    }

    .nav-icon-btn i {
        font-size: 1.1rem;
    }

    /* ===== Sidebar → Bottom Navigation ===== */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        min-height: auto !important;
        height: auto;
        max-height: 60vh;
        z-index: 1000;
        background: linear-gradient(180deg, var(--tn-primary-900), var(--tn-primary-700));
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    /* Collapsed state */
    .sidebar:not(.mobile-expanded) {
        transform: translateY(calc(100% - 50px));
    }

    .sidebar:not(.mobile-expanded) #topicsList {
        display: none;
    }

    /* Hide hover hint on mobile */
    .sidebar .hover-hint {
        display: none;
    }

    /* Show mobile toggle */
    .sidebar::before {
        content: 'Topics';
        display: block;
        text-align: center;
        padding: 0.75rem;
        color: white;
        font-weight: 600;
        cursor: pointer;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        background: rgba(0, 0, 0, 0.1);
    }

    .sidebar.mobile-expanded::before {
        content: 'Topics ▼';
    }

    .sidebar .header {
        padding: 0.75rem 1rem;
    }

    #topicsList {
        max-height: 40vh;
        overflow-y: auto;
    }

    /* Topic rows in mobile sidebar */
    .sidebar .topic-row {
        padding: 0.5rem 1rem;
    }

    /* ===== Main Content Area ===== */
    main {
        padding: 0.5rem !important;
        padding-bottom: 60px !important;
        /* Space for bottom nav */
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    #widgetsArea {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* ===== Page Tabs → Horizontal Scroll ===== */
    .nav-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        border-bottom: 2px solid var(--tn-primary-300);
        margin-bottom: 0.5rem;
        scrollbar-width: thin;
    }

    .nav-tabs::-webkit-scrollbar {
        height: 3px;
    }

    .nav-tabs::-webkit-scrollbar-thumb {
        background: var(--tn-primary-300);
        border-radius: 3px;
    }

    .nav-tabs .nav-item {
        flex: 0 0 auto;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* ===== Action Buttons → FAB Menu ===== */
    .d-flex.align-items-center.justify-content-between.mb-2 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .d-flex.align-items-center.justify-content-between.mb-2>.d-flex {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Make buttons more touch-friendly */
    .btn-sm {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .btn-sm img {
        width: 20px !important;
        height: 20px !important;
    }

    /* ===== Widgets → Single Column ===== */
    .widgets-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    .widgets-grid .card {
        grid-column: 1 !important;
        max-height: none;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Widget headers */
    .card-header {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .card-header .widget-actions {
        gap: 0.5rem;
    }

    .card-body {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* ===== Links Widget Mobile ===== */
    .links-flow {
        gap: 0.5rem;
    }

    .link-chip {
        font-size: 0.85rem;
        padding: 0.35rem 0.6rem;
        max-width: 100%;
    }

    .link-chip span {
        max-width: calc(100vw - 120px);
    }

    /* ===== ToDos Widget Mobile ===== */
    .dd-handle {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
        padding: 0.6rem;
    }

    .dd-handle>div {
        width: 100%;
    }

    .item-icons {
        width: 100%;
        justify-content: flex-end !important;
    }

    .todo-title {
        font-size: 0.9rem;
    }

    /* ===== Notes Widget Mobile ===== */
    .note-title {
        font-size: 0.95rem;
    }

    .note-text {
        font-size: 0.85rem;
    }

    /* Fix notes list item to stack vertically on mobile */
    .widget-notes .list-group-item {
        flex-direction: column;
        align-items: stretch !important;
    }

    .widget-notes .list-group-item .note-content-wrapper {
        width: 100%;
        width: 100%;
        min-width: 0;
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }

    .widget-notes .list-group-item .item-icons {
        align-self: flex-end;
    }

    /* ===== Modals Mobile ===== */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem) !important;
    }

    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: calc(100vw - 1rem) !important;
    }

    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }

    /* Settings modal */
    #settingsModal .settings-card {
        padding: 1rem;
    }

    #settingsModal .row {
        margin: 0;
    }

    #settingsModal .col-md-6,
    #settingsModal .col-md-12 {
        padding: 0.5rem 0;
    }

    /* Manage links table */
    #manageLinksModal .table-responsive {
        font-size: 0.85rem;
    }

    #manageLinksModal td,
    #manageLinksModal th {
        padding: 0.5rem 0.25rem;
    }

    #manageLinksModal input[type="text"] {
        font-size: 0.85rem;
        padding: 0.35rem;
    }

    /* ===== Special Topics Mobile ===== */
    /* RemindToDo */
    .remindtodo-widget {
        min-height: 300px;
        max-height: 60vh;
    }

    /* ToReadLater */
    .toreadlater-shell {
        flex-direction: column;
        height: auto;
        gap: 1rem;
    }

    .toreadlater-pane-left,
    .toreadlater-pane-right {
        flex: 1 1 auto;
        width: 100%;
    }

    .toreadlater-pane-left {
        max-height: 40vh;
    }

    .toreadlater-sidebar {
        height: 35vh;
    }

    .toreadlater-reading {
        height: auto;
        min-height: 40vh;
        max-height: 60vh;
    }

    .reading-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start !important;
    }

    .msg-title {
        max-width: 100%;
    }

    /* VideoDigest */
    .videodigest-shell {
        flex-direction: column;
        height: auto;
        gap: 1rem;
    }

    .videodigest-pane-left,
    .videodigest-pane-right {
        flex: 1 1 auto;
        width: 100%;
    }

    .videodigest-pane-left {
        max-height: 40vh;
    }

    .videodigest-sidebar {
        height: 35vh;
    }

    .videodigest-reading {
        height: auto;
        min-height: 40vh;
        max-height: 60vh;
    }

    /* ===== Quill Editor Mobile ===== */
    .quill-resizable-container {
        min-height: 200px;
        resize: vertical;
    }

    .ql-toolbar {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .ql-editor {
        min-height: 150px;
        font-size: 0.9rem;
    }

    /* ===== Footer Mobile ===== */
    .footer {
        padding: 1rem 0;
        font-size: 0.8rem;
        margin-bottom: 50px;
        /* Space for bottom nav */
    }

    /* ===== Touch Improvements ===== */
    /* Bigger touch targets */
    .icon-btn {
        padding: 0.4rem !important;
        min-width: 36px;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Form elements */
    .form-control,
    .form-select {
        font-size: 16px !important;
        /* Prevents zoom on iOS */
        padding: 0.6rem;
    }

    /* Checkboxes and radios */
    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
        margin-top: 0;
    }

    /* ===== Prevent horizontal scroll ===== */
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* ===== Setup Wizard Mobile ===== */
    #setupWizardModal .wizard-structure {
        font-size: 0.85rem;
    }

    #setupWizardModal .wizard-topic .card-header {
        padding: 0.5rem;
    }

    #setupWizardModal .wizard-page {
        padding: 0.5rem;
        margin-left: 0.5rem;
    }

    #setupWizardModal .wizard-widgets {
        margin-left: 0.5rem;
        font-size: 0.8rem;
    }
}

/* ===== Extra Small Phones (< 375px) ===== */
@media (max-width: 374px) {
    .brand-img {
        height: 40px !important;
    }

    .brand-nook-video {
        height: 45px !important;
    }

    .navbar .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .nav-icon-btn {
        padding: 0.15rem 0.2rem;
    }

    .nav-icon-btn img {
        width: 20px !important;
        height: 20px !important;
    }

    .nav-icon-btn i {
        font-size: 0.9rem;
    }

    .nav-tabs .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .card-header {
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.85rem !important;
    }
}

/* ===== Landscape Mobile ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        max-height: 80vh;
    }

    #topicsList {
        max-height: 60vh;
    }

    .toreadlater-shell,
    .videodigest-shell {
        flex-direction: row;
    }

    .toreadlater-pane-left,
    .videodigest-pane-left {
        flex: 0 0 280px;
        max-height: none;
    }

    .toreadlater-sidebar,
    .videodigest-sidebar {
        height: calc(100vh - 350px);
    }

    /* Keep widgets in single column for narrow landscape viewports */
    .widgets-grid {
        grid-template-columns: 1fr !important;
    }

    .widgets-grid .card {
        grid-column: 1 / -1 !important;
    }
}

/* ===== Landscape Mobile - Wider devices (iPhone Pro Max, tablets) ===== */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {

    /* Force single column layout for landscape on devices up to 1024px wide */
    /* This prevents widget overlap on devices like iPhone 14 Pro Max (932px) */
    .widgets-grid {
        grid-template-columns: 1fr !important;
    }

    .widgets-grid .card {
        grid-column: 1 / -1 !important;
        max-height: 70vh;
    }
}

/* ===== Newsletter Setup Wizard ===== */
.step-indicator {
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--tn-border);
    z-index: 0;
}

.step-item {
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.step-item.active .step-circle {
    background: var(--tn-accent-500);
    color: white;
}

.step-item.completed .step-circle {
    background: var(--tn-success);
    color: white;
}

.step-label {
    font-size: 0.875rem;
    color: #6c757d;
}

.step-item.active .step-label {
    color: var(--tn-primary-700);
    font-weight: 500;
}

.sender-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--tn-border);
}

.sender-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.sender-item:last-child {
    border-bottom: none;
}

/* Newsletter setup modal specific */
#newsletterSetupModal .modal-dialog {
    max-width: 800px;
}

#sendersList {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--tn-border);
    border-radius: 8px;
    padding: 1rem;
}

/* Dark theme adjustments for Newsletter Setup */
body[data-theme-id="8"] .sender-item {
    background: transparent;
}

body[data-theme-id="8"] .sender-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

body[data-theme-id="8"] #sendersList {
    background: #374151;
    border-color: var(--tn-border);
}

body[data-theme-id="8"] .step-circle {
    background: #4B5563;
    color: #D1D5DB;
}

body[data-theme-id="8"] .step-item.active .step-circle {
    background: var(--tn-accent-500);
    color: white;
}

body[data-theme-id="8"] .step-item.completed .step-circle {
    background: var(--tn-success);
    color: white;
}

/* Setup Wizard Styles */
.wizard-topic {
    border: 2px solid #1E8A7A;
}

.wizard-topic.card {
    max-height: none !important;
}

.wizard-topic .card-header {
    padding: 0.75rem 1rem;
}

.wizard-topic .card-body {
    background: #ffffff;
}

.wizard-page {
    padding: 0.5rem;
    border-left: 3px solid #36A8A0;
    background: rgba(54, 168, 160, 0.05);
    border-radius: 0.25rem;
}

.wizard-widgets {
    font-size: 0.9rem;
}

.wizard-widgets .form-check {
    margin-bottom: 0.25rem;
}

#setupWizardModal .modal-dialog {
    max-height: 90vh;
}

#setupWizardModal .modal-body {
    max-height: calc(90vh - 200px);
}

/* ===== Link Drag & Drop Styles ===== */
/* Sortable.js styles for link reordering within widget */
.links-flow .link-chip {
    cursor: grab;
    user-select: none;
}

.links-flow .link-chip:active {
    cursor: grabbing;
}

.links-flow .link-chip.sortable-ghost {
    opacity: 0.4;
    background: var(--tn-primary-100);
}

.links-flow .link-chip.sortable-chosen {
    background: rgba(30, 138, 122, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.links-flow .link-chip.sortable-drag {
    opacity: 1;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Legacy draggable attribute styles (for extension drop) */
.link-chip[draggable="true"] {
    cursor: pointer;
    /* Show pointer by default for links */
}

.link-chip[draggable="true"]:active {
    cursor: grabbing;
    /* Show grabbing cursor only when actively dragging */
}

.links-drop-target {
    background: rgba(30, 138, 122, 0.1) !important;
    border: 2px dashed var(--tn-primary-500) !important;
    border-radius: 0.375rem;
    min-height: 60px;
    position: relative;
}

.links-drop-target::after {
    content: 'Drop link here';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--tn-primary-700);
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0.7;
}

/* Ensure links container has minimum height for empty state */
.links-flow {
    min-height: 40px;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.links-flow:empty {
    min-height: 60px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed var(--tn-border);
}

/* Dark theme adjustments */
body[data-theme-id="8"] .links-drop-target {
    background: rgba(30, 138, 122, 0.2) !important;
}

body[data-theme-id="8"] .links-drop-target::after {
    color: #F3F4F6;
}

/* Fix for Sports section in wizard - remove height restriction */
.wizard-topic .wizard-pages {
    max-height: none !important;
    overflow: visible !important;
}

/* ===== Prompt Library Styles ===== */
.prompt-library-grid {
    padding: 0.25rem;
}

.prompt-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.prompt-card:hover {
    border-color: var(--tn-primary-300);
    box-shadow: 0 2px 8px rgba(0, 96, 100, 0.15);
    transform: translateY(-1px);
}

.prompt-card .card-title {
    font-weight: 600;
    line-height: 1.3;
}

.prompt-card .badge {
    font-weight: 500;
}

/* Location Specific prompt indicator */
.prompt-card .bi-geo-alt-fill {
    font-size: 0.9rem;
}

/* Contribute modal */
#contributePromptModal code {
    background-color: rgba(0, 96, 100, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Location input modal */
#locationInputModal .modal-body {
    text-align: center;
}

#locationInputModal input {
    text-align: center;
}

/* Dark mode adjustments for prompt library */
body[data-theme-mode="dark"] .prompt-card {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
}

body[data-theme-mode="dark"] .prompt-card:hover {
    border-color: var(--tn-primary-500);
    box-shadow: 0 2px 8px rgba(0, 200, 200, 0.2);
}

body[data-theme-mode="dark"] #contributePromptModal code {
    background-color: rgba(255, 255, 255, 0.1);
}

/* AI Links tabs styling */
#aiLinksPromptTabs .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

#aiLinksPromptTabs .nav-link.active {
    font-weight: 600;
}

#aiLinksPromptTabContent {
    background-color: var(--tn-background);
}

/* Files Widget Styles */
.widget-files-container {
    padding: 0.5rem;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    padding: 0.5rem;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.file-item:hover {
    background-color: rgba(0, 96, 100, 0.05);
    transform: translateY(-2px);
}

.file-icon {
    font-size: 3rem;
    color: var(--tn-primary-300);
    margin-bottom: 0.5rem;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.file-ext {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    text-transform: uppercase;
}

.file-ext {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    text-transform: uppercase;
}

/* Quote Widget Styles */
.widget-quote-container {
    padding: 0.5rem;
}

.widget-quote-card {
    background: var(--quotes-bg, #FFF9F0);
    border-radius: 8px;
    border-left: 4px solid var(--tn-accent-500);
    padding: 1rem 1.25rem;
    position: relative;
}

.widget-quote-card::before {
    content: '"';
    position: absolute;
    left: 0.5rem;
    top: -0.1rem;
    font-size: 2.5rem;
    color: var(--tn-accent-500);
    opacity: 0.3;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1;
}

.widget-quote-text {
    color: var(--quotes-fg, #5D4E37);
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    word-wrap: break-word;
    padding-left: 0.5rem;
}

.widget-quote-author {
    color: var(--tn-primary-700);
    font-size: 0.9rem;
    text-align: right;
    margin-top: 0.75rem;
    opacity: 0.8;
}

/* RSS Feed Widget Styles */
.widget-rss-container {
    padding: 0.5rem 0;
}

.rss-feed-title {
    border-bottom: 1px solid var(--tn-border, rgba(0, 0, 0, 0.1));
    padding-bottom: 0.5rem;
}

.rss-feed-title i {
    color: var(--tn-primary-500, #f26522);
}

.rss-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rss-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    background: var(--task-item-bg, rgba(255, 255, 255, 0.5));
    border: 1px solid var(--tn-border, rgba(0, 0, 0, 0.1));
    transition: background-color 0.15s ease;
}

.rss-item:hover {
    background: var(--tn-primary-100, rgba(242, 101, 34, 0.1));
}

.rss-item-link {
    flex: 1;
    color: var(--tn-link-color, var(--tn-primary-700, #c54a15));
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rss-item-link:hover {
    color: var(--tn-primary-900, #8a3410);
    text-decoration: underline;
}

.rss-item-date {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--tn-text-muted, #6c757d);
    white-space: nowrap;
    padding-top: 0.1rem;
}

.rss-last-updated {
    text-align: right;
    padding-top: 0.5rem;
    border-top: 1px solid var(--tn-border, rgba(0, 0, 0, 0.1));
    margin-top: 0.5rem;
}

.rss-error {
    font-size: 0.8rem;
}

/* RSS pill button - orange/feed color */
.btn-add-pill.btn-rss-pill {
    background: #f26522;
}

.btn-add-pill.btn-rss-pill:hover {
    background: #d45a1f;
}

/* Spin animation for RSS refresh button */
@keyframes rss-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.rss-spin-animation {
    animation: rss-spin 1s linear infinite;
}

/* RSS Widget card body adjustments */
.card[data-widget-type="9"] .card-body {
    max-height: 400px;
    overflow-y: auto;
}

/* ========================================
   PORTFOLIO WIDGET STYLES
   ======================================== */
.widget-portfolio-container {
    padding: 0.5rem;
}

/* Portfolio Empty State */
.portfolio-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    text-align: center;
}

.portfolio-empty-nook {
    width: 100px;
    height: auto;
    margin-bottom: 1rem;
}

.portfolio-empty-bubble {
    background: var(--tn-background-alt, #f8f9fa);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    position: relative;
    max-width: 280px;
}

/* Portfolio Summary Section */
.portfolio-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--tn-background-alt, #f8f9fa);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.portfolio-total {
    display: flex;
    flex-direction: column;
}

.portfolio-total-label {
    font-size: 0.65rem;
    color: var(--tn-text-muted, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portfolio-total-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--tn-text-primary, #212529);
}

.portfolio-change {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.portfolio-change.gain {
    color: #28a745;
}

.portfolio-change.loss {
    color: #dc3545;
}

.portfolio-gain-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.portfolio-gain-percent {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Holdings List */
.portfolio-holdings {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portfolio-holding {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: var(--tn-card-bg, #ffffff);
    border: 1px solid var(--tn-border, rgba(0, 0, 0, 0.1));
    border-radius: 5px;
    font-size: 0.8rem;
    transition: box-shadow 0.15s ease;
}

.portfolio-holding:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.holding-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.holding-symbol {
    font-weight: 600;
    color: var(--tn-primary-700, #3b5998);
    cursor: grab;
}

.holding-symbol:active {
    cursor: grabbing;
}

.holding-company {
    font-size: 0.7rem;
    color: var(--tn-text-muted, #6c757d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.holding-shares {
    color: var(--tn-text-muted, #6c757d);
    font-size: 0.75rem;
    white-space: nowrap;
}

.holding-value {
    font-weight: 500;
    white-space: nowrap;
}

.holding-gain {
    white-space: nowrap;
    text-align: right;
}

.holding-gain.gain {
    color: #28a745;
}

.holding-gain.loss {
    color: #dc3545;
}

.holding-gain small {
    display: block;
    font-size: 0.7rem;
    opacity: 0.85;
}

.holding-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.portfolio-holding:hover .holding-actions {
    opacity: 1;
}

.holding-actions .icon-btn {
    padding: 0.25rem;
    font-size: 0.75rem;
}

/* Portfolio Last Updated */
.portfolio-updated {
    font-size: 0.75rem;
    text-align: right;
    color: var(--tn-text-muted, #6c757d);
    padding-top: 0.5rem;
    border-top: 1px solid var(--tn-border, rgba(0, 0, 0, 0.05));
    margin-top: 0.5rem;
}

/* Portfolio pill button - green/money color */
.btn-add-pill.btn-portfolio-pill {
    background: #28a745;
}

.btn-add-pill.btn-portfolio-pill:hover {
    background: #218838;
}

/* Spin animation for Portfolio refresh button */
@keyframes portfolio-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.portfolio-spin-animation {
    animation: portfolio-spin 1s linear infinite;
}

/* Drag ghost state */
.portfolio-holding-ghost {
    opacity: 0.4;
    background: var(--tn-primary-100, #e8f0fe);
}

/* Portfolio Widget card body adjustments */
.card[data-widget-type="10"] .card-body {
    max-height: 450px;
    overflow-y: auto;
}

/* Responsive adjustments for Portfolio widget */
@media (max-width: 768px) {
    .portfolio-summary {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .portfolio-change {
        text-align: center;
    }

    .portfolio-holding {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 0.5rem;
    }

    .holding-info {
        grid-column: 1;
    }

    .holding-value {
        grid-column: 2;
        text-align: right;
    }

    .holding-shares {
        grid-column: 1;
    }

    .holding-gain {
        grid-column: 2;
    }

    .holding-actions {
        grid-column: span 2;
        justify-content: flex-end;
        opacity: 1;
    }
}

@media (max-width: 576px) {
    .portfolio-total-value {
        font-size: 0.95rem;
    }

    .portfolio-gain-value {
        font-size: 0.8rem;
    }
}

/* Portfolio symbol search dropdown */
.portfolio-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    margin-top: 2px;
}

.portfolio-search-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.05));
    transition: background-color 0.15s ease;
}

.portfolio-search-item:last-child {
    border-bottom: none;
}

.portfolio-search-item:hover,
.portfolio-search-item.active {
    background-color: var(--tn-primary-100, #e8f0fe);
}

.portfolio-search-symbol {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--bs-body-color);
}

.portfolio-search-name {
    font-size: 0.8rem;
    color: var(--bs-secondary-color, #6c757d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portfolio-search-empty {
    padding: 0.75rem;
    text-align: center;
    color: var(--bs-secondary-color, #6c757d);
    font-style: italic;
}

/* ========================================
   SPORTS SCORES WIDGET STYLES
   ======================================== */

.widget-sports-container {
    padding: 0;
}

/* Empty State */
.sports-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    text-align: center;
}

.sports-empty-nook {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
}

.sports-empty-bubble {
    background: var(--tn-background-alt, #f8f9fa);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    max-width: 280px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* No Games State */
.sports-no-games {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--tn-text-muted, #6c757d);
    gap: 0.5rem;
}

.sports-no-games i {
    font-size: 2rem;
}

/* Collapsible League Sections */
.sports-league-section {
    border-bottom: 1px solid var(--tn-border, rgba(0, 0, 0, 0.08));
}

.sports-league-section:last-child {
    border-bottom: none;
}

.sports-league-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    background: var(--tn-background-alt, rgba(0, 0, 0, 0.03));
    transition: background-color 0.15s ease;
}

.sports-league-header:hover {
    background: var(--tn-background-hover, rgba(0, 0, 0, 0.06));
}

.sports-league-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--tn-text, #212529);
}

.sports-league-title i {
    color: var(--tn-text-muted, #6c757d);
}

.sports-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: #dc3545;
    color: white;
}

.sports-collapse-icon {
    color: var(--tn-text-muted, #6c757d);
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.sports-league-section.collapsed .sports-collapse-icon {
    transform: rotate(-90deg);
}

.sports-league-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sports-league-section.collapsed .sports-league-content {
    max-height: 0 !important;
    padding: 0;
}

/* Status Headers */
.sports-status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tn-text-muted, #6c757d);
    background: var(--tn-background-alt, rgba(0, 0, 0, 0.03));
    border-top: 1px solid var(--tn-border, rgba(0, 0, 0, 0.08));
}

.sports-status-header:first-child {
    border-top: none;
}

/* Standings header inside league section */
.sports-standings-header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tn-text-muted, #6c757d);
    border-top: 1px solid var(--tn-border, rgba(0, 0, 0, 0.06));
    margin-top: 0.5rem;
}

/* Live Dot */
.sports-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc3545;
    animation: sports-pulse 1.5s infinite;
}

.sports-live-dot-small {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #dc3545;
    animation: sports-pulse 1.5s infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes sports-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Game Card */
.sports-game-card {
    padding: 0.75rem;
    border-bottom: 1px solid var(--tn-border, rgba(0, 0, 0, 0.08));
    transition: background-color 0.15s ease;
}

.sports-game-card:last-child {
    border-bottom: none;
}

.sports-game-card:hover {
    background: var(--tn-background-alt, rgba(0, 0, 0, 0.02));
}

.sports-game-live {
    background: rgba(220, 53, 69, 0.05);
    border-left: 3px solid #dc3545;
}

/* Game Header */
.sports-game-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.sports-league-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: var(--tn-primary-100, #e8f0fe);
    color: var(--tn-primary-700, #1a73e8);
}

.sports-live-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: #dc3545;
    color: white;
}

.sports-final-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: var(--tn-text-muted, #6c757d);
    color: white;
}

.sports-canceled-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: #856404;
    color: #fff3cd;
}

.sports-game-clock {
    font-size: 0.75rem;
    color: var(--tn-text-muted, #6c757d);
    margin-left: auto;
}

.sports-scheduled-time {
    font-size: 0.75rem;
    color: var(--tn-text-muted, #6c757d);
    margin-left: auto;
}

/* Teams Display */
.sports-game-teams {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sports-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sports-team-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.sports-team-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.sports-team-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sports-team-record {
    font-size: 0.7rem;
    color: var(--tn-text-muted, #6c757d);
}

.sports-team-score {
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 2.5rem;
    text-align: right;
    color: var(--bs-body-color);
}

.sports-team-score.sports-winning {
    color: #28a745;
}

/* Quick Info Bar */
.sports-game-quick-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--tn-border, rgba(0, 0, 0, 0.08));
    font-size: 0.7rem;
    color: var(--tn-text-muted, #6c757d);
    flex-wrap: wrap;
}

.sports-broadcast i,
.sports-odds i {
    margin-right: 0.25rem;
}

.sports-expand-btn {
    margin-left: auto;
    padding: 0.25rem 0.4rem;
    border: none;
    background: transparent;
    color: var(--tn-text-muted, #6c757d);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.sports-expand-btn:hover {
    background: var(--tn-primary-100, #e8f0fe);
    color: var(--tn-primary-700, #1a73e8);
}

/* Game Details (Expanded) */
.sports-game-details {
    display: none;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--tn-border, rgba(0, 0, 0, 0.08));
}

.sports-detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--tn-text-muted, #6c757d);
    padding: 0.25rem 0;
}

.sports-detail-row i {
    width: 16px;
    text-align: center;
}

/* Leaders Section */
.sports-leaders {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--tn-background-alt, rgba(0, 0, 0, 0.02));
    border-radius: 6px;
}

.sports-leaders-title {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--tn-text-muted, #6c757d);
    margin-bottom: 0.25rem;
}

.sports-leader-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    padding: 0.2rem 0;
}

.sports-leader-category {
    font-weight: 500;
    min-width: 60px;
    color: var(--tn-text-muted, #6c757d);
}

.sports-leader-player {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sports-leader-player small {
    font-size: 0.65rem;
}

.sports-leader-value {
    font-weight: 600;
    color: var(--tn-primary-700, #1a73e8);
}

/* Linescores */
.sports-linescores {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    border: 1px solid var(--tn-border, rgba(0, 0, 0, 0.08));
    border-radius: 4px;
    overflow: hidden;
}

.sports-linescore-row {
    display: flex;
    align-items: center;
}

.sports-linescore-header {
    background: var(--tn-background-alt, #f8f9fa);
    font-weight: 600;
}

.sports-linescore-team {
    width: 50px;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
}

.sports-linescore-period {
    width: 24px;
    text-align: center;
    padding: 0.25rem 0;
    border-left: 1px solid var(--tn-border, rgba(0, 0, 0, 0.08));
}

.sports-linescore-total {
    width: 30px;
    text-align: center;
    padding: 0.25rem 0;
    border-left: 1px solid var(--tn-border, rgba(0, 0, 0, 0.08));
    font-weight: 700;
    background: var(--tn-background-alt, rgba(0, 0, 0, 0.02));
}

/* Tickets Link */
.sports-tickets-link {
    color: var(--tn-primary-700, #1a73e8);
    text-decoration: none;
    font-size: 0.75rem;
}

.sports-tickets-link:hover {
    text-decoration: underline;
}

/* Event Cards (F1, NASCAR, PGA) */
.sports-events-section {
    margin-top: 0.5rem;
}

.sports-event-card {
    padding: 0.75rem;
    border-bottom: 1px solid var(--tn-border, rgba(0, 0, 0, 0.08));
    transition: background-color 0.15s ease;
}

.sports-event-card:last-child {
    border-bottom: none;
}

.sports-event-card:hover {
    background: var(--tn-background-alt, rgba(0, 0, 0, 0.02));
}

.sports-event-live {
    background: rgba(220, 53, 69, 0.05);
    border-left: 3px solid #dc3545;
}

.sports-event-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.sports-event-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.sports-event-venue {
    font-size: 0.75rem;
    color: var(--tn-text-muted, #6c757d);
    margin-bottom: 0.25rem;
}

.sports-event-venue i {
    margin-right: 0.25rem;
}

.sports-event-broadcast {
    font-size: 0.7rem;
    color: var(--tn-text-muted, #6c757d);
    margin-bottom: 0.25rem;
}

.sports-event-broadcast i {
    margin-right: 0.25rem;
}

/* Event Results */
.sports-event-results {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--tn-background-alt, rgba(0, 0, 0, 0.02));
    border-radius: 4px;
}

.sports-results-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--tn-text-muted, #6c757d);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sports-result-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.8rem;
}

.sports-result-row:not(:last-child) {
    border-bottom: 1px dashed var(--tn-border, rgba(0, 0, 0, 0.08));
}

.sports-result-position {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    background: var(--tn-primary-100, #e8f0fe);
    color: var(--tn-primary-700, #1a73e8);
    border-radius: 50%;
}

.sports-result-winner .sports-result-position {
    background: #ffc107;
    color: #000;
}

.sports-result-name {
    flex: 1;
    font-weight: 500;
}

.sports-winner-icon {
    color: #ffc107;
    font-size: 0.85rem;
}

/* Standings Section (F1, NASCAR, PGA) */
.sports-standings-section {
    margin-top: 0.5rem;
    border-top: 1px solid var(--tn-border, rgba(0, 0, 0, 0.08));
    padding-top: 0.5rem;
}

.sports-season-year {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--tn-text-muted, #6c757d);
    margin-left: 0.5rem;
}

.sports-standings-group {
    margin-bottom: 0.75rem;
}

.sports-standings-group:last-child {
    margin-bottom: 0;
}

.sports-standings-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--tn-text-muted, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.75rem;
    background: var(--tn-background-alt, rgba(0, 0, 0, 0.02));
}

.sports-standings-table {
    padding: 0.25rem 0;
}

.sports-standing-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-bottom: 1px dashed var(--tn-border, rgba(0, 0, 0, 0.05));
}

.sports-standing-row:last-child {
    border-bottom: none;
}

.sports-standing-row:hover {
    background: var(--tn-background-alt, rgba(0, 0, 0, 0.02));
}

.sports-standing-leader {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.1) 0%, transparent 100%);
}

.sports-standing-leader .sports-standing-rank {
    background: #ffc107;
    color: #000;
}

.sports-standing-rank {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    background: var(--tn-background-alt, #e9ecef);
    color: var(--tn-text-muted, #6c757d);
    border-radius: 4px;
    flex-shrink: 0;
}

.sports-standing-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 50%;
}

.sports-standing-name {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sports-standing-points {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--tn-primary-700, #1a73e8);
    flex-shrink: 0;
}

.sports-standing-wins {
    font-size: 0.7rem;
    color: #ffc107;
    flex-shrink: 0;
}

.sports-standing-wins i {
    font-size: 0.65rem;
}

/* Teams Summary */
.sports-teams-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--tn-background-alt, rgba(0, 0, 0, 0.02));
    border-top: 1px solid var(--tn-border, rgba(0, 0, 0, 0.08));
    flex-wrap: wrap;
}

.sports-teams-label {
    font-size: 0.7rem;
    color: var(--tn-text-muted, #6c757d);
}

.sports-team-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    background: var(--bs-body-bg, #fff);
    border: 2px solid var(--tn-border, #dee2e6);
    min-width: 28px;
    height: 28px;
}

.sports-chip-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.sports-chip-abbrev {
    font-size: 0.6rem;
}

.sports-more-teams {
    background: var(--tn-text-muted, #6c757d);
    color: white;
    border-color: transparent;
}

/* Last Updated */
.sports-updated {
    font-size: 0.7rem;
    text-align: right;
    color: var(--tn-text-muted, #6c757d);
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--tn-border, rgba(0, 0, 0, 0.05));
}

.sports-auto-refresh-indicator {
    margin-left: 0.25rem;
    color: #28a745;
}

.sports-auto-refresh-indicator i {
    animation: sports-spin 2s linear infinite;
}

/* Spin Animation */
@keyframes sports-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.sports-spin-animation {
    animation: sports-spin 1s linear infinite;
}

/* Sports Pill Button - Orange/Sports color */
.btn-add-pill.btn-sports-pill {
    background: #fd7e14;
}

.btn-add-pill.btn-sports-pill:hover {
    background: #e96d0c;
}

/* Add Team Modal - Team Preview */
.sports-team-preview-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--tn-background-alt, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--tn-border, #dee2e6);
}

.sports-preview-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.sports-preview-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

/* Manage Teams Modal */
.sports-manage-teams-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sports-manage-team-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--tn-background-alt, #f8f9fa);
    border-radius: 6px;
    border: 1px solid var(--tn-border, #dee2e6);
}

.sports-manage-team-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sports-manage-team-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Widget card body adjustments */
.card[data-widget-type="11"] .card-body {
    max-height: 500px;
    overflow-y: auto;
    padding: 0;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .sports-team-name {
        font-size: 0.8rem;
    }

    .sports-team-score {
        font-size: 1.1rem;
    }

    .sports-team-logo {
        width: 24px;
        height: 24px;
    }

    .sports-game-quick-info {
        font-size: 0.65rem;
    }

    .sports-game-header {
        font-size: 0.7rem;
    }
}

/* Mobile responsive RSS widget */
@media (max-width: 768px) {
    .rss-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .rss-item-date {
        align-self: flex-end;
    }
}

/* AI Theme Generator Styles */
#aiThemePreview .card {
    border: 1px solid #dee2e6;
    font-size: 0.875rem;
}

#aiThemePreview .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#aiThemeModal .modal-lg {
    max-width: 900px;
}

#aiThemeGenerating {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#aiThemeGenerating {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Premium Locked Button Styles */
.btn-premium-locked {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.btn-premium-locked:hover {
    opacity: 0.7;
}

/* Theme Gallery Styles */
.theme-card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.theme-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-preview-mini {
    position: relative;
    overflow: hidden;
}

.theme-preview-mini::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
}

/* Theme Preview Mockup Styles */
.theme-preview-mockup {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-preview-mockup .theme-preview-sidebar {
    transition: width 0.2s ease;
}

@media (max-width: 767.98px) {
    .theme-preview-mockup .d-flex {
        flex-direction: column;
    }

    .theme-preview-mockup .theme-preview-sidebar {
        width: 100% !important;
        flex-direction: row !important;
        display: flex !important;
        flex-wrap: wrap;
        padding: 0.5rem !important;
    }

    .theme-preview-mockup .theme-preview-sidebar>div:first-child {
        width: 100%;
        border-bottom: none !important;
        margin-bottom: 0.25rem;
    }

    .theme-preview-mockup .theme-preview-sidebar>div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.25rem !important;
    }

    .theme-preview-mockup .theme-preview-sidebar>div:last-child>div:first-child {
        display: none;
    }

    .theme-preview-mockup .theme-preview-sidebar>div:last-child>div:not(:first-child) {
        flex: 0 0 auto;
    }
}

#themeGalleryGrid .card-body {
    padding: 1rem;
}

#themeGalleryGrid .card-footer {
    padding: 0.5rem;
}

#themeGalleryGrid .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#themePreviewContent .card {
    border: 1px solid #dee2e6;
    font-size: 0.875rem;
}

#themePreviewContent .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.bi-star-fill,
.bi-star-half {
    font-size: 0.875rem;
}

.bi-star {
    font-size: 0.875rem;
}

/* Pagination styling */
#themeGalleryPagination .pagination {
    margin: 0;
}

#themeGalleryPagination .page-link {
    color: var(--tn-primary-700);
    border-color: var(--tn-border);
}

#themeGalleryPagination .page-item.active .page-link {
    background-color: var(--tn-primary-500);
    border-color: var(--tn-primary-500);
}

#themeGalleryPagination .page-link:hover {
    background-color: var(--tn-primary-300);
    border-color: var(--tn-primary-300);
    color: white;
}

/* ============================================
   INBOX STYLES
   ============================================ */

#messageList .list-group-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

#messageList .list-group-item:hover {
    background-color: var(--bs-light);
}

#messageList .list-group-item.active {
    background-color: var(--tn-primary-500);
    border-color: var(--tn-primary-500);
    color: white;
}

#messageList .list-group-item.active .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.message-body {
    line-height: 1.6;
    word-wrap: break-word;
}

.message-body p {
    margin-bottom: 1rem;
}

.message-body img {
    max-width: 100%;
    height: auto;
}

#replyEditor {
    outline: none;
}

#replyEditor:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#inboxBtn img {
    transition: transform 0.2s;
}

#inboxBtn:hover img {
    transform: scale(1.1);
}

/* End Inbox Styles */

/* ===== Collaborative Topics Styles ===== */

/* Collaborative topic icon */
.collaborative-icon {
    color: #ffc107;
    margin-right: 0.35rem;
    font-size: 0.85em;
}

/* Collaborative topic row styling */
.sidebar .topic-row.collaborative-topic {
    position: relative;
}

/* Collaborative topic link - add left border indicator */
.sidebar .topic-row.collaborative-topic .topic-link {
    border-left: 3px solid #ffc107;
    padding-left: 0.5rem;
    margin-left: -3px;
}

/* Collaborative topic owned by user - green accent */
.sidebar .topic-row.collaborative-owner .topic-link {
    border-left-color: #28a745;
}

.sidebar .topic-row.collaborative-owner .collaborative-icon {
    color: #28a745;
}

/* Collaborative topic where user is a member - yellow/gold accent */
.sidebar .topic-row.collaborative-member .topic-link {
    border-left-color: #ffc107;
}

.sidebar .topic-row.collaborative-member .collaborative-icon {
    color: #ffc107;
}

/* Make collaborative button */
.sidebar .btn-make-collab {
    color: rgba(255, 255, 255, 0.7) !important;
}

.sidebar .btn-make-collab:hover {
    color: #ffc107 !important;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 0.25rem;
}

/* Manage collaborators button */
.sidebar .btn-manage-collab {
    color: #ffc107 !important;
}

.sidebar .btn-manage-collab:hover {
    color: #fff !important;
    background: rgba(255, 193, 7, 0.3);
    border-radius: 0.25rem;
}

/* Leave collaborative button */
.sidebar .btn-leave-collab {
    color: #dc3545 !important;
    opacity: 0.8;
}

.sidebar .btn-leave-collab:hover {
    color: #fff !important;
    background: rgba(220, 53, 69, 0.3);
    border-radius: 0.25rem;
    opacity: 1;
}

/* End Collaborative Topics Styles */

/* ===== Responsive Styles for 1920x1080 and smaller screens ===== */
@media (max-width: 1920px) {

    /* Widget title bar text - slightly smaller */
    .card-header {
        font-size: 0.95rem;
        padding: 0.6rem 0.75rem;
    }

    .card-header .icon-btn i {
        font-size: 0.9rem;
    }

    /* Page/tab titles - slightly smaller */
    .nav-tabs .nav-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    /* Links widget - slightly smaller */
    .link-chip {
        font-size: 0.85rem;
        padding: 0.22rem 0.45rem;
    }

    .link-chip .favicon {
        width: 15px;
        height: 15px;
    }

    /* Todo items - slightly smaller */
    .dd-handle {
        font-size: 0.9rem;
        padding: 0.45rem 0.7rem;
    }

    /* Sidebar topic links - slightly smaller */
    .sidebar .topic-link {
        font-size: 0.9rem;
    }

    .sidebar .header {
        font-size: 0.9rem;
    }

    /* Add Page, Add Widget, AI buttons - smaller icons */
    #btnAddPage img,
    #btnAddWidget img,
    #btnAddLinksWidgetAI img,
    #btnAddTodosWidgetAI img {
        width: 32px !important;
        height: 32px !important;
    }

    /* Limit quotes to 2 */
    .quote-card:nth-child(n+3) {
        display: none !important;
    }
}

@media (max-width: 1600px) {

    /* Widget title bar text - smaller */
    .card-header {
        font-size: 0.9rem;
        padding: 0.55rem 0.7rem;
    }

    .card-header .icon-btn i {
        font-size: 0.85rem;
    }

    /* Page/tab titles - smaller */
    .nav-tabs .nav-link {
        font-size: 0.85rem;
        padding: 0.35rem 0.7rem;
    }

    /* Links widget - smaller */
    .link-chip {
        font-size: 0.82rem;
        padding: 0.2rem 0.4rem;
    }

    .link-chip .favicon {
        width: 14px;
        height: 14px;
    }

    /* Todo items - smaller */
    .dd-handle {
        font-size: 0.85rem;
        padding: 0.4rem 0.65rem;
    }

    /* Sidebar topic links - smaller */
    .sidebar .topic-link {
        font-size: 0.85rem;
        padding: 0.3rem 0.45rem;
    }

    .sidebar .header {
        font-size: 0.85rem;
    }

    /* Add Page, Add Widget, AI buttons - smaller */
    #btnAddPage img,
    #btnAddWidget img,
    #btnAddLinksWidgetAI img,
    #btnAddTodosWidgetAI img {
        width: 28px !important;
        height: 28px !important;
    }

    #btnAddPage,
    #btnAddWidget,
    #btnAddLinksWidgetAI,
    #btnAddTodosWidgetAI {
        padding: 0.2rem 0.4rem !important;
    }
}

@media (max-width: 1366px) {

    /* Widget title bar text - even smaller for common laptop screens */
    .card-header {
        font-size: 0.85rem;
        padding: 0.5rem 0.65rem;
    }

    .card-header .icon-btn i {
        font-size: 0.8rem;
    }

    /* Page/tab titles */
    .nav-tabs .nav-link {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    /* Links widget - even smaller */
    .link-chip {
        font-size: 0.78rem;
        padding: 0.18rem 0.35rem;
    }

    .link-chip .favicon {
        width: 13px;
        height: 13px;
    }

    /* Todo items - even smaller */
    .dd-handle {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }

    /* Sidebar topic links - even smaller */
    .sidebar .topic-link {
        font-size: 0.8rem;
        padding: 0.28rem 0.4rem;
    }

    .sidebar .header {
        font-size: 0.8rem;
    }

    /* Add Page, Add Widget, AI buttons */
    #btnAddPage img,
    #btnAddWidget img,
    #btnAddLinksWidgetAI img,
    #btnAddTodosWidgetAI img {
        width: 24px !important;
        height: 24px !important;
    }

    #btnAddPage,
    #btnAddWidget,
    #btnAddLinksWidgetAI,
    #btnAddTodosWidgetAI {
        padding: 0.15rem 0.35rem !important;
        margin-left: 0.3rem !important;
    }
}

@media (max-width: 1280px) {

    /* Widget title bar text */
    .card-header {
        font-size: 0.82rem;
        padding: 0.45rem 0.6rem;
    }

    .card-header .icon-btn i {
        font-size: 0.75rem;
    }

    /* Page/tab titles */
    .nav-tabs .nav-link {
        font-size: 0.78rem;
        padding: 0.28rem 0.55rem;
    }

    /* Links widget - smallest desktop size */
    .link-chip {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
    }

    .link-chip .favicon {
        width: 12px;
        height: 12px;
    }

    /* Todo items - smallest desktop size */
    .dd-handle {
        font-size: 0.78rem;
        padding: 0.3rem 0.55rem;
    }

    /* Sidebar topic links - smallest desktop size */
    .sidebar .topic-link {
        font-size: 0.78rem;
        padding: 0.25rem 0.35rem;
    }

    .sidebar .header {
        font-size: 0.78rem;
    }

    /* Add Page, Add Widget, AI buttons */
    #btnAddPage img,
    #btnAddWidget img,
    #btnAddLinksWidgetAI img,
    #btnAddTodosWidgetAI img {
        width: 22px !important;
        height: 22px !important;
    }
}

/* ===== Chat Feature Styles ===== */

/* Chat contact item hover effect */
.chat-contact-item:hover {
    background-color: var(--bs-light, #f8f9fa);
}

/* Chat message bubbles */
.chat-message .bg-primary {
    background-color: var(--tn-primary-700, #0d6efd) !important;
}

.chat-message .bg-light {
    background-color: var(--bs-gray-100, #f8f9fa) !important;
    color: var(--bs-dark, #212529);
}

/* Chat images */
.chat-image {
    display: block;
    max-width: 100%;
    max-height: 200px;
    border-radius: 0.375rem;
    transition: transform 0.2s ease;
}

.chat-image:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

/* Chat image preview in input area */
#chatImagePreview {
    background-color: var(--bs-gray-100, #f8f9fa);
    border-radius: 0.375rem;
    padding: 0.5rem;
}

#chatImagePreview img {
    display: block;
    max-height: 150px;
    max-width: 100%;
    border-radius: 0.25rem;
}

/* Chat emoji picker */
#chatEmojiPicker {
    bottom: 50px;
    left: 0;
}

#chatEmojiPicker emoji-picker {
    --num-columns: 8;
    --emoji-size: 1.3rem;
    --background: #fff;
    height: 300px;
    width: 320px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Online status dot animation */
.chat-online-dot.bg-success {
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Chat modal responsive adjustments */
@media (max-width: 768px) {
    #chatModal .modal-dialog {
        max-width: 100%;
        margin: 0.5rem;
    }

    #chatModal .row {
        flex-direction: column;
        height: auto !important;
    }

    #chatModal .col-md-4,
    #chatModal .col-md-8 {
        width: 100%;
    }

    #chatModal .col-md-4 {
        max-height: 200px;
        border-end: none !important;
        border-bottom: 1px solid var(--bs-border-color);
    }

    #chatModal .col-md-8 {
        min-height: 350px;
    }

    #chatContactList {
        max-height: 150px !important;
    }

    #chatPendingSection {
        display: none !important;
    }
}

/* Chat modal draggable and resizable */
#chatModal .modal-dialog {
    margin: 1.75rem auto;
    transition: none;
}

#chatModal.draggable .modal-dialog {
    margin: 0;
    position: fixed;
}

#chatModal .modal-header {
    cursor: move;
}

#chatModal .modal-content {
    resize: both;
    overflow: hidden;
    min-width: 400px;
    min-height: 400px;
}

#chatModal .modal-body .row {
    height: 100%;
}

/* Resize handle indicator */
#chatModal .modal-content::after {
    content: '';
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--bs-secondary);
    border-bottom: 2px solid var(--bs-secondary);
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Nook Mascot Empty State ===== */
.nook-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    min-height: 400px;
}

.nook-mascot-image {
    max-width: 200px;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.nook-mascot-image:hover {
    transform: scale(1.05);
}

.nook-video-container {
    position: relative;
    display: inline-block;
}

.nook-mascot-video {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    cursor: pointer;
}

.nook-audio-toggle {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.nook-audio-toggle:hover {
    background: rgba(0, 0, 0, 0.8);
}

.nook-empty-text {
    margin-top: 1.5rem;
    font-size: 1.25rem;
    color: var(--tn-primary-700);
    font-weight: 500;
}

/* Responsive adjustments for Nook */
@media (max-width: 576px) {
    .nook-empty-state {
        padding: 2rem 1rem;
        min-height: 300px;
    }

    .nook-mascot-image {
        max-width: 150px;
    }

    .nook-mascot-video {
        max-width: 200px;
    }

    .nook-audio-toggle {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        bottom: 8px;
        right: 8px;
    }

    .nook-empty-text {
        font-size: 1rem;
    }
}

/* ===== Nook No Pages State (Speech Bubbles) ===== */
.nook-no-pages-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    min-height: 400px;
}

.nook-speech-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 900px;
    width: 100%;
}

.nook-mascot-center {
    flex-shrink: 0;
}

.nook-mascot-center .nook-mascot-image {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.nook-speech-bubble {
    position: relative;
    background: var(--tn-primary-100, #e8f4f8);
    border: 2px solid var(--tn-primary-300, #7dc4d4);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    max-width: 280px;
    color: var(--tn-primary-700, #2c5f6e);
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nook-speech-bubble p {
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
}

.nook-speech-icon {
    width: 56px;
    height: 56px;
    vertical-align: middle;
    display: inline-block;
    margin: 0 0.25rem;
}

/* Left speech bubble - arrow pointing right toward Nook */
.nook-speech-left::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 12px solid var(--tn-primary-100, #e8f4f8);
}

.nook-speech-left::before {
    content: '';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 14px solid var(--tn-primary-300, #7dc4d4);
}

/* Right speech bubble - arrow pointing left toward Nook */
.nook-speech-right::after {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 12px solid var(--tn-primary-100, #e8f4f8);
}

.nook-speech-right::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 14px solid var(--tn-primary-300, #7dc4d4);
}

/* Responsive adjustments for Nook No Pages State */
@media (max-width: 768px) {
    .nook-speech-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .nook-mascot-center {
        order: -1;
        /* Put Nook on top on mobile */
    }

    .nook-mascot-center .nook-mascot-image {
        max-width: 140px;
    }

    .nook-speech-bubble {
        max-width: 300px;
    }

    /* Adjust arrows for vertical layout - both point up toward Nook */
    .nook-speech-left::after,
    .nook-speech-right::after {
        right: auto;
        left: 50%;
        top: -10px;
        transform: translateX(-50%);
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-bottom: 12px solid var(--tn-primary-100, #e8f4f8);
        border-top: none;
    }

    .nook-speech-left::before,
    .nook-speech-right::before {
        right: auto;
        left: 50%;
        top: -14px;
        transform: translateX(-50%);
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-bottom: 14px solid var(--tn-primary-300, #7dc4d4);
        border-top: none;
    }
}

@media (max-width: 576px) {
    .nook-no-pages-state {
        padding: 2rem 1rem;
        min-height: 300px;
    }

    .nook-mascot-center .nook-mascot-image {
        max-width: 120px;
    }

    .nook-speech-bubble {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
    }

    .nook-speech-icon {
        width: 44px;
        height: 44px;
    }
}

/* ===== Nook Empty Widgets State (3 Speech Bubbles) ===== */
.nook-widgets-state {
    min-height: 450px;
}

.nook-widgets-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1000px;
    width: 100%;
}

.nook-center-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.nook-center-column .nook-mascot-center {
    position: relative;
}

.nook-center-column .nook-video-container {
    position: relative;
    display: inline-block;
}

.nook-center-column .nook-mascot-video {
    max-width: 250px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    cursor: pointer;
}

/* Top speech bubble - arrow pointing down toward Nook */
.nook-speech-top {
    max-width: 300px;
}

.nook-speech-top::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid var(--tn-primary-100, #e8f4f8);
}

.nook-speech-top::before {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 14px solid var(--tn-primary-300, #7dc4d4);
}

/* Responsive adjustments for Nook Widgets State */
@media (max-width: 992px) {
    .nook-widgets-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .nook-center-column {
        order: -1;
        /* Put center column (with Nook) on top */
    }

    .nook-center-column .nook-mascot-image {
        max-width: 140px;
    }

    .nook-speech-bubble {
        max-width: 320px;
    }

    /* Adjust left/right arrows to point up on mobile */
    .nook-widgets-state .nook-speech-left::after,
    .nook-widgets-state .nook-speech-right::after {
        right: auto;
        left: 50%;
        top: -10px;
        transform: translateX(-50%);
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-bottom: 12px solid var(--tn-primary-100, #e8f4f8);
        border-top: none;
    }

    .nook-widgets-state .nook-speech-left::before,
    .nook-widgets-state .nook-speech-right::before {
        right: auto;
        left: 50%;
        top: -14px;
        transform: translateX(-50%);
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-bottom: 14px solid var(--tn-primary-300, #7dc4d4);
        border-top: none;
    }

    /* Top bubble becomes regular bubble pointing up */
    .nook-speech-top::after {
        bottom: auto;
        top: -10px;
        border-top: none;
        border-bottom: 12px solid var(--tn-primary-100, #e8f4f8);
    }

    .nook-speech-top::before {
        bottom: auto;
        top: -14px;
        border-top: none;
        border-bottom: 14px solid var(--tn-primary-300, #7dc4d4);
    }
}

@media (max-width: 576px) {
    .nook-widgets-state {
        min-height: 400px;
        padding: 2rem 0.75rem;
    }

    .nook-center-column .nook-mascot-image {
        max-width: 120px;
    }

    .nook-center-column .nook-mascot-video {
        max-width: 180px;
    }

    .nook-widgets-state .nook-speech-bubble {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
        max-width: 280px;
    }
}

/* ===== Links Widget Empty State ===== */
.links-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 1rem;
    min-height: 100px;
}

.links-empty-nook {
    width: 60px;
    height: auto;
    flex-shrink: 0;
}

.links-empty-bubble {
    position: relative;
    background: var(--tn-primary-100, #e7f1ff);
    border: 2px solid var(--tn-primary-300, #9ec5fe);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    max-width: 280px;
    color: var(--tn-primary-700, #0a58ca);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Speech bubble pointer/tail */
.links-empty-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 12px 8px 0;
    border-style: solid;
    border-color: transparent var(--tn-primary-300, #9ec5fe) transparent transparent;
}

.links-empty-bubble::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 10px 6px 0;
    border-style: solid;
    border-color: transparent var(--tn-primary-100, #e7f1ff) transparent transparent;
}

/* Pulse animation for Links pill button when empty */
.links-pill-pulse {
    animation: links-pill-pulse 2s ease-in-out infinite;
}

@keyframes links-pill-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 12px 4px rgba(13, 110, 253, 0.3);
    }
}

/* Responsive adjustments for Links empty state */
@media (max-width: 576px) {
    .links-empty-state {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .links-empty-nook {
        width: 50px;
    }

    .links-empty-bubble {
        max-width: 100%;
    }

    .links-empty-bubble::before,
    .links-empty-bubble::after {
        left: 50%;
        top: -12px;
        transform: translateX(-50%) rotate(90deg);
    }

    .links-empty-bubble::after {
        top: -8px;
    }
}

/* ===== Tasks Widget Empty State ===== */
.tasks-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 1rem;
    min-height: 100px;
}

.tasks-empty-nook {
    width: 60px;
    height: auto;
    flex-shrink: 0;
}

.tasks-empty-bubble {
    position: relative;
    background: var(--tn-primary-100, #e7f1ff);
    border: 2px solid var(--tn-primary-300, #9ec5fe);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    max-width: 280px;
    color: var(--tn-primary-700, #0a58ca);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Speech bubble pointer/tail */
.tasks-empty-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 12px 8px 0;
    border-style: solid;
    border-color: transparent var(--tn-primary-300, #9ec5fe) transparent transparent;
}

.tasks-empty-bubble::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 10px 6px 0;
    border-style: solid;
    border-color: transparent var(--tn-primary-100, #e7f1ff) transparent transparent;
}

/* Pulse animation for Tasks pill button when empty */
.tasks-pill-pulse {
    animation: tasks-pill-pulse 2s ease-in-out infinite;
}

@keyframes tasks-pill-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 12px 4px rgba(13, 110, 253, 0.3);
    }
}

/* Responsive adjustments for Tasks empty state */
@media (max-width: 576px) {
    .tasks-empty-state {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .tasks-empty-nook {
        width: 50px;
    }

    .tasks-empty-bubble {
        max-width: 100%;
    }

    .tasks-empty-bubble::before,
    .tasks-empty-bubble::after {
        left: 50%;
        top: -12px;
        transform: translateX(-50%) rotate(90deg);
    }

    .tasks-empty-bubble::after {
        top: -8px;
    }
}

/* ===== Notes Widget Empty State ===== */
.notes-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
}

/* Hide empty notes list completely */
.widget-notes.d-none {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

.notes-empty-nook {
    width: 60px;
    height: auto;
    flex-shrink: 0;
}

.notes-empty-bubble {
    position: relative;
    background: var(--tn-primary-100, #e7f1ff);
    border: 2px solid var(--tn-primary-300, #9ec5fe);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    max-width: 280px;
    color: var(--tn-primary-700, #0a58ca);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Pulse animation for Notes bubble */
.notes-bubble-pulse {
    animation: notes-bubble-pulse 2s ease-in-out infinite;
}

@keyframes notes-bubble-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }

    50% {
        box-shadow: 0 0 12px 4px rgba(13, 110, 253, 0.3);
    }
}

/* Speech bubble pointer/tail */
.notes-empty-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 12px 8px 0;
    border-style: solid;
    border-color: transparent var(--tn-primary-300, #9ec5fe) transparent transparent;
}

.notes-empty-bubble::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 10px 6px 0;
    border-style: solid;
    border-color: transparent var(--tn-primary-100, #e7f1ff) transparent transparent;
}

/* Pulse animation for Notes pill button when empty */
.notes-pill-pulse {
    animation: notes-pill-pulse 2s ease-in-out infinite;
}

@keyframes notes-pill-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 12px 4px rgba(13, 110, 253, 0.3);
    }
}

/* Responsive adjustments for Notes empty state */
@media (max-width: 576px) {
    .notes-empty-state {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .notes-empty-nook {
        width: 50px;
    }

    .notes-empty-bubble {
        max-width: 100%;
    }

    .notes-empty-bubble::before,
    .notes-empty-bubble::after {
        left: 50%;
        top: -12px;
        transform: translateX(-50%) rotate(90deg);
    }

    .notes-empty-bubble::after {
        top: -8px;
    }
}

/* ===== Notes Widget Empty State (with Nook) ===== */
.fancynotes-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
}

.fancynotes-empty-nook {
    width: 60px;
    height: auto;
    flex-shrink: 0;
}

.fancynotes-empty-bubble {
    position: relative;
    background: var(--tn-primary-100, #e7f1ff);
    border: 2px solid var(--tn-primary-300, #9ec5fe);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    max-width: 280px;
    color: var(--tn-primary-700, #0a58ca);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Pulse animation for Notes bubble */
.fancynotes-bubble-pulse {
    animation: fancynotes-bubble-pulse 2s ease-in-out infinite;
}

@keyframes fancynotes-bubble-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }

    50% {
        box-shadow: 0 0 12px 4px rgba(13, 110, 253, 0.3);
    }
}

/* Speech bubble pointer/tail */
.fancynotes-empty-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 12px 8px 0;
    border-style: solid;
    border-color: transparent var(--tn-primary-300, #9ec5fe) transparent transparent;
}

.fancynotes-empty-bubble::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 10px 6px 0;
    border-style: solid;
    border-color: transparent var(--tn-primary-100, #e7f1ff) transparent transparent;
}

/* Responsive adjustments for Notes empty state */
@media (max-width: 576px) {
    .fancynotes-empty-state {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .fancynotes-empty-nook {
        width: 50px;
    }

    .fancynotes-empty-bubble {
        max-width: 100%;
    }

    .fancynotes-empty-bubble::before,
    .fancynotes-empty-bubble::after {
        left: 50%;
        top: -12px;
        transform: translateX(-50%) rotate(90deg);
    }

    .fancynotes-empty-bubble::after {
        top: -8px;
    }
}

/* ===== Font Picker Modal ===== */
#fontPickerModal .modal-dialog {
    max-width: 1400px;
    width: 95%;
}

#fontPickerModal .modal-content {
    background: var(--widget-bg, #fff);
    color: var(--widget-fg, #212529);
}

#fontPickerModal .modal-header {
    background: var(--tn-primary-700, #0d6efd);
    color: #fff;
    border-bottom: none;
}

#fontPickerModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Sidebar styling */
.font-picker-sidebar {
    background: var(--tn-background, #f8f9fa) !important;
}

.font-picker-sidebar .filter-group-header {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease;
}

.font-picker-sidebar .filter-group-header:hover {
    background: rgba(0, 0, 0, 0.05);
}

.font-picker-sidebar .collapse-icon {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.font-picker-sidebar .filter-group-header[aria-expanded="false"] .collapse-icon {
    transform: rotate(-90deg);
}

.font-picker-sidebar .filter-options {
    padding-left: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.font-picker-sidebar .form-check {
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
}

.font-picker-sidebar .form-check-label {
    cursor: pointer;
}

/* Font cards */
.font-card {
    transition: all 0.2s ease;
    border: 2px solid transparent;
    background: var(--widget-bg, #fff);
}

.font-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.font-card.selected {
    border-color: var(--tn-primary-500, #0d6efd) !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.font-card.current-font {
    background: rgba(25, 135, 84, 0.05);
}

.font-card .font-preview {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.font-card .badge {
    font-weight: 400;
    font-size: 0.65rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #fontPickerModal .modal-body {
        flex-direction: column;
    }

    #fontPickerModal .font-picker-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        max-height: 250px;
        border-right: none !important;
        border-bottom: 1px solid var(--bs-border-color);
    }

    #fontPickerModal .font-picker-content {
        min-height: 400px;
    }

    .font-card .font-preview {
        font-size: 1.25rem !important;
    }
}

/* Filter count badges */
.font-picker-sidebar .filter-count {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
}

/* ===== PWA/Standalone Mode Adjustments ===== */
/* PWA Mobile Layout: Only apply compact header on MOBILE PWA (not desktop PWA) */
/* Use pwa-mobile-mode class set by JavaScript when PWA + mobile device detected */
body.pwa-mobile-mode .quotes-container {
    display: none !important;
}

body.pwa-mobile-mode .weather-greeting-card {
    display: none !important;
}

body.pwa-mobile-mode .pwa-header-content {
    display: flex !important;
}

/* In mobile PWA mode, ensure logo stays first using flex order */
body.pwa-mobile-mode .navbar-brand {
    order: 1 !important;
    flex-shrink: 0;
}

body.pwa-mobile-mode .pwa-header-content {
    order: 2 !important;
}

/* Mobile (non-PWA): Show compact header instead of full quotes/weather */
@media (max-width: 768px) {

    /* Hide original quotes container and refresh button */
    .quotes-container {
        display: none !important;
    }

    /* Hide original weather-greeting card */
    .weather-greeting-card {
        display: none !important;
    }

    /* Show compact PWA-style header */
    .pwa-header-content {
        display: flex !important;
    }

    .navbar-brand {
        order: 1 !important;
        flex-shrink: 0;
    }

    .pwa-header-content {
        order: 2 !important;
    }
}

/* PWA Header Content - hidden by default, shown only in PWA mode */
.pwa-header-content {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin: 0 0.75rem;
    min-width: 0;
    overflow: hidden;
}

/* PWA Quote Styling */
.pwa-quote {
    background: linear-gradient(135deg, rgba(255, 249, 240, 0.95) 0%, rgba(255, 239, 213, 0.95) 100%);
    border-radius: 8px;
    border-left: 3px solid var(--tn-accent-500);
    padding: 0.5rem 0.75rem;
    box-shadow: 0 2px 6px rgba(239, 138, 23, 0.15);
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.pwa-quote-text {
    color: var(--tn-primary-900);
    font-size: 0.65rem;
    font-style: italic;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.pwa-quote-author {
    color: var(--tn-accent-700);
    font-size: 0.65rem;
    font-weight: 500;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* PWA Weather Styling */
.pwa-weather {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #E8F4F8 0%, #FFFFFF 100%);
    border-radius: 8px;
    border: 1px solid var(--tn-primary-300);
    padding: 0.4rem 0.6rem;
    box-shadow: 0 2px 4px rgba(30, 138, 122, 0.12);
    flex-shrink: 0;
}

.pwa-weather.active {
    display: flex;
}

.pwa-weather-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #91ebfd;
    border: 1px solid rgba(30, 138, 122, 0.2);
    border-radius: 6px;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pwa-weather-icon {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.pwa-weather-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.pwa-weather-temp {
    color: var(--tn-primary-900);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
}

.pwa-weather-desc {
    color: var(--tn-primary-700);
    font-size: 0.6rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

/* ===== Theme Editor Styles ===== */
#themeEditorModal .modal-dialog {
    max-width: 95vw;
    width: 1400px;
}

#themeEditorModal .modal-content {
    resize: both;
    overflow: hidden;
    min-width: 400px;
    min-height: 300px;
    max-width: 95vw;
    max-height: 95vh;
}

/* Resize handle indicator */
#themeEditorModal .modal-content::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, transparent 50%, var(--tn-border, #ccc) 50%);
    border-radius: 0 0 4px 0;
    pointer-events: none;
    opacity: 0.6;
}

@media (max-width: 1200px) {
    #themeEditorModal .modal-dialog {
        max-width: 95vw;
        width: auto;
    }
}

#themeEditorModal .modal-body {
    max-height: calc(95vh - 120px);
    overflow-y: auto;
}

#themeEditorModal .theme-color-picker .form-control-color {
    width: 48px;
    min-width: 48px;
    padding: 2px;
    border-radius: 4px 0 0 4px;
    cursor: pointer;
}

#themeEditorModal .theme-color-picker .form-control-color::-webkit-color-swatch-wrapper {
    padding: 2px;
}

#themeEditorModal .theme-color-picker .form-control-color::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

#themeEditorModal .theme-color-picker .font-monospace {
    font-size: 0.8rem;
}

#themeEditorModal .card {
    border: 1px solid var(--tn-border, #e7ecef);
}

#themeEditorModal .card-header {
    background: var(--tn-primary-500, #1E8A7A);
    color: white;
    font-size: 0.9rem;
}

#themeEditorModal .card-body {
    background: var(--widget-bg, #ffffff);
}

#themeEditorModal .form-label.small {
    margin-bottom: 0.25rem;
    color: var(--widget-fg, #212529);
}

/* =====================================================
   CALENDAR STYLES
   ===================================================== */

/* Calendar Sidebar Topic */
.calendar-topic .topic-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-icon {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.calendar-header-icon {
    width: 30px;
    height: 30px;
    vertical-align: middle;
    margin-right: 0.25rem;
}

/* Calendar Toolbar */
.calendar-toolbar {
    background: var(--widget-bg, #fff);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--widget-border-color, #e0e0e0);
}

.calendar-toolbar h4 {
    color: var(--widget-fg, #212529);
}

.calendar-view-btn.active {
    background: var(--tn-primary-500);
    border-color: var(--tn-primary-500);
    color: #fff;
}

/* Calendar Quick Add */
.calendar-quick-add {
    background: var(--widget-bg, #fff);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--widget-border-color, #e0e0e0);
}

/* Calendar Shell */
.calendar-shell {
    background: var(--widget-bg, #fff);
    border-radius: 8px;
    border: 1px solid var(--widget-border-color, #e0e0e0);
    overflow: hidden;
}

/* Month View */
.calendar-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--tn-primary-100, #e8e8ff);
    border-bottom: 1px solid var(--widget-border-color, #e0e0e0);
}

.calendar-weekday {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--widget-fg, #212529);
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    min-height: 100px;
    padding: 0.5rem;
    border-right: 1px solid var(--widget-border-color, #e0e0e0);
    border-bottom: 1px solid var(--widget-border-color, #e0e0e0);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.calendar-day:hover {
    background: var(--tn-primary-50, #f5f5ff);
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day.other-month {
    background: var(--widget-bg-muted, #f8f9fa);
}

.calendar-day.other-month .calendar-day-number {
    color: var(--text-muted, #6c757d);
}

.calendar-day.today {
    background: var(--tn-primary-50, #f5f5ff);
}

.calendar-day.today .calendar-day-number {
    background: var(--tn-primary-500);
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-number {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--widget-fg, #212529);
    margin-bottom: 0.25rem;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-event {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event:hover {
    filter: brightness(0.9);
}

/* Imported Events (Google Calendar, iCal) */
.calendar-event-imported {
    cursor: default;
    opacity: 0.85;
    border-left: 3px solid rgba(255, 255, 255, 0.5);
}

.calendar-event-imported:hover {
    filter: none;
}

.calendar-week-event.calendar-event-imported,
.calendar-day-event.calendar-event-imported {
    border-left: 3px solid rgba(255, 255, 255, 0.5);
}

/* Spin animation for sync button */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Subscription item in settings */
.subscription-item {
    background: var(--bs-body-bg);
    transition: background 0.15s ease;
}

.subscription-item:hover {
    background: var(--bs-tertiary-bg);
}

.calendar-more {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    cursor: pointer;
}

.calendar-more:hover {
    color: var(--tn-primary-500);
}

/* Holiday Styles */
.calendar-holiday {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.calendar-holiday.federal {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
}

.calendar-holiday.observance {
    background: linear-gradient(135deg, #6f42c1 0%, #59359a 100%);
    color: #fff;
}

.calendar-day.has-holiday .calendar-day-number {
    color: #dc3545;
    font-weight: 600;
}

/* Week View Holiday */
.calendar-week-holiday {
    font-size: 0.65rem;
    padding: 2px 4px;
    border-radius: 3px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-week-holiday.federal {
    background: #dc3545;
    color: #fff;
}

.calendar-week-holiday.observance {
    background: #6f42c1;
    color: #fff;
}

.calendar-week-day.has-holiday {
    background: rgba(220, 53, 69, 0.1);
}

.calendar-week-day.has-holiday.today {
    background: linear-gradient(135deg, var(--tn-primary-200, #d0d0ff) 0%, rgba(220, 53, 69, 0.15) 100%);
}

/* Day View Holiday */
.calendar-day-header-holiday {
    font-size: 0.875rem;
    padding: 4px 12px;
    border-radius: 4px;
    margin-top: 8px;
    display: inline-block;
}

.calendar-day-header-holiday.federal {
    background: #dc3545;
    color: #fff;
}

.calendar-day-header-holiday.observance {
    background: #6f42c1;
    color: #fff;
}

.calendar-day-header-content.has-holiday {
    background: rgba(220, 53, 69, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
}

/* Week View */
.calendar-week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background: var(--tn-primary-100, #e8e8ff);
    border-bottom: 1px solid var(--widget-border-color, #e0e0e0);
}

.calendar-time-gutter {
    padding: 0.5rem;
    border-right: 1px solid var(--widget-border-color, #e0e0e0);
}

.calendar-week-day {
    padding: 0.5rem;
    text-align: center;
    border-right: 1px solid var(--widget-border-color, #e0e0e0);
}

.calendar-week-day:last-child {
    border-right: none;
}

.calendar-week-day.today {
    background: var(--tn-primary-200, #d0d0ff);
}

.calendar-week-day-name {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    text-transform: uppercase;
}

.calendar-week-day-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--widget-fg, #212529);
}

.calendar-week-body {
    max-height: 600px;
    overflow-y: auto;
}

.calendar-time-row {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    min-height: 50px;
    border-bottom: 1px solid var(--widget-border-color, #e0e0e0);
}

.calendar-time-label {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    text-align: right;
    border-right: 1px solid var(--widget-border-color, #e0e0e0);
}

.calendar-time-cell {
    border-right: 1px solid var(--widget-border-color, #e0e0e0);
    position: relative;
    min-height: 50px;
}

.calendar-time-cell:last-child {
    border-right: none;
}

.calendar-week-event {
    position: absolute;
    left: 2px;
    right: 2px;
    padding: 4px 6px;
    border-radius: 4px;
    color: #fff;
    font-size: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
}

.calendar-week-event:hover {
    filter: brightness(0.9);
}

.calendar-event-time {
    font-weight: 600;
    font-size: 0.7rem;
}

.calendar-event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Day View */
.calendar-day-header {
    padding: 1rem;
    text-align: center;
    background: var(--tn-primary-100, #e8e8ff);
    border-bottom: 1px solid var(--widget-border-color, #e0e0e0);
}

.calendar-day-header-content.today {
    background: var(--tn-primary-200, #d0d0ff);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
}

.calendar-day-header-name {
    font-size: 0.875rem;
    color: var(--text-muted, #6c757d);
    text-transform: uppercase;
}

.calendar-day-header-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--widget-fg, #212529);
}

.calendar-day-body {
    max-height: 600px;
    overflow-y: auto;
}

.calendar-day-time-cell {
    flex: 1;
    position: relative;
    min-height: 50px;
}

.calendar-day-event {
    position: absolute;
    left: 60px;
    right: 10px;
    padding: 6px 10px;
    border-radius: 4px;
    color: #fff;
    font-size: 0.875rem;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
}

.calendar-day-event:hover {
    filter: brightness(0.9);
}

/* Color Picker */
.calendar-color-picker {
    margin-top: 0.25rem;
}

.calendar-color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calendar-color-btn:hover {
    transform: scale(1.1);
}

.calendar-color-btn.active {
    border-color: var(--widget-fg, #212529);
    box-shadow: 0 0 0 2px var(--widget-bg, #fff);
}

/* Calendar Event Modal */
#calendarEventModal .modal-header {
    border-bottom: none;
}

#calendarEventModal .modal-footer {
    border-top: 1px solid var(--widget-border-color, #e0e0e0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .calendar-toolbar {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .calendar-toolbar h4 {
        margin-bottom: 1rem;
    }

    .calendar-day {
        min-height: 60px;
        padding: 0.25rem;
    }

    .calendar-day-number {
        font-size: 0.75rem;
    }

    .calendar-event {
        font-size: 0.65rem;
        padding: 1px 4px;
    }

    .calendar-week-header,
    .calendar-time-row {
        grid-template-columns: 40px repeat(7, 1fr);
    }

    .calendar-time-label {
        font-size: 0.65rem;
        padding: 0.25rem;
    }

    .calendar-week-day-name {
        font-size: 0.65rem;
    }

    .calendar-week-day-number {
        font-size: 1rem;
    }

    .calendar-holiday {
        font-size: 0.6rem;
        padding: 1px 3px;
    }

    .calendar-week-holiday {
        font-size: 0.55rem;
        padding: 1px 2px;
    }

    .calendar-day-header-holiday {
        font-size: 0.75rem;
        padding: 2px 8px;
    }
}

/* =====================================================
   In-Tab Calendar Notifications (Fallback for no extension)
   ===================================================== */
.in-tab-notification {
    pointer-events: auto;
    background: var(--widget-bg, #fff);
    border: 1px solid var(--widget-border-color, #e0e0e0);
    border-left: 4px solid var(--tn-primary-500, #1E8A7A);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    animation: slideInNotification 0.3s ease-out;
    overflow: hidden;
}

.in-tab-notification.dismissing {
    animation: slideOutNotification 0.3s ease-in forwards;
}

@keyframes slideInNotification {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutNotification {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.in-tab-notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    background: linear-gradient(90deg, var(--tn-primary-100, #e6f4f2), transparent);
}

.in-tab-notification-icon {
    font-size: 1.5rem;
    color: var(--tn-primary-500, #1E8A7A);
    margin-right: 10px;
}

.in-tab-notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--widget-fg, #212529);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.in-tab-notification-close {
    background: none;
    border: none;
    color: var(--widget-muted, #6c757d);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.in-tab-notification-close:hover {
    opacity: 1;
    color: var(--widget-fg, #212529);
}

.in-tab-notification-body {
    padding: 8px 16px 12px;
    font-size: 0.875rem;
    color: var(--widget-fg, #212529);
}

.in-tab-notification-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--tn-primary-600, #166b5f);
    font-weight: 500;
    margin-bottom: 4px;
}

.in-tab-notification-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--widget-muted, #6c757d);
    font-size: 0.8rem;
}

.in-tab-notification-actions {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
}

.in-tab-notification-actions button {
    flex: 1;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Pulse animation for notification badge on favicon */
@keyframes faviconPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    #inTabNotificationContainer {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .in-tab-notification {
        margin: 0 0 10px 0;
    }
}

/* ===== Announcement Banners ===== */
.announcement-banner {
    border-radius: 8px;
    border-left-width: 4px;
    animation: slideDown 0.3s ease-out;
}

.announcement-banner.alert-danger {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.15), rgba(220, 53, 69, 0.05));
    border-color: rgba(220, 53, 69, 0.6);
}

.announcement-banner.alert-warning {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.05));
    border-color: rgba(255, 193, 7, 0.6);
}

.announcement-banner.alert-info {
    background: linear-gradient(90deg, rgba(13, 202, 240, 0.15), rgba(13, 202, 240, 0.05));
    border-color: rgba(13, 202, 240, 0.6);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile adjustments for announcement banners */
@media (max-width: 576px) {
    .announcement-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .announcement-banner .flex-grow-1 {
        width: 100%;
    }

    .announcement-banner .btn-close {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* =====================================================
   ACHIEVEMENT SYSTEM STYLES
   ===================================================== */

/* ===== Achievement Toast Notifications ===== */
.achievement-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.achievement-toast {
    position: relative;
    width: 320px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
}

.achievement-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.achievement-toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

.achievement-toast-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    animation: toastGlowPulse 2s ease-in-out infinite;
}

@keyframes toastGlowPulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

.achievement-toast-content {
    display: flex;
    padding: 12px;
    gap: 12px;
}

.achievement-toast-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconBounce 0.5s ease-out 0.3s;
}

.achievement-toast-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.achievement-toast-body {
    flex: 1;
    min-width: 0;
}

.achievement-toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.achievement-toast-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffd700;
    font-weight: 600;
}

.achievement-toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.achievement-toast-close:hover {
    color: white;
}

.achievement-toast-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.achievement-toast-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    line-height: 1.3;
}

.achievement-toast-points {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a2e;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ===== Achievement Album Quick Access Link ===== */
.achievement-album-link {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.achievement-album-link:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.achievement-album-icon {
    height: 42px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.invite-friends-icon {
    height: 48px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 1100px) {
    .achievement-album-icon {
        height: 38px;
    }

    .invite-friends-icon {
        height: 44px;
    }
}

@media (max-width: 950px) {
    .achievement-album-icon {
        height: 35px;
    }

    .invite-friends-icon {
        height: 40px;
    }
}

@media (max-width: 800px) {
    .achievement-album-icon {
        height: 30px;
    }

    .invite-friends-icon {
        height: 35px;
    }
}

@media (max-width: 576px) {
    .achievement-album-icon {
        height: 25px;
    }

    .invite-friends-icon {
        height: 29px;
    }

    .achievement-album-link,
    .referral-link {
        margin-right: 0.5rem !important;
    }
}

@media (max-width: 374px) {
    .achievement-album-icon {
        height: 20px;
    }

    .invite-friends-icon {
        height: 23px;
    }
}

/* ===== Achievement Album Modal ===== */
#achievementAlbumModal .modal-content {
    background: linear-gradient(135deg, var(--tn-background), var(--tn-secondary-500));
    border: 1px solid var(--tn-primary-300);
}

#achievementAlbumModal .modal-header {
    background: linear-gradient(90deg, var(--tn-primary-500, #6366f1), var(--tn-primary-600, #4f46e5));
    border-bottom: 1px solid var(--tn-primary-400, #818cf8);
    color: white;
}

#achievementAlbumModal .modal-header .modal-title {
    color: white;
}

#achievementAlbumModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.achievement-album-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: var(--tn-secondary-300);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.achievement-stat-item {
    text-align: center;
}

.achievement-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tn-primary-500);
}

.achievement-stat-label {
    font-size: 0.75rem;
    color: var(--tn-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievement-album-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.achievement-album-category {
    border: 1px solid var(--tn-primary-200);
    border-radius: 10px;
    overflow: hidden;
}

.achievement-album-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--tn-primary-500);
    color: white;
    font-weight: 600;
    text-transform: capitalize;
}

.achievement-album-category-header .progress-text {
    font-size: 0.85rem;
    opacity: 0.9;
}

.achievement-album-badges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.achievement-album-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--tn-secondary-200);
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.achievement-album-badge.earned {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15), rgba(40, 167, 69, 0.05));
    border-color: #28a745;
}

.achievement-album-badge.locked {
    opacity: 0.6;
}

.achievement-album-badge.locked img {
    filter: grayscale(100%);
    opacity: 0.5;
}

.achievement-album-badge img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.achievement-album-badge .badge-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tn-text);
    margin-bottom: 0.25rem;
}

.achievement-album-badge .badge-progress {
    font-size: 0.65rem;
    color: var(--tn-text-muted);
}

.achievement-album-badge .badge-earned-date {
    font-size: 0.6rem;
    color: #28a745;
    margin-top: 0.25rem;
}

/* Category colors for album headers */
.achievement-album-category[data-category="tasks_completed"] .achievement-album-category-header {
    background: #28a745;
}

.achievement-album-category[data-category="tasks_created"] .achievement-album-category-header {
    background: #17a2b8;
}

.achievement-album-category[data-category="links_saved"] .achievement-album-category-header {
    background: #6f42c1;
}

.achievement-album-category[data-category="notes_created"] .achievement-album-category-header {
    background: #fd7e14;
}

.achievement-album-category[data-category="widgets_created"] .achievement-album-category-header {
    background: #e83e8c;
}

.achievement-album-category[data-category="pages_created"] .achievement-album-category-header {
    background: #20c997;
}

.achievement-album-category[data-category="topics_created"] .achievement-album-category-header {
    background: #6610f2;
}

.achievement-album-category[data-category="streak"] .achievement-album-category-header {
    background: linear-gradient(90deg, #ff8c00, #ffc107);
}

.achievement-album-category[data-category="special"] .achievement-album-category-header {
    background: linear-gradient(90deg, #dc3545, #fd7e14);
}

/* ===== Profile Badge Display ===== */
.profile-achievement-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--tn-secondary-300);
    border-radius: 20px;
    font-size: 0.85rem;
}

.profile-achievement-badge img {
    width: 24px;
    height: 24px;
}

.profile-achievement-badge .rank-name {
    font-weight: 600;
    color: var(--tn-text);
}

.profile-badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.profile-badge-item {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--tn-secondary-200);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tn-primary-200);
}

.profile-badge-item img {
    width: 24px;
    height: 24px;
}

/* Mobile adjustments for achievements */
@media (max-width: 576px) {
    .achievement-toast-container {
        top: auto;
        bottom: 20px;
        left: 10px;
        right: 10px;
    }

    .achievement-toast {
        width: 100%;
    }

    .achievement-rank-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .achievement-album-badges {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .achievement-album-badge img {
        width: 40px;
        height: 40px;
    }
}

/* ===== Referral System Styles ===== */
.referral-link {
    color: var(--tn-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.referral-link:hover {
    color: var(--tn-accent-500);
    transform: scale(1.1);
}

.referral-link i {
    font-size: 1.5rem;
}

.referral-modal-image {
    height: 120px;
    width: auto;
    border-radius: 12px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.referral-stats {
    background: var(--tn-surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--tn-border);
}

.referral-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--tn-accent-500);
    line-height: 1.2;
}

.referral-stat-label {
    font-size: 0.85rem;
    color: var(--tn-text-muted);
    margin-top: 0.25rem;
}

#referralModal .modal-body {
    padding: 1.5rem;
}

#referralModal .form-label {
    color: var(--tn-text);
    margin-bottom: 0.5rem;
}

#referralModal .input-group .form-control {
    background: var(--tn-input-bg);
    border-color: var(--tn-border);
    color: var(--tn-text);
}

#referralModal .input-group .form-control:focus {
    border-color: var(--tn-accent-500);
    box-shadow: 0 0 0 0.2rem rgba(var(--tn-accent-rgb), 0.25);
}

#referralModal .btn-outline-primary {
    border-color: var(--tn-accent-500);
    color: var(--tn-accent-500);
}

#referralModal .btn-outline-primary:hover {
    background: var(--tn-accent-500);
    color: white;
}

#referralModal .btn-primary {
    background: var(--tn-accent-500);
    border-color: var(--tn-accent-500);
}

#referralModal .btn-primary:hover {
    background: var(--tn-accent-600);
    border-color: var(--tn-accent-600);
}

/* Social share buttons */
#referralModal .btn-outline-dark {
    border-color: #333;
    color: #333;
}

#referralModal .btn-outline-dark:hover {
    background: #333;
    color: white;
}

#referralModal .btn-outline-success {
    border-color: #25D366;
    color: #25D366;
}

#referralModal .btn-outline-success:hover {
    background: #25D366;
    color: white;
}

/* Mobile adjustments for referral modal */
@media (max-width: 576px) {
    .referral-stat-value {
        font-size: 1.5rem;
    }

    #referralModal .d-flex.gap-2 {
        flex-direction: column;
    }

    #referralModal .d-flex.gap-2 .btn {
        width: 100%;
    }
}

/* =============================================================================
   AI Page Wizard Styles
   ============================================================================= */

/* Wizard Step Indicator */
.wizard-steps-indicator {
    padding: 0 1rem;
}

.wizard-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 0 0 auto;
}

.wizard-step-item .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tn-border);
    color: var(--tn-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.wizard-step-item .step-label {
    font-size: 0.75rem;
    color: var(--tn-text-muted);
    margin-top: 0.5rem;
    white-space: nowrap;
}

.wizard-step-item.active .step-number {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.wizard-step-item.active .step-label {
    color: #6366f1;
    font-weight: 600;
}

.wizard-step-item.completed .step-number {
    background: #10b981;
    color: white;
}

.wizard-step-item.completed .step-number::after {
    content: '\2713';
    font-size: 1rem;
}

.wizard-step-item.completed .step-number span {
    display: none;
}

.wizard-step-connector {
    flex: 1;
    height: 2px;
    background: var(--tn-border);
    margin: 0 0.5rem;
    margin-top: 16px;
    transition: background 0.3s ease;
}

.wizard-step-item.completed+.wizard-step-connector {
    background: #10b981;
}

/* AI Question Bubble */
.ai-question-bubble {
    background: var(--tn-primary-100);
    border-left: 4px solid var(--tn-primary-500);
    font-size: 0.95rem;
    line-height: 1.6;
}

.ai-question-bubble strong {
    color: var(--tn-primary-700);
}

/* Conversation Messages */
.conversation-container {
    border: 1px solid var(--tn-border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--tn-surface);
}

.conversation-message {
    animation: fadeIn 0.3s ease;
}

.conversation-message.user-message {
    background: var(--tn-success-100) !important;
    margin-left: 20% !important;
    border-left: 3px solid var(--tn-success-500);
}

.conversation-message.ai-message {
    background: var(--tn-primary-50) !important;
    margin-right: 20% !important;
    border-left: 3px solid var(--tn-primary-500);
}

/* Wizard Modal Header */
#aiPageWizardModal .modal-header {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

#aiPageWizardModal .modal-title {
    font-weight: 600;
}

/* Preview Tabs */
#aiPageWizardPreviewTabs .nav-link {
    color: var(--tn-text-muted);
    border: none;
    padding: 0.75rem 1rem;
}

#aiPageWizardPreviewTabs .nav-link.active {
    color: #6366f1;
    border-bottom: 2px solid #6366f1;
    background: transparent;
}

#aiPageWizardPreviewTabs .nav-link:hover:not(.active) {
    color: var(--tn-text);
    border-bottom: 2px solid var(--tn-border);
}

#aiPageWizardPreviewTabs .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

/* Preview Content */
#aiPageWizardPreviewContent {
    background: var(--tn-surface);
}

#aiPageWizardPreviewContent .list-group-item {
    background: var(--tn-background);
    border-color: var(--tn-border);
}

#aiPageWizardPreviewContent .list-group-item:hover {
    background: var(--tn-surface);
}

/* Topic Selection */
#aiPageWizardCreate .form-select,
#aiPageWizardCreate .form-control {
    background: var(--tn-input-bg);
    border-color: var(--tn-border);
    color: var(--tn-text);
}

#aiPageWizardCreate .form-select:focus,
#aiPageWizardCreate .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

/* Wizard Buttons */
#aiPageWizardModal .btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
}

#aiPageWizardModal .btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

#aiPageWizardModal .btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
}

#aiPageWizardModal .btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* AI Wizard Button in Toolbar */
#btnAddPageWithWizard {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
    transition: all 0.2s ease;
}

#btnAddPageWithWizard:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#btnAddPageWithWizard i {
    color: white !important;
}

/* AI Links Widget Button in Toolbar */
#btnAddLinksWidgetAI {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
    transition: all 0.2s ease;
}

#btnAddLinksWidgetAI:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#btnAddLinksWidgetAI i {
    color: white !important;
}

/* AI Tasks Widget Button in Toolbar */
#btnAddTodosWidgetAI {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
    transition: all 0.2s ease;
}

#btnAddTodosWidgetAI:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#btnAddTodosWidgetAI i {
    color: white !important;
}

/* Loading State */
#aiPageWizardGenerating .spinner-border {
    color: #6366f1;
}

#aiPageWizardGenerating .progress-bar {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

/* Error State */
#aiPageWizardError {
    border-left: 4px solid #ef4444;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .wizard-step-item .step-label {
        font-size: 0.65rem;
    }

    .wizard-step-item .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .wizard-step-connector {
        margin: 0 0.25rem;
        margin-top: 14px;
    }

    .conversation-message.user-message {
        margin-left: 10% !important;
    }

    .conversation-message.ai-message {
        margin-right: 10% !important;
    }

    #aiPageWizardPreviewTabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark Mode Support */
[data-theme="dark"] #aiPageWizardModal .modal-body {
    background: var(--tn-background);
}

[data-theme="dark"] .ai-question-bubble {
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .conversation-container {
    background: var(--tn-background);
}

[data-theme="dark"] .conversation-message.user-message {
    background: rgba(16, 185, 129, 0.15) !important;
}

[data-theme="dark"] .conversation-message.ai-message {
    background: rgba(99, 102, 241, 0.1) !important;
}

[data-theme="dark"] #aiPageWizardPreviewContent {
    background: var(--tn-background);
}

[data-theme="dark"] #aiPageWizardPreviewContent .list-group-item {
    background: var(--tn-surface);
}

/* =============================================================================
   How To Modal Styles
   ============================================================================= */

/* How To Button - larger icon for better visibility */
#howToBtn {
    padding: 0.25rem 0.4rem;
}

#howToBtn img {
    width: 48px !important;
    height: 48px !important;
}

@media (max-width: 1500px) {
    #howToBtn img {
        width: 42px !important;
        height: 42px !important;
    }
}

@media (max-width: 1300px) {
    #howToBtn img {
        width: 38px !important;
        height: 38px !important;
    }
}

@media (max-width: 1100px) {
    #howToBtn img {
        width: 34px !important;
        height: 34px !important;
    }
}

@media (max-width: 950px) {
    #howToBtn img {
        width: 30px !important;
        height: 30px !important;
    }
}

@media (max-width: 800px) {
    #howToBtn img {
        width: 26px !important;
        height: 26px !important;
    }
}

/* How To Modal Carousel */
#howToModal .modal-body {
    padding: 1rem 1.5rem 1.5rem;
}

#howToCarousel {
    position: relative;
}

.howto-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 2rem 2rem;
}

.howto-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 300px;
    margin-bottom: 1rem;
}

.howto-image-container.howto-dual-image {
    gap: 1rem;
    flex-wrap: wrap;
}

.howto-image {
    max-width: 100%;
    max-height: 350px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--tn-border);
}

.howto-dual-image .howto-image {
    max-width: calc(50% - 0.5rem);
    max-height: 380px;
}

.howto-caption {
    text-align: center;
    padding: 0.5rem 1rem;
    max-width: 600px;
}

.howto-caption h5 {
    color: var(--tn-primary-900);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}

.howto-caption p {
    color: var(--tn-text-muted);
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Carousel Controls */
#howToCarousel .carousel-control-prev,
#howToCarousel .carousel-control-next {
    width: 40px;
    height: 40px;
    top: 50%;
    transform: translateY(-80%);
    background: var(--tn-primary-500);
    border-radius: 50%;
    opacity: 0.9;
}

#howToCarousel .carousel-control-prev {
    left: 0;
}

#howToCarousel .carousel-control-next {
    right: 0;
}

#howToCarousel .carousel-control-prev:hover,
#howToCarousel .carousel-control-next:hover {
    opacity: 1;
    background: var(--tn-primary-600);
}

#howToCarousel .carousel-control-prev-icon,
#howToCarousel .carousel-control-next-icon {
    width: 16px;
    height: 16px;
}

/* Carousel Indicators */
#howToCarousel .carousel-indicators {
    position: relative;
    bottom: 0;
    margin-top: 1rem;
    margin-bottom: 0;
}

#howToCarousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--tn-border);
    border: none;
    margin: 0 4px;
    opacity: 0.5;
}

#howToCarousel .carousel-indicators button.active {
    background-color: var(--tn-primary-500);
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .howto-slide {
        padding: 0.5rem 1rem 1.5rem;
    }

    .howto-image-container {
        min-height: 200px;
    }

    .howto-image {
        max-height: 250px;
    }

    .howto-dual-image .howto-image {
        max-width: 100%;
        max-height: 240px;
    }

    .howto-caption h5 {
        font-size: 1rem;
    }

    .howto-caption p {
        font-size: 0.85rem;
    }

    #howToCarousel .carousel-control-prev,
    #howToCarousel .carousel-control-next {
        width: 32px;
        height: 32px;
    }

    #howToCarousel .carousel-control-prev-icon,
    #howToCarousel .carousel-control-next-icon {
        width: 12px;
        height: 12px;
    }
}

/* Dark mode support */
[data-theme="dark"] .howto-image {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .howto-caption h5 {
    color: var(--tn-primary-300);
}

[data-theme="dark"] #howToCarousel .carousel-indicators button {
    background-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] #howToCarousel .carousel-indicators button.active {
    background-color: var(--tn-primary-400);
}

/* AI Wizard Image Wrapper with Labels */
.howto-image-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: calc(50% - 0.5rem);
}

.howto-image-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tn-primary-700);
    margin-bottom: 0.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.howto-image-label i {
    font-size: 0.9rem;
}

.howto-image-label.result-label {
    color: var(--tn-success, #198754);
}

[data-theme="dark"] .howto-image-label {
    color: var(--tn-primary-300);
}

[data-theme="dark"] .howto-image-label.result-label {
    color: #75b798;
}

@media (max-width: 768px) {
    .howto-image-wrapper {
        max-width: 100%;
    }

    .howto-image-label {
        font-size: 0.7rem;
        margin-bottom: 0.35rem;
    }
}

/* Clickable AI Wizard Images */
.howto-image-clickable {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.howto-image-clickable .howto-image {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.howto-image-clickable:hover .howto-image {
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
}

.howto-zoom-indicator {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 0.5rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.howto-image-clickable:hover .howto-zoom-indicator {
    opacity: 1;
}

.howto-zoom-indicator i {
    font-size: 0.8rem;
}

/* How To Image Lightbox Modal */
#howToImageModal .modal-dialog {
    max-width: 95vw;
    margin: 1rem auto;
}

#howToImageModal .modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

#howToImageModal .modal-body {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

#howToImageModal .lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

#howToImageModal .btn-close {
    position: absolute;
    top: -40px;
    right: 0;
    filter: invert(1);
    opacity: 0.8;
    z-index: 10;
}

#howToImageModal .btn-close:hover {
    opacity: 1;
}

[data-theme="dark"] .howto-image-clickable:hover .howto-image {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .howto-zoom-indicator {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .howto-zoom-indicator {
        padding: 3px 6px;
        font-size: 0.65rem;
        bottom: 6px;
        right: 6px;
    }

    .howto-zoom-indicator i {
        font-size: 0.75rem;
    }
}

/* ===== Nook Support Chat ===== */

/* Floating Button */
.nook-support-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--tn-primary-500);
    background: var(--widget-bg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 1040;
    padding: 0;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.nook-support-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    border-color: var(--tn-accent-500);
}

.nook-support-floating:active {
    transform: scale(1.05);
}

.nook-support-floating img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Chat Modal Messages Container */
.nook-support-messages {
    max-height: 350px;
    min-height: 200px;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Message Bubbles */
.nook-support-message {
    display: flex;
    gap: 0.75rem;
    max-width: 90%;
    animation: nookMessageFadeIn 0.3s ease;
}

@keyframes nookMessageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nook-support-message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.nook-support-message.ai-message {
    align-self: flex-start;
}

.nook-support-message .message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.nook-support-message.ai-message .message-avatar {
    background: var(--tn-primary-100, #e0f2f1);
    color: var(--tn-primary-700);
}

.nook-support-message.ai-message .message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.nook-support-message.user-message .message-avatar {
    background: var(--tn-success, #28a745);
    color: white;
}

.nook-support-message .message-content {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.nook-support-message.ai-message .message-content {
    background: var(--tn-primary-50, #e8f5e9);
    color: var(--widget-fg);
    border-bottom-left-radius: 0.25rem;
}

.nook-support-message.user-message .message-content {
    background: var(--tn-accent-500);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

/* Message content wrapper for feedback */
.nook-support-message .message-content-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

/* Feedback link */
.nook-support-message .message-feedback {
    margin-top: 0.25rem;
    padding-left: 0.25rem;
}

.nook-support-message .feedback-link {
    font-size: 0.7rem;
    color: var(--tn-text-muted, #999);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.nook-support-message .feedback-link:hover {
    opacity: 1;
    color: var(--tn-warning, #dc3545);
}

.nook-support-message .feedback-link.reported {
    color: var(--tn-success, #28a745);
    opacity: 1;
    pointer-events: none;
    cursor: default;
}

.nook-support-message .feedback-link i {
    font-size: 0.65rem;
}

/* Draggable Modal Header */
.nook-support-draggable {
    cursor: move;
    cursor: grab;
    user-select: none;
}

.nook-support-draggable:active {
    cursor: grabbing;
}

.nook-support-dragging {
    transition: none !important;
    opacity: 0.95;
}

#nookSupportModal .modal-dialog {
    transition: none;
}

/* Typing Indicator */
.nook-support-typing {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--widget-bg);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0.75rem;
    background: var(--tn-primary-50, #e8f5e9);
    border-radius: 1rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--tn-primary-400, #66bb6a);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-6px);
    }
}

/* Mobile Responsiveness for Nook Support */
@media (max-width: 576px) {
    .nook-support-floating {
        width: 56px;
        height: 56px;
        bottom: 16px;
        right: 16px;
    }

    #nookSupportModal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .nook-support-messages {
        max-height: 280px;
        min-height: 150px;
    }

    .nook-support-message .message-content {
        font-size: 0.9rem;
        padding: 0.6rem 0.85rem;
    }

    .nook-support-message .message-avatar {
        width: 32px;
        height: 32px;
    }
}

/* Ensure floating button doesn't overlap with other fixed elements */
@media (max-width: 768px) {
    .nook-support-floating {
        bottom: 70px;
        /* Above mobile navigation if present */
    }
}