/* Global Theme */
:root {
    --brand-accent: #edd624; /* Bright Yellow Accent */
    --brand-text: #010240; /* Deep Navy Text */
    --brand-bg: #e1e2f5; /* Light Lavender Background */
    --white: #ffffff;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--brand-text);
    background: var(--brand-bg);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    background: transparent;
}

.nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--brand-text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
}

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

.nav-btn:active {
    transform: scale(0.95);
}

.credits-value {
    font-weight: 600;
    font-size: 16px;
    color: #e6ac00;
    }

/* Main Content */
.main-content {
    min-height: 100vh; /* Full viewport height */
    padding-top: 0;
}

/* Screen Container */
.screen-container {
    position: relative;
    min-height: 100vh;
    width: 100%;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.screen-container.fade-out {
    opacity: 0;
}

.screen-container.fade-in {
    opacity: 1;
}

/* Simple Screen Styles */
.screen-simple {
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.screen-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(to right, var(--brand-bg), transparent);
}

.screen-background::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(to left, var(--brand-bg), transparent);
}

.screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 245, 255, 0.7); /* White with 70% opacity */
    z-index: 1;
    pointer-events: none; /* Allow interaction with content below */
}

.screen-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
    max-width: 600px;
    min-height: 420px;
    width: 100%;
}

.logo-container {
    margin-bottom: 40px;
}

.logo {
    max-width: 200px;
    height: auto;
}

.text-content {
    margin-bottom: 30px;
}

.screen-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-text);
    margin-bottom: 16px;
    line-height: 1.2;
}

.screen-subtitle {
    font-size: 18px;
    color: var(--brand-text);
    opacity: 0.8;
    line-height: 1.5;
}

.button-container {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 400px;
}

.btn-start {
    text-decoration: none;
}

.btn-action {
    width: 100%;
    max-width: 630px;
    padding: 16px 40px;
    background: var(--brand-accent);
    color: var(--brand-text);
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(237, 214, 36, 0.3);
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(237, 214, 36, 0.4);
}

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

/* Choice Screen Styles */
.choice-screen {
    padding: 80px 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.choice-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-text);
    text-align: center;
    margin-bottom: 40px;
}

.choices-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.layout-2x2 {
    grid-template-columns: repeat(2, 1fr);
}

.layout-2x3 {
    grid-template-columns: repeat(2, 1fr);
}

.choice-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.choice-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.choice-card:active {
    transform: scale(0.98);
}

.choice-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 133.3333%; /* 3:4 portrait aspect ratio (height = width * 4/3) */
    overflow: hidden;
}

.choice-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0; /* behind overlay and text */
    display: block;
}

/* subtle white overlay on top of the image to improve text readability */
.choice-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1); /* 0.1 white transparency as requested */
    z-index: 1;
    pointer-events: none;
}

/* place choice text on top of the image at the bottom */
.choice-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2; /* above image and its overlay */
    padding: 14px 16px;
    /* Slight translucent backdrop to ensure legibility on very busy images while keeping visual lightness */
    background: linear-gradient(to top, rgba(255,255,255,0.9) 10%, rgba(255,255,255,0.0) 100%);
    color: var(--brand-text);
}

.choice-title-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-text);
    margin-bottom: 6px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.6); /* subtle lift for contrast */
}

.choice-subtitle {
    font-size: 14px;
    color: var(--brand-text);
    opacity: 0.85;
    margin: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.d-none {
    display: none;
}

/* Modal Customization */
.modal-content {
    border-radius: 20px;
    border: none;
}

.modal-header {
    padding: 24px 24px 0;
}

.modal-body {
    padding: 24px;
}

.nav-tabs .nav-link {
    color: var(--brand-text);
    border: none;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link.active {
    color: var(--brand-text);
    font-weight: 600;
    border-bottom: 2px solid var(--brand-accent);
    background: transparent;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 12px;
}

.form-control:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 0.2rem rgba(237, 214, 36, 0.25);
}

.btn-primary {
    background: var(--brand-accent);
    border: none;
    color: var(--brand-text);
    font-weight: 600;
    padding: 12px;
    border-radius: 8px;
}

.btn-primary:hover {
    background: #d4a621;
}

/* Dropdown Menu */
.dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: none;
    padding: 8px;
    margin-top: 8px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 10px 16px;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: var(--brand-bg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .screen-title {
        font-size: 28px;
    }

    .screen-subtitle {
        font-size: 16px;
    }

    .choice-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .choice-card {
        border-radius: 12px;
    }

    .choice-text {
        padding: 15px;
    }

    .choice-title-text {
        font-size: 16px;
    }

    .choice-subtitle {
        font-size: 13px;
    }

    .choices-grid {
        gap: 15px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .choices-grid.layout-2x3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .choices-grid.layout-2x2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .choices-grid.layout-2x3 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1000px;
        margin: 0 auto 40px;
    }

    .choices-grid.layout-2x2 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
        margin: 0 auto 40px;
    }

    .choice-screen {
        padding: 100px 40px 60px;
    }
}

/* Advanced Mode: main-frame height for large screens */
@media (min-width: 1024px) {
  .advanced-layout,
  .canvas-area {
    height: 100%;
  }
  .main-frame.advanced {
    height: 50%;
    max-height: 50%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }
  .main-frame.advanced .image-wrapper {
    height: 100%;
    padding-bottom: 0 !important;
    aspect-ratio: unset !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
  }
  #advanced-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    max-width: 100%;
    max-height: 100%;
  }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.d-none {
    display: none;
}

