/* ===== CSS Variables ===== */
:root {
    --primary-color: #ff6b6b;
    --primary-dark: #ee5a5a;
    --secondary-color: #2d3436;
    --accent-color: #ff8c42;
    --cream: #faf8f6;
    --cream-dark: #f5f0ec;
    --text-dark: #2d3436;
    --text-medium: #5a6268;
    --text-light: #8c939a;
    --white: #FFFFFF;
    --gray-light: #f8f6f4;
    --gray: #e8e4e0;
    --success: #26de81;
    --danger: #ff6b6b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.06), 0 3px 6px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Prevent horizontal scrolling and ensure safe area is respected */
    overflow-x: hidden;
    /* Allow vertical scrolling */
    overflow-y: auto;
    /* Prevent scrolling behind status bar on mobile */
    position: relative;
    /* Use min-height instead of height to allow content to expand */
    min-height: 100%;
    width: 100%;
    /* Enable smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Heebo', sans-serif;
    background: var(--cream);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    /* Add padding-top to account for navbar - desktop uses 70px, mobile adds safe area */
    padding-top: 70px;
    /* Prevent content from scrolling behind fixed elements */
    position: relative;
    overflow-x: hidden;
    /* Allow vertical scrolling - critical for PWA on mobile */
    overflow-y: auto;
    /* Enable touch scrolling on mobile devices */
    touch-action: pan-y pinch-zoom;
    /* Enable smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    /* Advanced Hebrew text rendering - prevent word breaking */
    direction: rtl;
    text-align: right;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    white-space: normal;
    line-break: auto;
    word-spacing: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Advanced Hebrew text rendering - prevent word breaking in all text elements */
html[dir="rtl"],
html[dir="rtl"] * {
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    white-space: normal;
    line-break: auto;
    word-wrap: normal;
    word-spacing: normal;
}

/* Only allow breaking for URLs and extremely long strings */
html[dir="rtl"] input[type="url"],
html[dir="rtl"] .share-url-input,
html[dir="rtl"] .expanded-link-input,
html[dir="rtl"] .original-link {
    word-break: break-all;
    overflow-wrap: anywhere;
    direction: ltr;
    text-align: left;
}

/* Ensure buttons and inputs with nowrap don't affect text */
html[dir="rtl"] .btn-add-recipe,
html[dir="rtl"] button[class*="btn"],
html[dir="rtl"] .copy-btn,
html[dir="rtl"] .copy-link-btn {
    white-space: nowrap;
}

/* ===== Top Safe Area Banner ===== */
.top-safe-area-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    /* Hide banner on desktop browsers, show only on mobile with safe area */
    height: 0;
    /* Use solid background color first, then gradient on top for complete opacity */
    background-color: #ff6b6b;
    background-image: linear-gradient(135deg, #ff6b6b 0%, #ff8c68 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    /* Ensure banner is above all content to prevent scrolling behind */
    z-index: 102;
    /* Ensure banner is completely opaque */
    opacity: 1;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    /* Prevent any transparency or rendering issues */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Force hardware acceleration */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    /* Ensure banner blocks all interactions */
    pointer-events: none;
    /* Prevent content from showing through */
    isolation: isolate;
}

/* Show safe area banner only on mobile devices */
@media (max-width: 768px) {
    .top-safe-area-banner {
        height: env(safe-area-inset-top, 0px);
        min-height: 0;
    }
}

/* ===== Navbar ===== */
.navbar {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8c68 100%);
    position: fixed;
    /* Position navbar below the safe area banner - use 0 for desktop browsers */
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    /* Ensure no gaps or borders */
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    /* Prevent any rendering artifacts */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Ensure navbar is completely opaque */
    background-color: #ff6b6b;
}

/* On mobile devices, position navbar below safe area */
@media (max-width: 768px) {
    .navbar {
        top: env(safe-area-inset-top, 0px);
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
}

.nav-logo:hover {
    opacity: 0.9;
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    letter-spacing: 0.3px;
}

.nav-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.nav-search input {
    width: 100%;
    padding: 11px 18px;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-dark);
}

.nav-search input::placeholder {
    color: var(--text-light);
}

.nav-search input:focus {
    outline: none;
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 8px;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.search-dropdown.active {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-light);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--gray-light);
}

.search-result-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.search-result-placeholder {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.search-result-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.search-result-info span {
    font-size: 12px;
    color: var(--text-light);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user .btn-primary {
    background: var(--white);
    color: var(--primary-color);
    font-weight: 600;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-user .btn-primary:hover {
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-menu {
    position: relative;
    order: 1;
}

/* Modern Menu Button */
.menu-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.menu-btn:active {
    transform: translateY(0) scale(0.97);
}

/* Hamburger Icon */
.menu-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 22px;
    height: 22px;
}

.menu-hamburger span {
    display: block;
    width: 20px;
    height: 3px;
    background-color: #ffffff;
    border-radius: 3px;
    transition: all 0.25s ease;
}

.menu-hamburger span:nth-child(2) {
    width: 16px;
}

.menu-btn:hover .menu-hamburger span:nth-child(2) {
    width: 20px;
}

/* Dropdown User Info */
.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px 12px;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-light);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px;
    padding-top: 20px;
    margin-top: 0;
    min-width: 150px;
    display: none;
}

/* Invisible bridge to prevent dropdown from disappearing when moving mouse */
.user-dropdown::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 18px;
    background: transparent;
}

.user-menu.open .user-dropdown {
    display: block;
}

.user-name {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray);
}

.dropdown-link {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    padding: 0.5rem 0;
    text-decoration: none;
    transition: color 0.2s;
}

.dropdown-link:hover {
    color: var(--primary-color);
}

#admin-view-toggle {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    margin: 0.25rem 0;
    transition: all 0.2s ease;
}

#admin-view-toggle:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    transform: translateX(-2px);
}

#admin-menu-section {
    transition: opacity 0.3s ease;
}

.logout-link {
    color: var(--danger);
    font-size: 14px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Social Media Buttons - Subtle, non-intrusive design */
.btn-tiktok {
    background: var(--gray-light);
    color: var(--text-medium);
    font-weight: 500;
    border: 1px solid var(--gray);
    transition: all 0.2s ease;
}

.btn-tiktok:hover {
    background: #f8f8f8;
    border-color: #69c9d0;
    color: #25f4ee;
    box-shadow: 0 2px 8px rgba(37, 244, 238, 0.15);
}

.btn-instagram {
    background: var(--gray-light);
    color: var(--text-medium);
    font-weight: 500;
    border: 1px solid var(--gray);
    transition: all 0.2s ease;
}

.btn-instagram:hover {
    background: #f8f8f8;
    border-color: #c13584;
    color: #c13584;
    box-shadow: 0 2px 8px rgba(193, 53, 132, 0.15);
}

.btn-facebook {
    background: var(--gray-light);
    color: var(--text-medium);
    font-weight: 500;
    border: 1px solid var(--gray);
    transition: all 0.2s ease;
}

.btn-facebook:hover {
    background: #f8f8f8;
    border-color: #1877f2;
    color: #1877f2;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.15);
}

.btn-icon {
    margin-left: 0.5rem;
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--text-dark);
}

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

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

.btn-success:hover {
    background: #219A52;
}

/* Delete button - subtle by default, danger on hover to prevent accidents */
.btn-danger {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--gray);
    font-weight: 400;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #fff5f5;
    color: #c0392b;
    border-color: #e74c3c;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.15);
}

.btn-danger:active {
    background: #ffe8e8;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-magic {
    background: linear-gradient(135deg, #9B59B6 0%, #8E44AD 50%, #E74C3C 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
    padding: 12px 24px;
}

.btn-magic::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-magic:hover::before {
    left: 100%;
}

.btn-magic:hover {
    background: linear-gradient(135deg, #A569BD 0%, #9B59B6 50%, #EC7063 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.4);
}

.btn-magic:disabled {
    opacity: 0.8;
    cursor: wait;
}

.btn-magic .btn-icon {
    font-size: 18px;
    display: inline-block;
}

.btn-magic .btn-icon.spinning {
    animation: sparkle 0.8s ease-in-out infinite;
}

.btn-magic .btn-text {
    margin-right: 6px;
}

@keyframes sparkle {
    0%, 100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 1;
    }
    50% { 
        transform: scale(1.2) rotate(15deg); 
        opacity: 0.8;
    }
}

/* ===== Progress Bar (New Design with Lottie) ===== */
.progress-container {
    margin-top: 10px;
    display: none;
    text-align: center;
}

.progress-container.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Lottie Animation Container */
.lottie-animation-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
}

/* Progress Status Text */
.progress-status-text {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8f70 50%, #ffa07a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: textPulse 2s ease-in-out infinite;
    text-align: center;
    padding: 0 20px;
}

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