/* ===== MULTI-SELECT STYLES ===== */
.choice-card.selected {
    border: 3px solid var(--brand-accent);
    transform: scale(1.02);
}

.choice-checkmark {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
    z-index: 10;
}

.choice-checkmark i {
    color: var(--brand-text);
    font-size: 14px;
}

.choice-card.selected .choice-checkmark {
    opacity: 1;
    transform: scale(1);
}

.selection-counter {
    text-align: center;
    font-size: 16px;
    color: var(--brand-text);
    opacity: 0.8;
    margin-bottom: 20px;
}

#selected-count {
    font-weight: 800;
    color: var(--brand-text);
}

/* Choice subtitle header */
.choice-subtitle-header {
    text-align: center;
    font-size: 16px;
    color: var(--brand-text);
    opacity: 0.7;
    margin-bottom: 15px;
}

/* Button container fixed at bottom */
.button-container-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, var(--brand-bg) 80%, transparent);
    z-index: 100;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.btn-disabled {
    background: #ccc !important;
    color: #888 !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

/* ===== LAYOUT 1x2 (2 columns, icon cards for objectives) ===== */
.layout-1x2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 400px;
    margin: 0 auto 100px;
}

.layout-1x2 .choice-card {
    aspect-ratio: auto;
    border-radius: 20px;
}

.layout-1x2 .choice-image-wrapper {
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
    text-align: center;
}

.layout-1x2 .choice-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 20px;
    position: relative;
}

.layout-1x2 .choice-text {
    position: relative;
    padding: 0;
    background: none;
    text-align: center;
}

.layout-1x2 .choice-title-text {
    font-size: 20px;
    margin-bottom: 8px;
}

.layout-1x2 .choice-subtitle {
    font-size: 14px;
}

/* ===== LAYOUT 1x3 (3 budget cards) ===== */
.layout-1x3 {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto 100px;
}

.layout-1x3 .choice-card {
    border-radius: 16px;
}

.layout-1x3 .choice-image-wrapper {
    padding-bottom: 0;
    display: flex;
    align-items: center;
    padding: 24px;
}

.layout-1x3 .choice-icon-wrapper {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 16px;
}

.layout-1x3 .choice-text {
    position: relative;
    padding: 0;
    background: none;
    text-align: left;
    flex: 1;
}

.layout-1x3 .choice-checkmark {
    position: relative;
    top: auto;
    right: auto;
    margin-left: auto;
}

/* ===== ICON WRAPPER FOR NON-IMAGE CARDS ===== */
.choice-icon-wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--brand-text);
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}

/* ===== FORM SCREEN ===== */
.form-screen {
    min-height: 100vh;
    padding: 80px 24px 120px;
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-text);
    margin-bottom: 12px;
}

.form-subtitle {
    font-size: 16px;
    color: var(--brand-text);
    opacity: 0.7;
}

.form-content {
    flex: 1;
}

.form-field {
    margin-bottom: 32px;
}

.form-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-text);
    margin-bottom: 12px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    background: var(--white);
    color: var(--brand-text);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 4px rgba(237, 214, 36, 0.2);
}

.form-input::placeholder {
    color: #aaa;
}

/* Currency Selector */
.currency-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.currency-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: var(--white);
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.currency-option:hover {
    border-color: #ccc;
    background: #f9f9f9;
}

.currency-option.selected {
    border-color: var(--brand-accent);
    background: rgba(237, 214, 36, 0.1);
}

.currency-symbol {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-text);
    margin-bottom: 4px;
}

.currency-code {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-text);
    opacity: 0.7;
}

/* ===== PROFILE SCREEN ===== */
.profile-screen {
    min-height: 100vh;
    padding: 80px 20px 160px;
    max-width: 500px;
    margin: 0 auto;
}

.profile-header {
    text-align: center;
    margin-bottom: 32px;
}

.profile-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-text);
    margin-bottom: 8px;
}

.profile-subtitle {
    font-size: 16px;
    color: var(--brand-text);
    opacity: 0.7;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.user-info-card {
    text-align: center;
    background: linear-gradient(135deg, var(--brand-accent), #f5e85c);
}

.profile-greeting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.greeting-emoji {
    font-size: 32px;
}

.greeting-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-text);
    margin: 0;
}

.profile-section {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-text);
    opacity: 0.6;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    font-size: 16px;
}

/* Selected Styles Grid */
.selected-styles {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Simple style preview (fallback) */
.style-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3/4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.style-preview-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* Detailed style cards with descriptions */
.style-card-detailed {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.style-card-detailed:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.style-card-header {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.style-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.style-card-title-section {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(1, 2, 64, 0.9), rgba(1, 2, 64, 0.7), transparent);
}

.style-card-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0 0 4px 0;
}

.style-card-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-style: italic;
}

.style-card-body {
    padding: 20px;
}

.style-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--brand-text);
    margin: 0 0 16px 0;
}

/* Advanced sections */
.advanced-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(1, 2, 64, 0.1);
}

.advanced-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-text);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-text);
    background: var(--brand-bg);
}

.color-tag.primary-color {
    background: var(--brand-accent);
}

.color-tag.accent-color {
    background: rgba(237, 214, 36, 0.3);
    border: 1px solid var(--brand-accent);
}

.color-label {
    display: inline-block;
    margin: 4px 12px 0 0;
    font-size: 12px;
    color: #333;
    vertical-align: middle;
}

.color-label.primary-label {
    font-weight: 600;
}

.color-label.accent-label {
    font-style: italic;
}

.color-hex {
    display: inline-block;
    margin-left: 4px;
    font-size: 11px;
    color: #888;
}

.design-principles-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.design-principles-list li {
    position: relative;
    padding: 8px 0 8px 24px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--brand-text);
}

.design-principles-list li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--brand-accent);
    font-weight: 700;
}

/* Profile Values */
.profile-value {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-text);
}

.profile-value i {
    font-size: 22px;
}

.profile-item {
    min-height: 40px;
}

.empty-message {
    color: var(--brand-text);
    opacity: 0.5;
    font-size: 14px;
    font-style: italic;
    margin: 0;
}

.currency-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-accent);
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-text);
}

/* Signup Button */
.btn-signup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--brand-accent), #f5e85c);
    font-size: 18px;
}

.btn-signup i {
    font-size: 20px;
}

.signup-hint {
    margin-top: 12px;
    font-size: 14px;
    color: var(--brand-text);
    opacity: 0.6;
    text-align: center;
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 400px) {
    .currency-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-title {
        font-size: 26px;
    }

    .profile-title {
        font-size: 24px;
    }

    .greeting-name {
        font-size: 20px;
    }
}

@media (min-width: 768px) {
    .form-screen,
    .profile-screen {
        padding-top: 100px;
    }

    .layout-1x3 {
        max-width: 500px;
    }
}

/* ===== INTERFACE PAGE STYLES ===== */
.interface-container {
    min-height: 100vh;
    padding: 10px 10px 20px;/* Extra bottom padding for content */
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 9px; /* Space between mode selector and content */
    overflow-x: hidden;
}

/* Mode Selector - Ultra Modern Contextual Tabs */
.mode-selector {
    display: flex;
    justify-content: center;
    padding: 0 10px;
    margin-bottom: -2px; /* Connect tabs to content */
    position: relative;
    z-index: 1; /* Lower layer */
    width: 100%;
}

.mode-tabs {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 420px;
    z-index: 1; /* Lower layer */
}

.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 20px;
    border: none;
    border-radius: 16px 16px 0 0; /* Rounded top only */
    background: rgba(230, 230, 230, 0.80);
    color: rgba(55, 55, 55, 0.65);
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop: larger mode tabs */
@media (min-width: 1024px) {
    .mode-tabs {
        max-width: 500px;
        gap: 10px;
    }

    .mode-tab {
        padding: 18px 24px;
        font-size: 19px;
        gap: 10px;
    }
}

@media (min-width: 1600px) {
    .mode-tabs {
        max-width: 550px;
        gap: 12px;
    }

    .mode-tab {
        padding: 20px 28px;
        font-size: 20px;
    }
    position: relative;
    backdrop-filter: blur(8px);
    border-bottom: 2px solid transparent;
}

/* Tab hover state */
.mode-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
}

/* Active tab - connected to content */
.mode-tab.active {
    background: rgba(255, 255, 255, 0.95);
    color: var(--brand-primary);
    box-shadow:
        0 -4px 12px rgba(0, 0, 0, 0.08),
        0 2px 0 0 rgba(255, 255, 255, 0.95); /* Extended bottom to connect */
    transform: translateY(2px); /* Move down to connect */
    border-bottom: none;
}

/* Accent line on active tab */
.mode-tab.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
    border-radius: 16px 16px 0 0;
}

.mode-tab i {
    font-size: 24px;
    transition: all 0.3s ease;
    color: var(--brand-primary) !important;
    transparency: 0.65;
}

.mode-tab.active i {
    color: var(--brand-primary);
    transform: scale(1.1);
}

.mode-tab:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: -2px;
}

/* Tab Content Wrapper - Light background connected to tabs */
.tab-content-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 5px 5px 20px 20px;
    padding: 16px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.1),
        0 -2px 0 rgba(255, 255, 255, 0.95); /* Connect to active tab */
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 2; /* Above tabs */
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Advanced mode needs full width for grid layout */
.tab-content-wrapper.advanced-mode {
    max-width: 100%;
}

/* Remove legacy mode button styles */
.mode-btn,
.mode-btn:hover,
.mode-btn:active,
.mode-btn.active {
    all: unset;
}

/* Main Image Frame - Inside content wrapper */
.main-frame {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    padding: 0;
}

.image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    border-radius: 12px;
    background: #f5f5f5;
}

.main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.image-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 2, 64, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Thumbnail Gallery - Light refined style */
.thumbnail-gallery {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
}

.thumbnail-gallery::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-gallery::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.thumbnail-gallery::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.thumbnail-gallery::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.thumbnail-item {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(0, 0, 0, 0.1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-item:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.2);
}

.thumbnail-item:active {
    transform: scale(1.1);
}

.thumbnail-item.active {
    border-color: var(--brand-accent);
    border-width: 3px;
    box-shadow:
        0 4px 12px rgba(237, 214, 36, 0.3),
        0 0 0 1px var(--brand-accent);
    transform: scale(1.2);
}

/* Disabled thumbnail state - white with light gray border */
.thumbnail-item.disabled {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

.thumbnail-item.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #e0e0e0;
}

.thumbnail-item.disabled img {
    display: none;
}

/* Room Type Buttons - Light refined style */
.room-type-buttons {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
}

.room-btn {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(0, 0, 0, 0.1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.room-btn .room-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.room-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.2);
}

.room-btn:active {
    transform: scale(1.1);
}

.room-btn.selected {
    border-color: var(--brand-accent);
    border-width: 3px;
    box-shadow:
        0 4px 12px rgba(30, 58, 138, 0.3),
        0 0 0 1px var(--brand-accent);
    transform: scale(1.04);
}

/* Picture Type Selector - matches Generation Mode design */
.picture-type-selector-row {
    display: flex;
    gap: 8px;
}