/* Progress Bar Container */
.progress-bar-container {
    max-width: 400px;
    margin: 0 auto 12px;
    padding: 0 20px;
}

.progress-percentage-top {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8f70 50%, #ffa07a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    animation: percentagePulse 1.5s ease-in-out infinite;
    font-family: 'Heebo', sans-serif;
}

@keyframes percentagePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.9;
    }
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ff8f70 50%, #ffa07a 100%);
    border-radius: 50px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.5);
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: progressShine 1.8s ease-in-out infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Fun Fact Bubble */
.fun-fact-bubble {
    max-width: 460px;
    margin: 2px auto 0;
    background: linear-gradient(135deg, #fff8f0 0%, #fff0f8 100%);
    border: 2px solid #ffd6e8;
    border-radius: 20px;
    padding: 14px 24px;
    position: relative;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.12);
    animation: bubbleFloat 4s ease-in-out infinite;
}

.fun-fact-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #ffd6e8;
}

.fun-fact-bubble::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff8f0;
}

.bubble-content {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
    text-align: center;
    font-weight: 500;
    transition: opacity 0.3s ease;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-6px) scale(1.01);
    }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .progress-container {
        margin-top: 5px;
    }
    
    .lottie-animation-container {
        margin-bottom: 4px;
    }
    
    .lottie-animation-container lottie-player {
        width: 150px !important;
        height: 150px !important;
    }
    
    .progress-status-text {
        font-size: 14px;
        margin-bottom: 10px;
        min-height: 20px;
    }
    
    .progress-bar-container {
        max-width: 90%;
        margin-bottom: 12px;
    }
    
    .progress-percentage-top {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .progress-bar-track {
        height: 6px;
    }
    
    .fun-fact-bubble {
        padding: 12px 16px;
        max-width: 92%;
        border-radius: 18px;
    }
    
    .bubble-content {
        font-size: 13px;
        min-height: 36px;
        line-height: 1.4;
    }
}

/* ===== Main Content ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    min-height: calc(100vh - 180px);
}

/* ===== Flash Messages ===== */
.flash-messages {
    margin-bottom: 24px;
}

.flash-message {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

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

.flash-success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.flash-error {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

.flash-info {
    background: #D1ECF1;
    color: #0C5460;
    border: 1px solid #BEE5EB;
}

.flash-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
}

.flash-close:hover {
    opacity: 1;
}

/* ===== Home Page ===== */
.home-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.welcome-section {
    text-align: center;
    padding: 20px 0 0;
}

.welcome-greeting {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.welcome-section h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-header .section-title {
    margin-bottom: 0;
}

.manage-link {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 107, 107, 0.1);
    transition: all 0.2s ease;
}

.manage-link:hover {
    background: rgba(255, 107, 107, 0.2);
    transform: translateY(-1px);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ===== Categories Grid ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px 12px 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
    min-height: 140px;
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 32px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--cream-dark);
    border-radius: 50%;
}

.category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    white-space: normal;
    line-break: auto;
}

.category-count {
    font-size: 12px;
    color: var(--text-light);
}

/* Custom Category Indicator */
.category-card.custom-category {
    position: relative;
    border: 1px solid rgba(255, 107, 107, 0.3);
    background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
}

.category-card .custom-indicator {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 14px;
    opacity: 0.8;
}

/* Collaborator Avatars on Category Cards */
.category-collaborators-avatars {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

.collaborator-avatar-circle {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.collaborator-avatar-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.pending-avatar-circle {
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffc107;
    opacity: 0.9;
}

.pending-avatar-circle .pending-icon {
    font-size: 16px;
}

/* ===== Recent Recipes Section ===== */
.recent-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--gray);
}

/* ===== All Recipes - Compact Grid ===== */
#all-recipes-view .recipes-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    overflow: visible;
    align-items: start; /* Each card sizes to content - prevents info (title/categories) from being squeezed/clipped */
}

#all-recipes-view .recipe-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    display: block;
    flex-shrink: 0; /* Prevent image from shrinking - keeps proper size */
    position: relative;
    top: 0;
    left: 0;
}

#all-recipes-view .recipe-card {
    overflow: hidden;
    height: auto; /* Size to content when align-items: start */
    display: flex;
    flex-direction: column;
}

#all-recipes-view .recipe-card-wrapper {
    overflow: visible;
    display: flex;
    flex-direction: column;
    height: auto;
    isolation: auto;
    z-index: 1;
}

#all-recipes-view .recipe-image img {
    object-fit: contain !important; /* Contain to show full image scaled down within bounds */
}

#all-recipes-view .recipe-placeholder {
    font-size: 28px;
}

#all-recipes-view .recipe-info {
    padding: 10px 12px 12px;
    flex: 0 0 auto; /* Don't shrink - always show title and categories */
    display: flex;
    flex-direction: column;
    min-height: auto;
    background: var(--white);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: visible; /* Don't clip title/categories */
    visibility: visible;
    opacity: 1;
}

#all-recipes-view .recipe-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.2;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    white-space: normal;
    line-break: auto;
    display: block; /* Ensure title is displayed */
    visibility: visible; /* Ensure title is visible */
    opacity: 1; /* Ensure title is not transparent */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Show ellipsis for long titles */
    display: -webkit-box; /* Enable multi-line ellipsis */
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical; /* Vertical orientation */
    max-height: 2.4em; /* Limit height to 2 lines */
}

#all-recipes-view .recipe-category-tag {
    font-size: 10px;
    padding: 3px 8px;
}

#all-recipes-view .recipe-quick-actions {
    top: 6px;
    left: 6px;
}

#all-recipes-view .recipe-more-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
}

#all-recipes-view .quick-action-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

#all-recipes-view .recipe-card .recipe-rating {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    padding: 3px 6px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    pointer-events: none !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#all-recipes-view .recipe-card .recipe-rating .stars {
    display: flex;
    gap: 1px;
}

#all-recipes-view .recipe-card .recipe-rating .star {
    font-size: 11px;
    color: #FFB800;
    text-shadow: 0 1px 2px rgba(255, 184, 0, 0.3);
}

#all-recipes-view .recipe-card .recipe-rating .star.star-empty {
    color: #ddd;
    text-shadow: none;
}

@media (max-width: 768px) {
    #all-recipes-view .recipes-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    #all-recipes-view .recipes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
}

/* Compact layout for recent recipes */
.recent-section .recipes-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.recent-section .recipe-card {
    box-shadow: var(--shadow-sm);
}

.recent-section .recipe-image {
    aspect-ratio: 4/3;
    overflow: hidden; /* Hidden to prevent images from overflowing, but menu can still show via recipe-card overflow:visible */
    display: block;
}

.recent-section .recipe-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain !important; /* Contain to show full image scaled down within bounds - use !important to override any other rules */
}

.recent-section .recipe-placeholder {
    font-size: 28px;
}

.recent-section .recipe-info {
    padding: 8px 10px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 85px;
    background: var(--white);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.recent-section .recipe-title {
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.3;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    white-space: normal;
    line-break: auto;
}

.recent-section .recipe-category-tag {
    font-size: 10px;
    padding: 3px 8px;
}

.recent-section .recipe-quick-actions {
    top: 6px;
    left: 6px;
}

.recent-section .recipe-more-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
}

.recent-section .quick-action-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.recent-section .recipe-card .recipe-rating {
    top: 6px;
    right: 6px;
    padding: 3px 6px;
}

.recent-section .recipe-card .recipe-rating .star {
    font-size: 11px;
}

/* Responsive adjustments for recent section */
@media (max-width: 768px) {
    .recent-section .recipes-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .recent-section .recipe-title {
        font-size: 12px;
    }
    
    .recent-section .recipe-placeholder {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .recent-section .recipes-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
}

/* ===== Recipes Grid ===== */
.recipes-grid {
    display: grid;
    align-items: stretch; /* Ensure all cards have same height */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    overflow: visible;
}

.recipe-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: visible; /* Visible to allow menu to show */
    box-shadow: var(--shadow-sm);
    border: none; /* Removed border to prevent indentation */
    outline: none; /* Remove outline to prevent indentation */
    display: flex;
    flex-direction: column;
    height: auto; /* Auto height to show full content including title */
    margin: 0; /* Ensure no margin */
    padding: 0; /* Ensure no padding */
    position: static; /* Static to prevent indentation - buttons are positioned relative to .recipe-image */
    text-decoration: none; /* Remove underline from link */
    color: inherit; /* Inherit text color */
    z-index: 1; /* Ensure card is above other cards but below buttons */
}

/* Prevent link from covering buttons - buttons have higher z-index */
/* Keep recipe-quick-actions position: absolute (from .recipe-quick-actions) so it stays at top-left of image.
   Overriding to relative pushes it below the image and gets clipped by overflow:hidden. */