.picture-type-selector-row .mode-select {
    flex: 1;
}

/* Image Input Buttons */
.image-input-buttons {
    display: flex;
    gap: 12px;
    padding: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-image-input {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    padding: 14px 20px;
    background: #b3d9ff; /* Light blue background */
    color: var(--brand-text); /* Dark blue color for text and icon */
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
}

.btn-image-input:hover {
    background: #99ccff; /* Slightly darker light blue on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-image-input:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.btn-image-input i {
    font-size: 18px;
    color: var(--brand-text); /* Dark blue icon */
}

/* Magic Action Button */
.action-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.btn-magic {
    width: 100%;
    max-width: 400px;
    padding: 18px 40px;
    background: var(--brand-accent);
    color: var(--brand-text);
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.btn-magic:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(30, 58, 138, 0.5);
}

.btn-magic:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.4);
}

.btn-magic i {
    font-size: 22px;
    filter: drop-shadow(0 0 8px rgba(237, 214, 36, 0.6));
}

.btn-magic-text {
    position: relative;
    z-index: 1;
}

/* RTL Support for Interface */
[dir="rtl"] .mode-tabs {
    flex-direction: row;
}

/* Responsive Design - Mobile First (Smartphones) */
@media (max-width: 480px) {
    .interface-container {
        padding: 8px 10px 20px;
        gap: 0; /* No gap, tabs connect to content */
    }

    .mode-selector {
        padding: 0 8px;
        margin-bottom: 0; /* Direct connection */
    }

    .mode-tabs {
        gap: 6px;
        max-width: 100%;
    }

    .mode-tab {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 14px 14px 0 0;
    }

    .mode-tab i {
        font-size: 22px;
    }

    /* Active tab connection on mobile */
    .mode-tab.active {
        transform: translateY(2px);
    }

    .tab-content-wrapper {
        border-radius: 5px 5px 16px 16px;
        padding: 12px;
        gap: 12px;
    }

    .main-frame {
        border-radius: 10px;
    }

    .image-wrapper {
        border-radius: 10px;
    }

    .thumbnail-gallery {
        padding: 8px;
        gap: 8px;
    }

    .thumbnail-item {
        width: 70px;
        height: 70px;
        border-width: 2px;
    }

    .image-input-buttons {
        padding: 6px;
        gap: 8px;
    }

    .btn-image-input {
        min-width: 120px;
        padding: 12px 16px;
        font-size: 14px;
        gap: 8px;
    }

    .btn-image-input i {
        font-size: 16px;
    }

    .room-type-buttons {
        padding: 8px;
        gap: 8px;
    }

    .room-btn {
        width: 70px;
        height: 70px;
        border-width: 2px;
    }

    .btn-magic {
        padding: 16px 32px;
        font-size: 16px;
    }

    .btn-magic i {
        font-size: 20px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .interface-container {
        padding: 10px 8px 20px;
        gap: 0;
    }

    .mode-selector {
        margin-bottom: 0;
    }

    .tab-content-wrapper {
        border-radius: 0 0 18px 18px;
        padding: 14px;
        gap: 14px;
    }

    .thumbnail-gallery {
        padding: 10px;
    }

    .thumbnail-item {
        width: 85px;
        height: 85px;
    }

    .image-input-buttons {
        padding: 8px;
        gap: 10px;
    }

    .btn-image-input {
        min-width: 150px;
        padding: 13px 18px;
    }

    .room-type-buttons {
        padding: 10px;
    }

    .room-btn {
        width: 70px;
        height: 70px;
    }
}

@media (min-width: 769px) {
    .interface-container {
        padding: 10px 10px 20px;
        gap: 0;
    }

    .mode-selector {
        margin-bottom: 0;
    }

    .mode-tabs {
        gap: 18px;
        max-width: 600px;
    }

    .mode-tab {
        padding: 22px 36px;
        font-size: 22px;
        border-radius: 22px 22px 0 0;
        box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    }

    .mode-tab.active {
        box-shadow: 0 8px 32px rgba(0,0,0,0.16);
    }

    .tab-content-wrapper {
        border-radius: 5px 5px 24px 24px;
        padding: 18px;
        gap: 5px;
    }

    .main-frame {
        border-radius: 14px;
    }

    .image-wrapper {
        border-radius: 14px;
    }

    /* Fast mode: adjust layout for 60% height main image on large screens */
    .tab-content-wrapper:not(.advanced-mode) .image-wrapper {
        padding-bottom: 0;
        height: 50vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tab-content-wrapper:not(.advanced-mode) .main-image {
        position: static;
        height: 100%;
        width: auto;
        max-width: 80%;
        object-fit: contain;
    }

    .thumbnail-gallery {
        padding: 12px;
        gap: 12px;
        justify-content: center;
    }

    .thumbnail-item {
        width: 86px;
        height: 86px;
        border-radius: 12px;
    }

    .room-type-buttons {
        padding: 12px;
        gap: 8px;
        overflow-y: hidden;
    }

    .room-btn {
        width: 86px;
        height: 86px;
        border-radius: 12px;
    }

    /* Center content if it fits, align left if it overflows */
    .room-type-buttons .room-btn:first-child {
        margin-left: auto;
    }

    .room-type-buttons .room-btn:last-child {
        margin-right: auto;
    }

    .btn-magic {
        padding: 15px 30px;
        font-size: 19px;
    }

    .btn-magic i {
        font-size: 24px;
    }
}

@media (min-width: 1001px) {
    .interface-container {
        padding: 10px 20px 20px;
        gap: 0px;
        max-width: 100%;
    }
}

/* Mode content container - ensure centering */
#mode-content {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    will-change: contents;
}

/* Animation for mode button transition */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.mode-tab.active i {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   ADVANCED MODE STYLES
   ============================================ */

.advanced-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
    min-height: calc(100vh - 80px);
    width: 100%;
}

/* Advanced mode wrapper */
.advanced-mode {
    width: 100%;
    max-width: 100%;
}

.advanced-mode .advanced-layout {
    width: 100%;
}

/* Left Panel (Image area) */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Right Panel (Options area) */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Column Styles */
.options-column-1,
.options-column-2,
.options-column-3 {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Desktop: add scroll behavior */
@media (min-width: 1024px) {
    .options-column-1,
    .options-column-2,
    .options-column-3 {
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--brand-accent) #f0f0f0;
    }

    .options-column-1::-webkit-scrollbar,
    .options-column-2::-webkit-scrollbar,
    .options-column-3::-webkit-scrollbar {
        width: 6px;
    }

    .options-column-1::-webkit-scrollbar-track,
    .options-column-2::-webkit-scrollbar-track,
    .options-column-3::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }

    .options-column-1::-webkit-scrollbar-thumb,
    .options-column-2::-webkit-scrollbar-thumb,
    .options-column-3::-webkit-scrollbar-thumb {
        background: var(--brand-accent);
        border-radius: 3px;
    }
}

/* Legacy sidebar styles for backward compatibility */
.advanced-sidebar,
.settings-panel {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Desktop: add scroll behavior */
@media (min-width: 1024px) {
    .advanced-sidebar,
    .settings-panel {
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--brand-accent) #f0f0f0;
    }

    .advanced-sidebar::-webkit-scrollbar,
    .settings-panel::-webkit-scrollbar {
        width: 6px;
    }

    .advanced-sidebar::-webkit-scrollbar-track,
    .settings-panel::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }

    .advanced-sidebar::-webkit-scrollbar-thumb,
    .settings-panel::-webkit-scrollbar-thumb {
        background: var(--brand-accent);
        border-radius: 3px;
    }
}

.control-section {
    margin-bottom: 20px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-accent);
}

.section-title i {
    color: var(--brand-accent);
    font-size: 16px;
}

/* Column-specific adjustments for large screens */
@media (min-width: 1280px) {
    /* Column 2: Style Library - Full height */
    .options-column-2 .style-grid {
        max-height: calc(100vh - 250px);
    }

    /* Column 3: Transform button styling */
    .options-column-3 .action-container {
        margin-top: auto;
    }

    .options-column-3 .btn-magic.advanced {
        width: 100%;
        max-width: none;
    }

    /* Hide column 2 when not needed (Remove All Furniture or Custom Prompt modes) */
    .right-panel.hide-style-library {
        grid-template-columns: 1fr 1fr;
    }

    .right-panel.hide-style-library .options-column-2 {
        display: none;
    }
}

/* Style Grid */
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-accent) #f0f0f0;
}

.style-grid::-webkit-scrollbar {
    width: 6px;
}

.style-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.style-grid::-webkit-scrollbar-thumb {
    background: var(--brand-accent);
    border-radius: 3px;
}

.style-card {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    touch-action: manipulation; /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent;
    min-height: 80px;
}

.style-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.style-card:active {
    transform: translateY(0);
}

.style-card.selected {
    border-color: var(--brand-accent);
    background: #fffef0;
}

.style-image {
    width: 100%;
    height: 100px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .style-image {
        height: 120px;
    }
}

@media (min-width: 1024px) {
    .style-image {
        height: 130px;
    }
}

@media (min-width: 1600px) {
    .style-image {
        height: 140px;
    }

    .style-card {
        min-height: 90px;
    }

    .style-info h4 {
        font-size: 15px;
    }

    .style-info p {
        font-size: 12px;
    }
}

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

.style-info {
    padding: 12px;
}

.style-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--brand-text);
}

.style-info p {
    font-size: 11px;
    color: #666;
    margin: 0;
}

.loading-styles,
.error-message {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Budget Controls */
.budget-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
}

.budget-label {
    font-size: 12px;
    color: #666;
}

.budget-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-text);
}

.budget-slider-container {
    margin-top: 8px;
}

.budget-slider {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.budget-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--brand-accent);
    cursor: pointer;
    border-radius: 50%;
}

.budget-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--brand-accent);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.budget-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: #666;
}

/* Desktop: enhanced budget controls */
@media (min-width: 1024px) {
    .budget-display {
        padding: 12px 14px;
    }

    .budget-label {
        font-size: 13px;
    }

    .budget-value {
        font-size: 14px;
    }

    .budget-slider {
        height: 10px;
    }

    .budget-slider::-webkit-slider-thumb {
        width: 26px;
        height: 26px;
    }

    .budget-slider::-moz-range-thumb {
        width: 26px;
        height: 26px;
    }

    .budget-labels {
        font-size: 12px;
        margin-top: 8px;
    }
}

@media (min-width: 1600px) {
    .budget-display {
        padding: 14px 16px;
    }

    .budget-label {
        font-size: 14px;
    }

    .budget-value {
        font-size: 15px;
    }
}

/* Custom Prompt */
.custom-prompt-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
    min-height: 80px;
}

.custom-prompt-input:focus {
    outline: none;
    border-color: var(--brand-accent);
}

/* Desktop: larger custom prompt */
@media (min-width: 1024px) {
    .custom-prompt-input {
        min-height: 120px;
        padding: 12px;
        font-size: 15px;
    }
}