.recipe-card .recipe-quick-actions {
    position: absolute !important; /* Must stay absolute for top/left - do not override to relative */
    z-index: 11; /* Above card link */
}
.recipe-card .recipe-quick-actions * {
    position: relative; /* Child elements - stacking context */
    z-index: 11;
}

/* Keep image contained within card border-radius */
.recipe-card .recipe-image {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden; /* Hidden to prevent images from overflowing, but menu can still show via recipe-card overflow:visible */
    display: block;
    position: relative; /* Relative for button positioning - must be relative for absolute buttons inside */
    margin: 0;
    padding: 0;
    top: 0; /* Explicitly set top to 0 to prevent any offset */
    left: 0; /* Explicitly set left to 0 to prevent any offset */
}

.recipe-card .recipe-image img,
.recipe-card .recipe-image .recipe-placeholder {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    object-fit: contain !important; /* Contain to show full image scaled down within bounds */
}

.recipe-card:hover {
    box-shadow: var(--shadow-md);
}

.recipe-image {
    aspect-ratio: 4/3;
    overflow: hidden; /* Hidden to prevent images from overflowing, but menu can still show via recipe-card overflow:visible */
    display: block;
    position: relative; /* Relative for button positioning - must be relative for absolute buttons inside */
    margin: 0;
    padding: 0;
    min-height: 0; /* Allow aspect-ratio to work properly */
    top: 0; /* Explicitly set top to 0 to prevent any offset */
    left: 0; /* Explicitly set left to 0 to prevent any offset */
}

.recipe-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* Contain to show full image scaled down within bounds - use !important to override any other rules */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important; /* Static to prevent indentation - relative with !important was causing offset */
    z-index: 1 !important; /* Behind buttons */
    margin: 0 !important; /* Ensure no margin causing indentation */
    padding: 0 !important; /* Ensure no padding causing indentation */
    border: none !important; /* Ensure no border */
    outline: none !important; /* Ensure no outline */
    max-width: 100% !important; /* Ensure image doesn't exceed container */
    max-height: 100% !important; /* Ensure image doesn't exceed container */
}

.recipe-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, var(--cream) 0%, var(--cream-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    position: relative; /* Match image positioning */
    z-index: 1; /* Same as image */
}

.recipe-info {
    padding: 10px 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 90px;
    background: var(--white);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    position: relative; /* Relative to ensure it's above other cards */
    z-index: 1; /* Same as card to ensure proper stacking */
}

.recipe-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    white-space: normal;
    line-break: auto;
}

.recipe-category {
    font-size: 12px;
    color: var(--text-light);
}

/* Multiple Categories Display */
.recipe-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.recipe-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--cream-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-medium);
}


/* ===== Recipe Card Quick Actions ===== */
.recipe-card-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: visible; /* Visible to allow buttons and menu to show */
    margin: 0; /* Ensure no margin */
    padding: 0; /* Ensure no padding */
    border: none; /* Ensure no border */
    outline: none; /* Ensure no outline */
    z-index: 1; /* Ensure wrapper is above other wrappers but below buttons */
    isolation: isolate; /* Create new stacking context to prevent overlap with other cards */
}

.recipe-card-wrapper .recipe-card {
    display: block;
}


.recipe-quick-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10; /* Above image (1) and card (1) but well below navbar (100) and banner (102) to prevent overlap */
    opacity: 1 !important; /* Force visibility */
    display: flex !important; /* Force display */
    visibility: visible !important; /* Force visibility */
    align-items: center;
    gap: 6px;
    pointer-events: auto; /* Ensure buttons are clickable */
}

.recipe-more-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    padding: 0;
    color: #333;
    line-height: 1;
    position: relative;
    pointer-events: auto; /* Ensure button is clickable */
    z-index: 11; /* Above card link */
}


.recipe-more-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.recipe-more-btn.active {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.recipe-actions-menu {
    position: fixed !important; /* Fixed to prevent clipping by navbar/banner - JavaScript will set top/left */
    top: auto; /* Will be set by JavaScript */
    left: auto; /* Will be set by JavaScript */
    right: auto; /* Will be set by JavaScript */
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: auto;
    width: auto;
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transform: none; /* No transform - JavaScript will handle positioning */
    transition: opacity 0.2s ease, visibility 0.2s ease; /* Only transition opacity and visibility, not transform */
    pointer-events: none;
    z-index: 10003 !important; /* Above banner (102) and navbar (100) to prevent clipping - use !important to override any other rules */
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: none;
}

/* When menu is positioned fixed (to prevent clipping), override positioning */
.recipe-actions-menu[style*="position: fixed"],
.recipe-actions-menu[style*="position:fixed"] {
    position: fixed !important;
    z-index: 10003 !important;
}

/* Menu is positioned relative to recipe-quick-actions, which is inside recipe-image */
/* Since recipe-card now has overflow: visible, menu won't be clipped */


/* In RTL layout, menu positioning is handled by JavaScript */
/* Removed fixed left: 0 to allow JavaScript positioning */

/* Add invisible bridge between button and menu to prevent closing */
.recipe-actions-menu::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: -8px;
    right: -8px;
    width: calc(100% + 16px);
    height: 20px;
    background: transparent;
    pointer-events: auto;
}

[dir="rtl"] .recipe-actions-menu::before {
    left: -8px;
    right: -8px;
}

.recipe-actions-menu.show {
    opacity: 1;
    visibility: visible;
    transform: none; /* No transform - positioning is handled by JavaScript */
    pointer-events: auto;
}

/* Keep menu visible when it has the show class */
.recipe-actions-menu.show,
.recipe-quick-actions:hover .recipe-actions-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important; /* No transform - positioning is handled by JavaScript */
    pointer-events: auto !important;
}

.recipe-actions-menu .menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 8px;
    cursor: pointer;
    border: none;
    background: none;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    text-align: center;
    font-size: 18px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 6px;
    position: relative;
}

.recipe-actions-menu .menu-item .menu-icon {
    font-size: 18px;
    line-height: 1;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-actions-menu .menu-item span:not(.menu-icon) {
    display: none;
}

.recipe-actions-menu .menu-item:hover {
    background: rgba(0, 0, 0, 0.08);
}

.recipe-actions-menu .menu-item:active {
    transform: scale(0.95);
}

.recipe-actions-menu .menu-item:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.recipe-actions-menu .menu-item:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}


.recipe-actions-menu .menu-item.delete-item {
    color: #ff6b6b;
}

.recipe-actions-menu .menu-item.delete-item:hover {
    background: rgba(255, 107, 107, 0.15);
}

/* Favorite button - always visible next to menu */
.recipe-favorite-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    padding: 0;
    color: #333;
    line-height: 1;
    position: relative;
    pointer-events: auto; /* Ensure button is clickable */
    z-index: 11; /* Above card link */
}

.recipe-favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    transform: scale(1.1);
}

.recipe-favorite-btn.active {
    animation: heartPulse 0.3s ease;
}

.recipe-favorite-btn.favorite-animating {
    animation: heartBeat 0.3s ease;
}

/* Button always visible, menu opens on click */
.recipe-quick-actions {
    opacity: 1 !important;
}

.quick-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    text-decoration: none;
}

.quick-action-btn:hover {
    transform: scale(1.1);
}

.quick-action-btn.edit-btn:hover {
    background: #fff3cd;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.quick-action-btn.delete-btn:hover {
    background: #ffe5e5;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Favorite Button */
.quick-action-btn.favorite-btn {
    font-size: 18px;
    transition: all 0.3s ease;
}

.quick-action-btn.favorite-btn:hover {
    background: #fff0f0;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    transform: scale(1.15);
}

.quick-action-btn.favorite-btn.active {
    animation: heartPulse 0.3s ease;
}

.quick-action-btn.favorite-btn.favorite-animating {
    animation: heartBeat 0.3s ease;
}

/* Share Button Icon */
.quick-action-btn.share-btn {
    font-size: 0; /* Hide any text content */
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-btn.share-btn svg {
    width: 20px;
    height: 20px;
}

.quick-action-btn.share-btn:hover {
    background-color: #fff5f5;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

.quick-action-btn.share-btn:hover svg circle,
.quick-action-btn.share-btn:hover svg line {
    fill: var(--primary-color);
    stroke: var(--primary-color);
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(0.9); }
    50% { transform: scale(1.2); }
    75% { transform: scale(0.95); }
    100% { transform: scale(1); }
}


.recipe-categories-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recipe-categories-badges .recipe-category-badge {
    text-decoration: none;
    transition: all 0.2s ease;
}

.recipe-categories-badges .recipe-category-badge:hover {
    background: var(--primary-color);
    color: var(--white);
}

.recipe-desc {
    font-size: 13px;
    color: var(--text-medium);
    margin-top: 6px;
    line-height: 1.45;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    white-space: normal;
    line-break: auto;
}

/* ===== Empty State ===== */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

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

.empty-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
}

.empty-content h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-content p {
    color: var(--text-medium);
    margin-bottom: 24px;
}

/* ===== Category Page ===== */
.category-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .category-container {
        padding: 0 16px;
        gap: 16px;
    }
}

/* ===== Recipe Detail Page ===== */
.recipe-container {
    max-width: 800px;
    margin: 0 auto;
}

.recipe-header {
    margin-bottom: 24px;
}

.recipe-detail {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.recipe-hero {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--cream-dark);
    padding: 20px;
}

.recipe-hero-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.recipe-hero-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    border-radius: var(--radius-md);
}

/* Video Embed Container */
.video-embed-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-md);
}

.video-embed-container iframe {
    display: block;
    width: 100%;
    min-height: 600px;
    border: none;
}

@media (max-width: 768px) {
    .video-embed-container {
        max-width: 100%;
    }
    
    .video-embed-container iframe {
        min-height: 500px;
    }
}

/* Video Image Container with Play Button */
.video-image-container {
    position: relative;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.play-video-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.play-video-btn:hover {
    background: rgba(255, 107, 107, 0.9);
    transform: translateX(-50%) scale(1.05);
}

.play-icon {
    font-size: 16px;
}

.back-to-image-btn {
    display: block;
    margin: 12px auto 0;
    background: var(--gray-light);
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-to-image-btn:hover {
    background: var(--gray);
}

@media (max-width: 768px) {
    .play-video-btn {
        padding: 10px 18px;
        font-size: 13px;
        bottom: 16px;
    }
}

.video-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #e8f4fd 0%, #d1e8fa 100%);
    border: 1px solid #6bb3e8;
    border-radius: var(--radius-md);
    padding: 10px 16px;
    color: #1a5a8a;
    font-size: 13px;
    box-shadow: var(--shadow-sm);
}

.video-notice-icon {
    font-size: 18px;
}

.video-notice-text {
    font-weight: 500;
}

@media (max-width: 768px) {
    .video-backup-section {
        margin-top: 16px;
        padding-top: 16px;
    }
    
    .recipe-hero-image-small {
        max-width: 200px;
        max-height: 150px;
    }
    
    .video-notice {
        flex-direction: column;
        text-align: center;
        padding: 10px 14px;
        font-size: 12px;
    }
}

.recipe-content {
    padding: 24px;
}

.recipe-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.recipe-category-badge {
    background: var(--cream-dark);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
}

.recipe-date {
    font-size: 13px;
    color: var(--text-light);
}

/* Recipe Title with Favorite Button */
.recipe-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.recipe-detail-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0;
    line-height: 1.3;
    flex: 1;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    white-space: normal;
    line-break: auto;
}

.recipe-title-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Large Favorite Button for Recipe Detail */
.favorite-btn-large {
    background: var(--white);
    border: 2px solid var(--gray);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.favorite-btn-large:hover {
    border-color: var(--primary-color);
    background: #fff5f5;
    transform: scale(1.1);
}

.favorite-btn-large.active {
    border-color: var(--primary-color);
    background: #fff0f0;
}

.favorite-btn-large.favorite-animating {
    animation: heartBeat 0.3s ease;
}

/* Large Share Button for Recipe Detail */
.share-btn-large {
    background: var(--white);
    background-image: url('/static/icons/share-recipe.svg');
    background-size: 28px 28px;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid var(--gray);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 0; /* Hide any text content */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.share-btn-large:hover {
    border-color: var(--primary-color);
    background-color: #fff5f5;
    background-image: url('/static/icons/share-recipe.svg');
    transform: scale(1.1);
}

.recipe-detail-desc {
    font-size: 15px;
    color: var(--text-medium);
    line-height: 1.8;
    margin-bottom: 24px;
    white-space: pre-line;
    background: var(--gray-light);
    padding: 20px;
    border-radius: var(--radius-md);
    border-right: 4px solid var(--primary-color);
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    line-break: auto;
}

.recipe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Separate delete button from main actions */
.delete-form {
    display: inline;
    margin-right: auto; /* Push to the left side in RTL */
}

/* Add visual separator before delete */
.recipe-actions .delete-form {
    padding-right: 12px;
    border-right: 1px solid var(--gray);
}

/* Make delete button smaller and less prominent */
.recipe-actions .btn-danger {
    font-size: 13px;
    padding: 8px 14px;
    opacity: 0.7;
}

.recipe-actions .btn-danger:hover {
    opacity: 1;
}

/* ===== Forms ===== */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-header {
    margin-bottom: 24px;
}

.form-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-top: 12px;
}

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    background: var(--gray-light);
    padding: 5px;
    border-radius: var(--radius-lg);
}

.tab-btn {
    flex: 1;
    padding: 12px 18px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-medium);
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
}

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

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

/* Expandable textarea - starts small, expands on focus */
.form-group textarea.expandable {
    min-height: 80px;
    max-height: 80px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.form-group textarea.expandable:focus,
.form-group textarea.expandable.expanded {
    min-height: 200px;
    max-height: none;
    overflow: auto;
}

/* Categories Checkbox Grid */
.categories-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding: 12px;
    background: var(--gray-light);
    border-radius: var(--radius-md);
}

.category-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
}

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

.category-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.category-checkbox input[type="checkbox"]:checked + .category-checkbox-label {
    color: var(--primary-color);
    font-weight: 600;
}

.category-checkbox:has(input[type="checkbox"]:checked) {
    background: var(--cream);
    border-color: var(--primary-color);
}

.category-checkbox-label {
    font-size: 13px;
    color: var(--text-dark);
    user-select: none;
}

.url-input-group {
    display: flex;
    gap: 12px;
}

.url-input-group input {
    flex: 1;
}

/* ===== Preview Section ===== */
.preview-section {
    background: var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
}

.preview-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--secondary-color);
}

.preview-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.preview-image {
    aspect-ratio: 16/9;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-placeholder {
    font-size: 48px;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.preview-placeholder:hover {
    color: var(--primary);
}

.preview-placeholder small {
    font-size: 14px;
}

.change-image-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
    z-index: 10;
}

.change-image-btn:hover {
    transform: scale(1.1);
    background: white;
}

.preview-info {
    padding: 16px;
}

.preview-title-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    margin-bottom: 12px;
}

.preview-desc-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    max-height: 80px;
    margin-bottom: 0;
    line-height: 1.6;
    white-space: pre-line;
    transition: all 0.3s ease;
    overflow: hidden;
}

.preview-desc-input:focus,
.preview-desc-input.expanded {
    min-height: 250px;
    max-height: none;
    overflow: auto;
}

/* Expandable Description Wrapper */
.expandable-desc-wrapper {
    margin-bottom: 12px;
}

/* Expand hint button - below textarea */
.expand-hint-btn {
    display: none;
    width: 100%;
    padding: 8px 16px;
    margin-top: 4px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    color: var(--primary-color);
    background: var(--gray-light);
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.expandable-desc-wrapper.has-content .expand-hint-btn {
    display: block;
}

.expand-hint-btn:hover {
    background: var(--cream);
    border-color: var(--primary-color);
}

.expand-hint-btn:active {
    transform: scale(0.98);
}

.preview-category {
    font-size: 14px;
    color: var(--text-medium);
}

#save-link-form {
    margin-top: 20px;
    text-align: center;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.original-link {
    display: block;
    color: var(--primary-color);
    word-break: break-all;
    overflow-wrap: anywhere;
    font-size: 14px;
}

.edit-form {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ===== Image Upload Area ===== */
.optional-label {
    color: var(--text-light);
    font-weight: 400;
}

.image-upload-area {
    border: 2px dashed var(--gray);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    background: var(--gray-light);
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--cream);
}

.image-upload-area.drag-over {
    border-color: var(--primary-color);
    background: var(--cream);
}

/* Compact version for manual form */
.image-upload-compact {
    max-width: 200px;
}

/* Edit form version - larger preview */
.image-upload-edit {
    max-width: 300px;
}

.image-upload-edit .image-upload-placeholder {
    padding: 24px 16px;
    gap: 8px;
}

.image-upload-edit .upload-icon {
    font-size: 32px;
}

.image-upload-edit .upload-text {
    font-size: 14px;
}

.image-upload-edit .image-upload-preview {
    aspect-ratio: 4/3;
    max-height: 225px;
}

.image-upload-edit .remove-image-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
    top: 8px;
    left: 8px;
}

.image-upload-compact .image-upload-placeholder {
    padding: 16px 12px;
    gap: 4px;
}