@media (min-width: 1600px) {
    .custom-prompt-input {
        min-height: 150px;
        padding: 14px;
    }
}

/* Prompt suggestions */
.prompt-suggestions {
    margin-top: 8px;
}

.prompt-suggestions small {
    font-size: 11px;
    color: #666;
    display: block;
    margin-bottom: 6px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.chip:hover {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: var(--brand-text);
}

.chip:active {
    transform: scale(0.95);
}

/* Canvas Area */
.canvas-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    order: -1; /* Always first on mobile */
}

.main-frame.advanced {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio - maintains height on medium screens */
    overflow: hidden;
    border-radius: 12px;
    background: #f5f5f5;
    user-select: none; /* Prevent image selection on touch */
    -webkit-user-drag: none;
}

.image-wrapper .main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none; /* Enable full canvas interaction */
}

.image-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Canvas Tools */
.canvas-tools {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 6px;
    background: white;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 5;
    touch-action: manipulation; /* Prevent double-tap zoom */
}

.tool-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--brand-text);
    transition: all 0.2s;
    touch-action: manipulation; /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.tool-btn:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

.tool-btn.active {
    background: var(--brand-accent);
    color: var(--brand-text);
}

/* Thumbnail Gallery Advanced */
.thumbnail-gallery.advanced {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(255, 255, 255, 0.3);
}

.thumbnail-gallery.advanced::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-gallery.advanced::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.thumbnail-gallery.advanced::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.thumbnail-gallery.advanced::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.thumbnail-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation; /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent;
}

.thumbnail-item:not(.placeholder):hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.thumbnail-item:not(.placeholder):active {
    transform: scale(0.98);
}

.thumbnail-item.active {
    border-color: var(--brand-accent);
}

.thumbnail-item.placeholder {
    cursor: default;
    opacity: 0.3;
}

.thumbnail-item.placeholder i {
    font-size: 24px;
    color: #999;
}

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

/* Settings Panel */
.setting-item {
    margin-bottom: 18px;
}

.setting-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--brand-text);
}

.setting-value {
    color: var(--brand-accent);
    font-weight: 600;
}

.setting-item input[type="range"] {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: var(--brand-accent);
    cursor: pointer;
    border-radius: 50%;
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: var(--brand-accent);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* Desktop: enhanced settings */
@media (min-width: 1024px) {
    .setting-item {
        margin-bottom: 22px;
    }

    .setting-item label {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .setting-item input[type="range"] {
        height: 10px;
    }

    .setting-item input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    .setting-item input[type="range"]::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
}

@media (min-width: 1600px) {
    .setting-item {
        margin-bottom: 26px;
    }

    .setting-item label {
        font-size: 15px;
    }

    .setting-item input[type="range"]::-webkit-slider-thumb {
        width: 26px;
        height: 26px;
    }

    .setting-item input[type="range"]::-moz-range-thumb {
        width: 26px;
        height: 26px;
    }
}

/* Style Info Display */
.style-info-display {
    font-size: 13px;
    color: #666;
}

.style-detail h4 {
    font-size: 16px;
    color: var(--brand-text);
    margin-bottom: 4px;
}

.style-subtitle {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.style-description {
    margin: 15px 0;
}

.style-description strong {
    display: block;
    margin-bottom: 6px;
    color: var(--brand-text);
}

.style-description p {
    line-height: 1.5;
    margin: 0;
}

.color-palette {
    margin-top: 15px;
}

.color-palette strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
}

.color-swatches {
    display: flex;
    gap: 8px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-text);
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.action-btn:hover {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    transform: translateX(4px);
}

.action-btn:active {
    transform: translateX(2px);
}

.action-btn i {
    font-size: 16px;
}

/* Tablet and up: side-by-side layout for quick actions */
@media (min-width: 768px) {
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .image-input-buttons {
        max-width: 750px;
        margin: 0 auto;
    }

    .room-type-buttons {
        max-width: 750px;
        margin: 0 auto;
    }

    /* Ensure safe centering (scrollable if overflow) */
    .room-type-buttons .room-btn:first-child {
        margin-left: auto;
    }

    .room-type-buttons .room-btn:last-child {
        margin-right: auto;
    }
}

/* Desktop optimizations */
@media (min-width: 1024px) {
    .image-input-buttons {
        max-width: 500px;
        gap: 16px;
    }

    .btn-image-input {
        min-width: 160px;
        padding: 16px 24px;
        font-size: 16px;
    }

    .btn-image-input i {
        font-size: 20px;
    }

    .room-type-buttons {
        max-width: 800px;
        gap: 14px;
        padding: 10px;
    }

    .room-btn {
        width: 90px;
        height: 90px;
    }


    .main-frame.advanced .image-wrapper {
        height: 100%;
        padding-bottom: 0 !important;
        aspect-ratio: unset !important;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8f9fa;
        border-radius: 8px;
        overflow: hidden;
    }
}

/* Large desktop optimizations */
@media (min-width: 1600px) {
    .image-input-buttons {
        gap: 18px;
    }

    .room-type-buttons {
        gap: 16px;
        padding: 12px;
    }

    .room-btn {
        width: 95px;
        height: 95px;
    }

    .main-frame.advanced .image-wrapper {
        height: 100%;
        padding-bottom: 0 !important;
        aspect-ratio: unset !important;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8f9fa;
        border-radius: 8px;
        overflow: hidden;
    }
}

/* Extra large desktop */
@media (min-width: 1920px) {
    .room-btn {
        width: 100px;
        height: 100px;
    }

    .btn-image-input {
        min-width: 180px;
        padding: 18px 28px;
    }
}

/* Advanced Action Button */
.action-container {
    margin-top: 12px;
}

.btn-magic.advanced {
    width: 100%;
    padding: 16px 28px;
    font-size: 15px;
    background: var(--brand-accent);
    color: var(--brand-text);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(237, 214, 36, 0.4);
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-magic.advanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 214, 36, 0.5);
}

.btn-magic.advanced:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(237, 214, 36, 0.3);
}

.btn-magic.advanced i {
    font-size: 18px;
}

/* Responsive Design - Mobile First */

/* Tablet (768px and up) */
@media (min-width: 768px) {
    .advanced-layout {
        padding: 15px;
        gap: 20px;
    }

    .advanced-sidebar,
    .settings-panel {
        padding: 20px;
    }

    .control-section {
        margin-bottom: 25px;
    }

    .section-title {
        font-size: 16px;
        margin-bottom: 15px;
        padding-bottom: 10px;
        gap: 10px;
    }

    .main-frame.advanced {
        padding: 16px;
    }

    /* Ensure image-wrapper is visible on tablet screens */
    .main-frame.advanced .image-wrapper {
        min-height: 300px; /* Minimum height for visibility */
    }

    .canvas-area {
        gap: 15px;
    }

    .canvas-tools {
        top: 20px;
        right: 20px;
        padding: 8px;
        gap: 8px;
    }

    .tool-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .canvas-area {
        gap: 15px;
    }

    .thumbnail-gallery.advanced {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        grid-auto-rows: 90px;
        gap: 10px;
        padding: 15px;
        max-height: 210px;
    }

    .style-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }

    .btn-magic.advanced {
        max-width: 500px;
        margin: 0 auto;
        padding: 18px 32px;
        font-size: 16px;
        gap: 12px;
    }

    .btn-magic.advanced i {
        font-size: 20px;
    }
}

/* Desktop Small (1024px and up) - Stacked columns preparation */
@media (min-width: 1024px) {
    .advanced-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 20px;
        max-height: calc(100vh - 80px);
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
    }

    .left-panel {
        order: 1;
    }

    .right-panel {
        order: 2;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .options-column-1,
    .options-column-2,
    .options-column-3 {
        padding: 20px;
        max-height: 600px;
    }

    .style-grid {
        grid-template-columns: 1fr;
        max-height: 300px;
    }

    .canvas-tools {
        padding: 10px;
        gap: 10px;
    }

    .tool-btn {
        width: 44px;
        height: 44px;
        font-size: 17px;
    }
}

/* Desktop Medium (1280px and up) - Left-Right split with 3 columns on right */
@media (min-width: 1280px) {
    .advanced-layout {
        display: flex;
        flex-direction: row;
        gap: 24px;
        padding: 24px;
        width: 100%;
        max-width: 1800px;
        margin: 0 auto;
        max-height: calc(100vh - 80px);
    }

    /* Left Panel: 40% width */
    .left-panel {
        flex: 0 0 40%;
        display: flex;
        flex-direction: column;
        gap: 15px;
        overflow-y: auto;
    }

    /* Right Panel: 60% width with 3 columns */
    .right-panel {
        flex: 0 0 60%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        overflow-y: auto;
    }

    .options-column-1,
    .options-column-2,
    .options-column-3 {
        padding: 20px;
        max-height: calc(100vh - 120px);
    }

    .main-frame.advanced {
        padding: 20px;
    }

    .style-grid {
        grid-template-columns: 1fr;
        max-height: 500px;
    }

    .control-section {
        margin-bottom: 24px;
    }
}

/* Desktop Large (1600px and up) - Enhanced left-right layout */
@media (min-width: 1600px) {
    .advanced-layout {
        gap: 28px;
        padding: 28px;
        max-width: 2000px;
    }

    .right-panel {
        gap: 24px;
    }

    .options-column-1,
    .options-column-2,
    .options-column-3 {
        padding: 24px;
    }

    .style-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-height: 600px;
    }

    .control-section {
        margin-bottom: 28px;
    }

    .section-title {
        font-size: 17px;
    }

    .main-frame.advanced {
        padding: 24px;
    }

    .thumbnail-gallery.advanced {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        grid-auto-rows: 100px;
        gap: 12px;
        padding: 16px;
        max-height: 230px;
    }

    .canvas-tools {
        padding: 12px;
        gap: 12px;
        border-radius: 10px;
    }

    .tool-btn {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
}

/* Desktop Extra Large (1920px and up) - Optimized left-right layout */
@media (min-width: 1920px) {
    .advanced-layout {
        gap: 32px;
        padding: 32px;
        max-width: 2200px;
    }

    .right-panel {
        gap: 28px;
    }

    .style-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        max-height: 700px;
    }

    .options-column-1,
    .options-column-2,
    .options-column-3 {
        padding: 28px;
    }

    .control-section {
        margin-bottom: 32px;
    }

    .main-frame.advanced {
        padding: 28px;
    }

    .section-title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .thumbnail-gallery.advanced {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        grid-auto-rows: 110px;
        padding: 20px;
        gap: 14px;
        max-height: 260px;
    }

    .canvas-tools {
        padding: 14px;
        gap: 14px;
    }

    .tool-btn {
        width: 48px;
        height: 48px;
        font-size: 19px;
    }

    .btn-magic.advanced {
        max-width: 600px;
        padding: 20px 36px;
        font-size: 17px;
    }

    .btn-magic.advanced i {
        font-size: 22px;
    }
}