.image-upload-compact .upload-icon {
    font-size: 24px;
}

.image-upload-compact .upload-text {
    font-size: 13px;
}

.image-upload-compact .image-upload-preview {
    aspect-ratio: 1/1;
    max-height: 150px;
}

.image-upload-compact .remove-image-btn {
    width: 24px;
    height: 24px;
    font-size: 14px;
    top: 6px;
    left: 6px;
}

.image-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 8px;
}

.upload-icon {
    font-size: 48px;
    opacity: 0.6;
}

.upload-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-medium);
}

.upload-hint {
    font-size: 13px;
    color: var(--text-light);
}

.image-upload-preview {
    position: relative;
    aspect-ratio: 16/9;
}

.image-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--danger);
    color: var(--white);
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.remove-image-btn:hover {
    background: #C0392B;
    transform: scale(1.1);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 20px 24px;
    color: var(--text-light);
    font-size: 13px;
    border-top: 1px solid var(--gray-light);
    background: var(--white);
}

.footer p {
    margin: 0;
}

/* ===== Advertisement Styles ===== */
.ad-banner {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid var(--gray);
    padding: 12px 0;
}

.ad-banner.ad-bottom {
    border-bottom: none;
    border-top: 1px solid var(--gray);
    margin-top: 40px;
}

.ad-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: center;
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ad-label {
    font-size: 10px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-content {
    background: var(--white);
    border: 2px dashed var(--gray);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-demo {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

/* Top/Bottom Banner Ads - 728x90 (Leaderboard) */
.ad-banner .ad-content {
    width: 728px;
    height: 90px;
    max-width: 100%;
}

/* In-Feed Horizontal Ads - 468x60 (Banner) */
.ad-inline {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.ad-horizontal .ad-content {
    width: 468px;
    height: 60px;
    max-width: 100%;
}

/* Sidebar Vertical Ads - 160x600 (Wide Skyscraper) */
.recipe-page-layout {
    display: flex;
    justify-content: center;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.ad-sidebar {
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.ad-vertical .ad-content {
    width: 160px;
    height: 600px;
}

.ad-vertical .ad-placeholder {
    position: sticky;
    top: 100px;
}

.ad-below-recipe {
    margin-top: 32px;
}

/* Responsive Ads */
@media (max-width: 1200px) {
    .ad-sidebar {
        display: none;
    }
    
    .recipe-page-layout {
        display: block;
    }
}

@media (max-width: 768px) {
    .ad-banner .ad-content {
        width: 320px;
        height: 50px;
    }
    
    .ad-horizontal .ad-content {
        width: 300px;
        height: 50px;
    }
    
    .ad-inline {
        padding: 16px 0;
    }
}

@media (max-width: 360px) {
    .ad-banner .ad-content,
    .ad-horizontal .ad-content {
        width: 280px;
        height: 50px;
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    /* Adjust body padding for mobile navbar height (logo row + search row) + safe area banner */
    body {
        padding-top: calc(env(safe-area-inset-top, 0px) + 110px);
    }
    
    .nav-container {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px;
        align-items: center;
    }
    
    /* First row: Logo title and buttons (menu + add recipe) - all in same row */
    .nav-logo {
        font-size: 16px;
        gap: 6px;
        flex: 1 1 auto;
        min-width: 0;
        order: 1;
        /* Allow text to truncate if needed */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: flex;
        align-items: center;
    }
    
    .logo-icon {
        font-size: 24px;
        flex-shrink: 0;
    }
    
    .logo-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Buttons row - menu and add recipe - same row as logo */
    .nav-user {
        order: 1;
        margin-right: 0;
        margin-left: 0;
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
        flex-wrap: nowrap;
    }
    
    .nav-user .btn-primary {
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .menu-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        flex-shrink: 0;
    }
    
    /* Search bar on second row - takes full width, always on separate row */
    .nav-search {
        order: 2;
        max-width: 100%;
        width: 100%;
        flex: 1 1 100%;
        min-width: 100%;
        margin-top: 0;
    }
    
    .nav-search input {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    /* Hide navbar install button on mobile - use floating FAB instead */
    #pwa-install-btn {
        display: none !important;
    }
    
    .menu-hamburger {
        gap: 3px;
        width: 18px;
        height: 18px;
    }
    
    .menu-hamburger span {
        width: 16px;
        height: 2.5px;
        background-color: #ffffff !important;
        display: block !important;
    }
    
    .menu-hamburger span:nth-child(2) {
        width: 12px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .category-card {
        padding: 14px 8px 12px;
    }
    
    .category-icon {
        font-size: 24px;
        width: 44px;
        height: 44px;
    }
    
    .category-name {
        font-size: 12px;
    }
    
    .category-count {
        font-size: 10px;
    }
    
    .recipes-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Show quick actions always on mobile (touch devices) */
    .recipe-quick-actions {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    .quick-action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .welcome-section {
        padding: 12px 0 0;
    }
    
    .welcome-greeting {
        font-size: 14px;
    }
    
    .welcome-section h1 {
        font-size: 22px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .section-title::before {
        width: 3px;
        height: 16px;
    }
    
    .form-header h1 {
        font-size: 22px;
    }
    
    .recipe-detail-title {
        font-size: 20px;
    }
    
    .recipe-title-row {
        gap: 8px;
    }
    
    .favorite-btn-large {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
    
    .recipe-hero {
        padding: 16px;
    }
    
    .recipe-hero-image {
        max-height: 220px;
    }
    
    .recipe-hero-placeholder {
        height: 140px;
        font-size: 42px;
    }
    
    .recipe-content {
        padding: 16px;
    }
    
    .recipe-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .recipe-actions .btn {
        width: 100%;
    }
    
    /* On mobile, put delete button last and add more separation */
    .recipe-actions .delete-form {
        order: 10;
        margin-right: 0;
        padding-right: 0;
        border-right: none;
        padding-top: 8px;
        margin-top: 4px;
        border-top: 1px solid var(--gray);
        width: 100%;
    }
    
    .recipe-actions .btn-danger {
        font-size: 14px;
        padding: 10px 18px;
    }
    
    .url-input-group {
        flex-direction: column;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .home-container {
        gap: 24px;
    }
}

/* ===== Personal Notes ===== */
.recipe-personal-notes {
    background: linear-gradient(135deg, #f0f7ff 0%, #f8fbff 100%);
    border: 1px solid #c5dcf5;
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
    position: relative;
}

.recipe-personal-notes::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #4a90d9 0%, #357abd 100%);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.notes-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notes-content {
    color: var(--text-dark);
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    word-wrap: normal;
    line-break: auto;
}

.preview-notes-input {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--gray);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    background: #f8fbff;
    resize: vertical;
    transition: all 0.2s ease;
}

.preview-notes-input:focus {
    outline: none;
    border-color: #4a90d9;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.preview-notes-input::placeholder {
    color: var(--text-light);
}

/* Clickable Notes Area */
.notes-clickable {
    cursor: pointer;
    padding: 12px;
    margin: -12px;
    margin-top: 0;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.notes-clickable:hover {
    background: rgba(74, 144, 217, 0.08);
}

.notes-clickable:hover .notes-placeholder {
    color: var(--text-medium);
}

.recipe-personal-notes.editing {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.recipe-personal-notes.saved {
    animation: noteSaved 0.5s ease;
}

@keyframes noteSaved {
    0%, 100% { background: linear-gradient(135deg, #f0f7ff 0%, #f8fbff 100%); }
    50% { background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%); }
}

/* Empty Notes State */
.notes-empty {
    opacity: 0.7;
}

.notes-placeholder {
    color: var(--text-light);
    font-style: italic;
    font-size: 14px;
}

/* Notes Textarea */
.notes-textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--gray);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    background: #fff;
    resize: vertical;
    transition: all 0.2s ease;
}

.notes-textarea:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.notes-textarea::placeholder {
    color: var(--text-light);
}

/* Notes Actions */
.notes-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* ===== Expandable Textareas ===== */
/* Additional styles handled above in .form-group textarea.expandable */

/* ===== PWA Install Button (Navbar) ===== */
.btn-install {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none;
    padding: 10px 18px !important;
    font-size: 13px !important;
    border-radius: 50px !important;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    animation: pulse-install 2s ease-in-out infinite;
}

.btn-install:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%) !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

@keyframes pulse-install {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 2px 20px rgba(102, 126, 234, 0.6);
    }
}

/* ===== PWA Install Banner ===== */
.pwa-install-banner {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2d3436 0%, #3d4448 100%);
    padding: 16px 20px;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, bottom 0.3s ease;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.pwa-install-banner.show {
    bottom: 0;
}

.pwa-install-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.pwa-install-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.pwa-install-text {
    flex: 1;
    color: var(--white);
}

.pwa-install-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.pwa-install-text span {
    font-size: 13px;
    opacity: 0.8;
}

.pwa-install-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8c68 100%);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.pwa-dismiss-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

/* ===== PWA Update Notification ===== */
.pwa-update-notification {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #26de81 0%, #20c997 100%);
    padding: 14px 24px;
    border-radius: 16px;
    z-index: 1001;
    box-shadow: 0 8px 32px rgba(38, 222, 129, 0.35), 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 420px;
    width: calc(100% - 32px);
    overflow: hidden;
}

.pwa-update-notification.pwa-update-auto {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.35), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pwa-update-notification.show {
    top: 20px;
}

.pwa-update-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    flex-wrap: wrap;
}

.pwa-update-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.pwa-update-icon.pwa-update-spinning {
    animation: spin 1s linear infinite;
}

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

.pwa-update-text {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pwa-update-title {
    font-weight: 700;
    font-size: 15px;
}

.pwa-update-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.pwa-update-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-update-btn {
    background: var(--white);
    color: #667eea;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pwa-update-btn.pwa-update-now {
    background: var(--white);
    color: #667eea;
}

.pwa-update-btn.pwa-update-later {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.pwa-update-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.pwa-update-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
}

.pwa-update-progress-bar {
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.8);
    transition: width 1s linear;
}

.pwa-update-dismiss {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    padding: 4px 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.pwa-update-dismiss:hover {
    color: white;
    transform: scale(1.2);
}

/* PWA Responsive */
@media (max-width: 768px) {
    .pwa-install-content {
        flex-wrap: wrap;
    }
    
    .pwa-install-text {
        flex: 1 1 calc(100% - 60px);
    }
    
    .pwa-install-actions {
        flex: 1 1 100%;
        justify-content: stretch;
    }
    
    .pwa-install-actions button {
        flex: 1;
    }
    
    .pwa-update-notification {
        left: 16px;
        right: 16px;
        transform: none;
        border-radius: var(--radius-md);
        max-width: none;
        width: auto;
    }
    
    .pwa-update-content {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 10px;
    }
    
    .pwa-update-text {
        width: 100%;
        text-align: center;
    }
    
    .pwa-update-actions {
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }
    
    .pwa-update-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ===== Standalone Mode Styles ===== */
/* Hide some elements when running as installed PWA */
@media (display-mode: standalone) {
    /* Add any standalone-specific styles here */
    .pwa-install-banner {
        display: none !important;
    }
    #pwa-install-btn {
        display: none !important;
    }
    
    /* Ensure navbar buttons are properly aligned in PWA mode */
    .nav-container {
        align-items: center;
    }
    
    .nav-user {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .nav-user .btn-primary {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .menu-btn {
        flex-shrink: 0;
    }
    
    /* Ensure safe area is respected in PWA standalone mode */
    .navbar {
        top: env(safe-area-inset-top, 0px);
    }
    
    .top-safe-area-banner {
        height: env(safe-area-inset-top, 0px);
    }
    
    body {
        padding-top: calc(env(safe-area-inset-top, 0px) + 70px);
    }
    
    @media (max-width: 768px) {
        body {
            padding-top: calc(env(safe-area-inset-top, 0px) + 110px);
        }
    }
}

/* ===== Floating PWA Install Button (Mobile) ===== */
.pwa-install-fab {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fab-bounce 2s ease-in-out infinite;
}

.fab-main-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.fab-main-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 35px rgba(102, 126, 234, 0.6);
}

.fab-main-btn:active {
    transform: translateY(-2px);
}

.fab-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #666;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.fab-close-btn:hover {
    background: #ff6b6b;
    color: white;
    transform: scale(1.1);
}

.fab-icon {
    font-size: 22px;
}

.fab-text {
    white-space: nowrap;
}

@keyframes fab-bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-4px);
    }
}

@keyframes fab-glow {
    0%, 100% {
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 6px 35px rgba(102, 126, 234, 0.8), 0 0 20px rgba(118, 75, 162, 0.4);
    }
}

/* Hide FAB on desktop, show on mobile */
@media (min-width: 769px) {
    .pwa-install-fab {
        display: none !important;
    }
}

/* Adjust FAB position when there's bottom content */
@media (max-width: 768px) {
    .pwa-install-fab {
        bottom: 20px;
    }
    
    .fab-main-btn {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .fab-icon {
        font-size: 20px;
    }
    
    .fab-close-btn {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}

/* Hide in standalone mode */
@media (display-mode: standalone) {
    .pwa-install-fab {
        display: none !important;
    }
}

/* ===== PWA Install Success Message ===== */
.pwa-success-message {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #26de81 0%, #20c997 100%);
    color: white;
    padding: 16px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 6px 25px rgba(38, 222, 129, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: all 0.3s ease;
}

.pwa-success-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== Install Instructions Modal ===== */
.install-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.install-modal.show {
    opacity: 1;
    visibility: visible;
}

.install-modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.install-modal.show .install-modal-content {
    transform: translateY(0);
}

.install-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-light);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
    transition: all 0.2s ease;
}

.install-modal-close:hover {
    background: var(--gray);
    color: var(--text-dark);
}

.install-modal-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.install-modal-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.install-modal-content p {
    color: var(--text-medium);
    margin-bottom: 24px;
    font-size: 15px;
}

.install-steps {
    text-align: right;
    margin-bottom: 24px;
}

.install-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--gray-light);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--text-dark);
}

.install-step-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
}

.install-step-warning .step-number {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.step-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.install-modal-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.install-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.install-modal-btn-copy {
    margin-bottom: 10px;
}

.install-modal-btn-secondary {
    background: var(--gray-light);
    color: var(--text-dark);
}

.install-modal-btn-secondary:hover {
    background: var(--gray);
    box-shadow: none;
}

.install-modal-btn-dismiss {
    background: transparent;
    color: var(--text-medium);
    margin-top: 8px;
    padding: 10px 24px;
    font-size: 14px;
    border: 1px dashed var(--gray);
}

.install-modal-btn-dismiss:hover {
    background: var(--success);
    color: white;
    border-color: var(--success);
    box-shadow: 0 4px 15px rgba(38, 222, 129, 0.3);
}

/* ===== Report Problem Modal ===== */
.report-problem-btn {
    background: none;
    border: none;
    cursor: pointer;
    text-align: right;
    width: 100%;
    font-family: inherit;
}

.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.report-modal.show {
    opacity: 1;
    visibility: visible;
}

.report-modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 85vh;
    overflow-y: auto;
}

.report-modal.show .report-modal-content {
    transform: translateY(0) scale(1);
}

.report-modal-close {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--gray-light);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
    transition: all 0.2s ease;
    line-height: 1;
}

.report-modal-close:hover {
    background: var(--danger);
    color: var(--white);
}

.report-modal-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.report-modal-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.report-modal-content > p {
    color: var(--text-medium);
    margin-bottom: 16px;
    font-size: 13px;
}

#report-form {
    text-align: right;
}

#report-form .form-group {
    margin-bottom: 12px;
}

#report-form .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--text-dark);
}

#report-form select,
#report-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--white);
}

#report-form select:focus,
#report-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

#report-form textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

#report-form textarea::placeholder {
    color: var(--text-light);
}

.report-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
}

.report-form-actions .btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
}

.report-form-actions .btn-icon {
    margin-right: 4px;
}

.report-form-actions .btn-icon.spinning {
    animation: spin 1s linear infinite;
}

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

/* Report Success State */
.report-success {
    padding: 16px;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.report-success .success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.report-success h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 6px;
}

.report-success p {
    color: var(--text-medium);
    margin-bottom: 16px;
    font-size: 13px;
}

/* Report Modal Responsive */
@media (max-width: 768px) {
    .report-modal {
        padding: 8px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .report-modal-content {
        padding: 16px;
        max-width: 100%;
        max-height: calc(100vh - 60px);
    }
    
    .report-modal-icon {
        font-size: 32px;
        margin-bottom: 6px;
    }
    
    .report-modal-content h3 {
        font-size: 16px;
    }
    
    .report-modal-content > p {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    #report-form .form-group {
        margin-bottom: 10px;
    }
    
    #report-form select,
    #report-form textarea {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    #report-form textarea {
        min-height: 60px;
    }
    
    .report-form-actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .report-form-actions .btn {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ===== Video Ad Modal ===== */
.video-ad-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.video-ad-modal.show {
    opacity: 1;
    visibility: visible;
}

.video-ad-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    transform: scale(0.95);
    transition: transform 0.4s ease;
}

.video-ad-modal.show .video-ad-container {
    transform: scale(1);
}

.video-ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.ad-badge {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #1a1a1a;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.4);
}

.ad-countdown {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

.video-ad-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.video-ad-player iframe,
.video-ad-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-ad-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.ad-skip-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.ad-skip-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

.ad-cta-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff8c68 100%);
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

.ad-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.6);
}