/* Extra small screens optimization */
@media (max-width: 380px) {
    .advanced-layout {
        padding: 8px;
        gap: 12px;
    }

    .main-frame.advanced {
        padding: 8px;
    }

    .canvas-tools {
        top: 10px;
        right: 10px;
        gap: 4px;
        padding: 4px;
    }

    .tool-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .thumbnail-gallery.advanced {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 8px;
    }

    .section-title {
        font-size: 14px;
    }

    .btn-magic.advanced {
        padding: 14px 24px;
        font-size: 14px;
    }

    .style-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
}

/* Key Features Display */
.key-features-display {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    min-height: 80px;
}

.key-features-display .feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-features-display .feature-list li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--brand-text);
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    padding-left: 20px;
}

.key-features-display .feature-list li:last-child {
    border-bottom: none;
}

.key-features-display .feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--brand-accent);
    font-weight: bold;
}

.key-features-display .text-muted {
    color: #666;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

/* Color Palette Display */
.color-palette-display {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    min-height: 80px;
}

.color-palette-display .color-swatches {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-swatch-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-swatch-wrapper .color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    flex-shrink: 0;
}

.color-swatch-wrapper .color-hex {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #666;
    font-weight: 500;
}

.color-palette-display .text-muted {
    color: #666;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

/* Modal Overlay Styles */
.modal-overlay {
    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;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Image Info Content */
.image-info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row strong {
    color: #333;
    font-weight: 600;
    margin-right: 8px;
}

.info-row em {
    color: #666;
    font-style: italic;
    display: block;
    margin-top: 6px;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Confirm Dialog Styles */
.confirm-dialog {
    max-width: 450px;
}

.confirm-dialog .modal-body p {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.btn-cancel, .btn-confirm {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-confirm {
    background: #f44336;
    color: white;
}

.btn-confirm:hover {
    background: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* Result Popup Styles */
.result-popup-overlay {
    z-index: 10000;
}

.result-popup-content {
    max-width: 900px;
    width: 90%;
}

.result-popup-content .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.result-popup-content .modal-header h3 {
    color: white;
    margin: 0;
}

.result-popup-content .btn-close-modal {
    color: white;
    opacity: 0.9;
}

.result-popup-content .btn-close-modal:hover {
    opacity: 1;
    color: white;
}

.result-popup-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.result-popup-item {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.result-popup-item .result-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-popup-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.result-popup-image:hover {
    transform: scale(1.02);
}

.result-popup-arrow {
    font-size: 32px;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-popup-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    border-top: 2px solid #f0f0f0;
}

.result-popup-actions .btn {
    min-width: 150px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}

.result-popup-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.result-popup-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.result-popup-actions .btn-secondary {
    background: #f0f0f0;
    border: none;
    color: #333;
}

.result-popup-actions .btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Share Options Styles */
.share-options-content {
    max-width: 500px;
    width: 90%;
}

.share-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
}

.share-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.share-option i {
    font-size: 24px;
}

.share-option span {
    font-size: 13px;
}

.share-note {
    padding: 12px;
    background: #fff3cd;
    border-radius: 8px;
    color: #856404;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.share-note i {
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .result-popup-comparison {
        flex-direction: column;
        gap: 15px;
    }

    .result-popup-arrow {
        transform: rotate(90deg);
    }

    .result-popup-actions {
        flex-direction: column;
    }

    .result-popup-actions .btn {
        width: 100%;
    }

    .share-options-grid {
        grid-template-columns: 1fr;
    }
}

/* Toast Notification Styles */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.toast.toast-success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.toast.toast-error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.toast.toast-info {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

/* Cookie Consent Overlay */
body.cookie-consent-pending::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    pointer-events: all;
}

body.cookie-consent-pending > *:not(#cookie-consent) {
    pointer-events: none;
    opacity: 0.4;
    filter: blur(2px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Cookie Consent Popup */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(0, 0, 0, 0.1) 100%);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-content {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 -4px 32px rgba(1, 2, 64, 0.15);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 2px solid var(--brand-accent);
}

.cookie-icon {
    font-size: 48px;
    color: var(--brand-accent);
    flex-shrink: 0;
    animation: bounce 2s ease-in-out infinite;
}

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

.cookie-text {
    flex: 1;
    min-width: 0;
}

.cookie-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-text);
    margin: 0 0 8px 0;
}

.cookie-message {
    font-size: 14px;
    color: var(--brand-text);
    opacity: 0.9;
    margin: 0;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.btn-cookie {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-cookie-essential {
    background: transparent;
    color: var(--brand-text);
    border: 2px solid var(--brand-text);
}

.btn-cookie-essential:hover {
    background: rgba(1, 2, 64, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 2, 64, 0.1);
}

.btn-cookie-accept {
    background: var(--brand-accent);
    color: var(--brand-text);
    box-shadow: 0 4px 16px rgba(237, 214, 36, 0.3);
}

.btn-cookie-accept:hover {
    background: #d4c021;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 214, 36, 0.4);
}

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

/* Responsive Design for Cookie Popup */
@media (max-width: 768px) {
    .cookie-consent {
        padding: 12px;
    }

    .cookie-consent-content {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        text-align: center;
    }

    .cookie-icon {
        font-size: 40px;
    }

    .cookie-title {
        font-size: 18px;
    }

    .cookie-message {
        font-size: 13px;
    }

    .cookie-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-cookie {
        width: 100%;
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    .cookie-consent-content {
        padding: 16px;
        border-radius: 12px;
    }

    .cookie-icon {
        font-size: 36px;
    }

    .cookie-title {
        font-size: 16px;
    }

    .cookie-message {
        font-size: 12px;
    }

    .btn-cookie {
        padding: 12px 16px;
        font-size: 14px;
    }
}