.video-ad-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.ad-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #ff8c68, #ffc107);
    border-radius: 2px;
    transition: width 0.3s linear;
}

/* Video Ad Modal Responsive */
@media (max-width: 768px) {
    .video-ad-container {
        padding: 16px;
    }
    
    .video-ad-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .video-ad-player {
        border-radius: var(--radius-md);
    }
    
    .video-ad-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .ad-skip-btn,
    .ad-cta-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Disable body scroll when ad is showing */
body.ad-showing {
    overflow: hidden;
}

/* ===== Footer Link ===== */
.footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--primary-color);
}

/* ===== Recipe Images Upload (Multiple) ===== */
.recipe-images-upload-area {
    border: 2px dashed var(--gray);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--white);
    transition: all 0.3s ease;
    min-height: 120px;
}

.recipe-images-upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(255, 107, 107, 0.05);
}

.recipe-images-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    cursor: pointer;
    color: var(--text-light);
    text-align: center;
    gap: 8px;
}

.recipe-images-placeholder .upload-icon {
    font-size: 32px;
    opacity: 0.7;
}

.recipe-images-placeholder .upload-text {
    font-size: 14px;
    font-weight: 500;
}

.recipe-images-placeholder .upload-hint {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

.recipe-images-placeholder:hover {
    color: var(--primary-color);
}

.recipe-images-placeholder:hover .upload-icon {
    opacity: 1;
}

/* Recipe Images Grid */
.recipe-images-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.recipe-images-grid.has-images,
.recipe-images-grid:not(:empty) {
    display: grid;
}

.recipe-image-preview {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--gray-light);
}

.recipe-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-image-preview.uploading {
    opacity: 0.7;
}

.recipe-image-preview .upload-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    z-index: 2;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.recipe-image-preview .remove-recipe-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.recipe-image-preview:hover .remove-recipe-image-btn {
    opacity: 1;
}

.recipe-image-preview .remove-recipe-image-btn:hover {
    background: var(--danger);
}

/* Add More Images Button */
.add-more-images-btn {
    aspect-ratio: 1;
    border: 2px dashed var(--gray);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    gap: 4px;
    transition: all 0.2s ease;
    background: var(--white);
}

.add-more-images-btn span {
    font-size: 24px;
    line-height: 1;
}

.add-more-images-btn small {
    font-size: 10px;
}

.add-more-images-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(255, 107, 107, 0.05);
}

/* ===== Recipe Upload Section (Detail Page) ===== */
.recipe-upload-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray);
}

.upload-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.upload-group {
    margin-bottom: 24px;
}

.upload-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 8px;
}

/* Detail page image upload area */
.image-upload-detail {
    max-width: 400px;
    min-height: 200px;
}

.image-upload-detail .image-upload-placeholder {
    padding: 32px 20px;
    gap: 12px;
}

.image-upload-detail .upload-icon {
    font-size: 40px;
}

.image-upload-detail .upload-text {
    font-size: 15px;
}

.image-upload-detail .image-upload-preview {
    aspect-ratio: 4/3;
    max-height: 300px;
}

.image-upload-detail .remove-image-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
    top: 10px;
    left: 10px;
}

.recipe-upload-section .recipe-images-upload-area {
    min-height: 150px;
}

.upload-success {
    animation: uploadSuccessPulse 0.5s ease;
}

@keyframes uploadSuccessPulse {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(38, 222, 129, 0.1); }
}

/* ===== Recipe Images Gallery (Display) ===== */
.recipe-images-gallery {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray);
}

.gallery-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.gallery-thumbnail {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-wrapper {
    max-width: 100%;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.lightbox-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 2;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 2;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.lightbox-counter {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 2;
}

/* Lightbox Responsive */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .lightbox-prev {
        left: 8px;
    }
    
    .lightbox-next {
        right: 8px;
    }
    
    .lightbox-close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .gallery-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 6px;
    }
}

/* Recipe Images in Edit Mode */
.recipe-images-grid.has-images {
    display: grid;
}

/* Hide placeholder when grid has images */
.recipe-images-upload-area:has(.recipe-images-grid.has-images) .recipe-images-placeholder {
    display: none;
}

/* ===== Manual Form Redesign - Minimalist ===== */
.manual-form-redesign {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 8px 0;
}

.form-section {
    padding: 0;
    background: transparent;
}

.form-section + .form-section {
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Badge Styles */
.required-badge,
.optional-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

.required-badge {
    background: rgba(255, 107, 107, 0.12);
    color: var(--primary-color);
}

.optional-badge {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-light);
}

/* Form Labels */
.form-label-large {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.form-label-medium {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-label-small {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 8px;
}

.form-hint {
    display: none; /* Hidden - consolidated into labels */
}

/* Large Input */
.input-large {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-large:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.1);
}

.input-large::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

/* Images Row - Side by Side */
.images-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.image-upload-box {
    display: flex;
    flex-direction: column;
}

/* Square Image Upload Areas */
.image-upload-square,
.recipe-images-square {
    aspect-ratio: 1;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
}

.image-upload-square:hover,
.recipe-images-square:hover {
    border-color: var(--primary-color);
    background: rgba(255, 107, 107, 0.03);
}

.image-upload-square .image-upload-placeholder,
.recipe-images-square .recipe-images-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-light);
    text-align: center;
    padding: 16px;
}

.image-upload-square .upload-icon,
.recipe-images-square .upload-icon {
    font-size: 36px;
    opacity: 0.7;
    pointer-events: none;
}

.image-upload-square .upload-text,
.recipe-images-square .upload-text {
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
}

.image-upload-square .image-upload-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.image-upload-square .image-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Recipe Images Grid in Square Container */
.recipe-images-square .recipe-images-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
    overflow-y: auto;
    align-content: start;
}

.recipe-images-square .recipe-images-grid.has-images,
.recipe-images-square .recipe-images-grid[style*="grid"] {
    display: grid;
}

.recipe-images-square .recipe-image-preview {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.recipe-images-square .recipe-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.recipe-images-square .recipe-image-preview:hover img {
    transform: scale(1.02);
}

.recipe-images-square .recipe-image-preview .remove-recipe-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    font-size: 12px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: #666;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-images-square .recipe-image-preview:hover .remove-recipe-image-btn {
    opacity: 1;
}

.recipe-images-square .recipe-image-preview .remove-recipe-image-btn:hover {
    background: var(--danger);
    color: white;
}

/* Mobile: always show delete button */
@media (hover: none), (max-width: 768px) {
    .recipe-images-square .recipe-image-preview .remove-recipe-image-btn {
        opacity: 1;
    }
}

.recipe-images-square .add-more-images-btn {
    aspect-ratio: 1;
    border: 2px dashed rgba(0,0,0,0.15);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 4px;
}

.recipe-images-square .add-more-images-btn span {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1;
}

.recipe-images-square .add-more-images-btn small {
    font-size: 7px;
    color: var(--text-light);
}

.recipe-images-square .add-more-images-btn:hover {
    border-color: var(--primary-color);
    background: rgba(255, 107, 107, 0.05);
}

/* Large Textarea */
.textarea-large {
    width: 100%;
    min-height: 140px;
    padding: 14px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    background: var(--white);
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.textarea-large:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.1);
}

.textarea-large::placeholder {
    color: var(--text-light);
}

/* Notes Textarea */
.textarea-notes {
    width: 100%;
    min-height: 60px;
    padding: 12px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    background: var(--white);
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.textarea-notes:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.1);
}

/* Categories Toggle Grid */
.categories-toggle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.category-toggle {
    cursor: pointer;
}

.category-toggle input[type="checkbox"] {
    display: none;
}

.category-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    background: rgba(0,0,0,0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.category-toggle-btn .category-icon {
    font-size: 20px;
}

.category-toggle-btn .category-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-medium);
}

.category-toggle:hover .category-toggle-btn {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0,0,0,0.04);
}

/* Category validation error */
.categories-toggle-grid.error {
    outline: 2px solid var(--danger);
    outline-offset: 8px;
    border-radius: 8px;
    background: rgba(255, 107, 107, 0.04);
}

.category-error-message {
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    display: none;
    text-align: center;
}

.category-error-message.show {
    display: block;
}

.category-toggle input:checked + .category-toggle-btn {
    background: rgba(255, 107, 107, 0.1);
    border-color: var(--primary-color);
}

.category-toggle input:checked + .category-toggle-btn .category-name {
    color: var(--primary-color);
    font-weight: 600;
}

.category-toggle input:checked:hover + .category-toggle-btn {
    background: rgba(255, 107, 107, 0.15);
}

/* Submit Button Section */
.form-submit-section {
    padding-top: 24px;
    margin-top: 8px;
}

.btn-submit-large {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .manual-form-redesign {
        gap: 20px;
    }
    
    .form-section {
        padding: 0;
    }
    
    .form-section + .form-section {
        padding-top: 20px;
    }
    
    .images-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .input-large {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .categories-toggle-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .category-toggle-btn {
        padding: 12px 8px;
        flex-direction: column;
        gap: 4px;
    }
    
    .category-toggle-btn .category-icon {
        font-size: 22px;
    }
    
    .category-toggle-btn .category-name {
        font-size: 11px;
    }
    
    .textarea-large {
        min-height: 180px;
        padding: 14px;
    }
    
    .category-toggle-btn {
        padding: 8px 12px;
    }
    
    .category-toggle-btn .category-icon {
        font-size: 14px;
    }
    
    .category-toggle-btn .category-name {
        font-size: 12px;
    }
    
    .form-submit-section {
        padding: 12px 0;
        padding-top: 20px;
    }
    
    .btn-submit-large {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* Desktop enhancements */
@media (min-width: 768px) {
    .manual-form-redesign {
        max-width: 700px;
        margin: 0 auto;
        gap: 28px;
    }
    
    .form-section {
        padding: 24px;
    }
    
    .images-row {
        gap: 24px;
    }
}

/* ===== AdSense Access Modal Styles ===== */
.adsense-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.adsense-modal.active {
    opacity: 1;
}

.adsense-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}

.adsense-modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px 30px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.adsense-modal.active .adsense-modal-content {
    transform: scale(1);
}

.adsense-modal-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

.adsense-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.adsense-modal-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-medium);
    margin-bottom: 24px;
}

.adsense-modal-benefits {
    background: var(--gray-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 30px;
    text-align: right;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--text-dark);
    padding: 10px 0;
    font-weight: 500;
}

.benefit-item:not(:last-child) {
    border-bottom: 1px solid var(--gray);
}

.adsense-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.adsense-watch-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: var(--white);
    font-size: 18px;
    font-weight: 600;
    padding: 18px 32px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.35);
}

.adsense-watch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 107, 0.45);
}

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

.adsense-cancel-btn {
    background: transparent;
    color: var(--text-medium);
    font-size: 15px;
    padding: 14px;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.adsense-cancel-btn:hover {
    color: var(--text-dark);
}

/* Ad Display Screen */
.adsense-ad-display {
    text-align: center;
}

.ad-timer-container {
    margin-bottom: 24px;
}

.ad-timer-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.ad-timer-text #ad-timer-seconds {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
}

.ad-timer-bar-wrapper {
    width: 100%;
    height: 8px;
    background: var(--gray);
    border-radius: 4px;
    overflow: hidden;
}

.ad-timer-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 1s linear;
    border-radius: 4px;
}

.adsense-ad-container {
    background: var(--gray-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-watching-note {
    font-size: 14px;
    color: var(--text-medium);
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 140, 66, 0.1);
    border-radius: var(--radius-sm);
}

/* Ad Complete Message */
.ad-complete-message {
    text-align: center;
    padding: 30px 20px;
}

.ad-complete-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: bounceIn 0.6s ease;
}

.ad-complete-message h3 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.ad-complete-message p {
    font-size: 16px;
    color: var(--text-medium);
    margin-bottom: 24px;
}

/* Access Indicator (top right) */
.access-indicator {
    position: fixed;
    top: 80px;
    left: 20px;
    background: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 900;
    animation: slideInRight 0.4s ease;
}

.access-indicator.active {
    display: flex;
}

@keyframes slideInRight {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.indicator-icon {
    font-size: 20px;
}

.indicator-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--success);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .adsense-modal-content {
        padding: 30px 20px;
        max-height: 95vh;
    }
    
    .adsense-modal-icon {
        font-size: 48px;
    }
    
    .adsense-modal-title {
        font-size: 22px;
    }
    
    .adsense-modal-text {
        font-size: 15px;
    }
    
    .adsense-watch-btn {
        font-size: 16px;
        padding: 16px 24px;
    }
    
    .adsense-ad-container {
        min-height: 200px;
        padding: 15px;
    }
    
    .access-indicator {
        top: 70px;
        left: 10px;
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ===== Update Notification ===== */
.update-notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    max-width: 400px;
    width: 90%;
    transition: top 0.3s ease;
}

.update-notification.show {
    top: 20px;
}

.update-notification-content {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

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

.update-icon {
    font-size: 32px;
    animation: bounce 1s ease infinite;
}

.update-text {
    flex: 1;
}

.update-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 2px;
}

.update-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.update-btn {
    background: white;
    color: #4CAF50;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.update-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.update-btn:active {
    transform: scale(0.98);
}

@media (max-width: 480px) {
    .update-notification-content {
        padding: 14px 16px;
        gap: 10px;
    }
    
    .update-icon {
        font-size: 28px;
    }
    
    .update-text strong {
        font-size: 15px;
    }
    
    .update-text p {
        font-size: 12px;
    }
    
    .update-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}


/* ===== Star Rating Component ===== */
.rating-section {
    background: var(--gray-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-top: 16px;
    border: 1px solid var(--gray);
}

.rating-section-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.rating-section-title .optional-badge {
    font-weight: 400;
}

/* Star Rating - Click on stars */
.star-rating-container {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.star-rating {
    display: flex;
    gap: 8px;
    direction: rtl;
}

.star-rating .star {
    cursor: pointer;
    font-size: 42px;
    line-height: 1;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

.star-rating .star:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 4px 8px rgba(255, 193, 7, 0.4));
}

.star-rating .star:active {
    transform: scale(0.95);
}

/* Empty star - subtle gray outline */
.star-rating .star.empty {
    color: #d4d4d4;
    opacity: 0.7;
}

/* Filled star - rich gold with glow */
.star-rating .star.filled {
    color: #FFB800;
    filter: drop-shadow(0 2px 4px rgba(255, 184, 0, 0.4));
}

/* Hidden input for form submission */
.star-rating-input {
    display: none;
}

/* Clear rating button - styled like primary button but smaller */
.clear-rating-btn {
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff8c68 100%);
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.clear-rating-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

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

/* Rating display (for recipe cards) */
.recipe-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 14px;
}

.recipe-rating .star {
    color: #FFB800;
    text-shadow: 0 1px 2px rgba(255, 184, 0, 0.3);
}

.recipe-rating .star-empty {
    color: #ddd;
}

.recipe-rating-text {
    font-size: 12px;
    color: var(--text-light);
    margin-right: 4px;
}

/* Sorting Dropdown */
.sort-dropdown-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    z-index: 1000000; /* Very high z-index to ensure it's above recipe cards */
}

.sort-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.sort-dropdown-btn:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.sort-dropdown-btn .sort-arrow {
    font-size: 12px;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.sort-dropdown-container.open .sort-dropdown-btn .sort-arrow {
    transform: rotate(180deg);
}

.sort-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    max-width: 90vw;
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 999999;
    overflow: visible;
    padding-bottom: 4px;
    margin: 0;
    white-space: nowrap;
}

.sort-dropdown-container.open .sort-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* When menu is fixed (set by JavaScript), ensure it's above everything */
.sort-dropdown-menu[style*="position: fixed"],
.sort-dropdown-menu[style*="position:fixed"] {
    position: fixed !important;
    z-index: 1000000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Portaled menu (moved to body) */
.sort-dropdown-menu--portal {
    position: fixed !important;
    z-index: 1000000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--gray-light);
}

.sort-option:last-child {
    border-bottom: none;
    padding-bottom: 12px;
    margin-bottom: 0;
}

.sort-option:hover {
    background: var(--gray-light);
}

.sort-option.active {
    background: rgba(255, 107, 107, 0.1);
    color: var(--primary-color);
}

.sort-option-text {
    flex: 1;
    font-size: 14px;
}

.sort-direction {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 600;
}

/* Recipe Detail Rating Display */
.recipe-detail-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 16px 0;
}

.recipe-detail-rating .rating-label {
    font-size: 14px;
    color: var(--text-medium);
}

.recipe-detail-rating .rating-stars {
    display: flex;
    gap: 4px;
}

.recipe-detail-rating .star {
    font-size: 24px;
    line-height: 1;
}

.recipe-detail-rating .star.filled {
    color: #FFB800;
}

.recipe-detail-rating .star.empty {
    color: #ddd;
}

/* Rating display on recipe card */
.recipe-card .recipe-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.recipe-card .recipe-rating .stars {
    display: flex;
    gap: 1px;
}

.recipe-card .recipe-rating .star {
    font-size: 14px;
    color: #FFB800;
    text-shadow: 0 1px 2px rgba(255, 184, 0, 0.3);
}


