/* ============================================
   AI ??閬?撌乩???- ?梁璅??蝟餌絞
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+JP:wght@400;700&display=swap');


/* --- CSS Variables --- */
:root {
    /* Colors - Red-Gold Japanese Theme */
    --color-primary-red: #c41e3a;
    --color-primary-dark-red: #8b0000;
    --color-gold: #ffd700;
    --color-sakura-pink: #ffb7c5;

    --color-primary: var(--color-primary-red);
    --color-primary-light: #fff5f5;
    --color-primary-dark: var(--color-primary-dark-red);

    --color-stone-50: #fafaf9;
    --color-stone-100: #f5f5f4;
    --color-stone-200: #e7e5e4;
    --color-stone-300: #d6d3d1;
    --color-stone-400: #a8a29e;
    --color-stone-500: #78716c;
    --color-stone-600: #57534e;
    --color-stone-700: #44403c;
    --color-stone-800: #292524;
    --color-stone-900: #1c1917;

    --color-success: #22c55e;
    --color-warning: #eab308;
    --color-error: #ef4444;
    --color-info: #3b82f6;

    --color-accent: #f59e0b;
    --color-accent-light: #fef3c7;
    --color-accent-dark: #d97706;
    /* Typography */
    --font-serif: 'Noto Serif JP', serif;
    --font-sans: 'Noto Sans TC', sans-serif;
    --font-family: var(--font-sans);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* --- Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--color-stone-800);
    line-height: 1.5;
    background: linear-gradient(135deg, #fdf6f0 0%, #fff5f5 50%, #f0f4ff 100%);
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '🌸';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23ffb7c5' opacity='0.08' d='M50 0c5 25 25 45 50 50-25 5-45 25-50 50-5-25-25-45-50-50 25-5 45-25 50-50z'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23ffc0cb' opacity='0.05' d='M50 0c5 25 25 45 50 50-25 5-45 25-50 50-5-25-25-45-50-50 25-5 45-25 50-50z'/%3E%3C/svg%3E");
    background-size: 80px 80px, 120px 120px;
    background-position: 0 0, 60px 60px;
    pointer-events: none;
    z-index: 0;
    animation: float-bg 20s ease-in-out infinite;
}

@keyframes float-bg {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

.sakura {
    position: fixed;
    top: -50px;
    left: 0;
    pointer-events: none;
    z-index: 1000;
    animation-name: sakuraFall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

h1,
h2,
h3,
.font-serif {
    font-family: var(--font-serif);
}

.card-header {
    background: var(--color-primary-red);
    /* background: linear-gradient(180deg, var(--color-primary-red) 0%, var(--color-primary-dark-red) 100%); */
    border-bottom: 2px solid var(--color-gold);
    padding: var(--spacing-lg);
    color: white;
}

.card-header h3 {
    color: inherit;
    margin: 0;
}

.card-header p {
    color: inherit;
    opacity: 0.9;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-red) 0%, var(--color-primary-dark-red) 100%);
    color: white;
}

.sakura::before {
    /* content: '🌸'; */
    font-size: 1rem;
}

/* 移除寫死的 nth-child，改由 JS 全權控制隨機性 */

@keyframes sakuraFall {
    0% {
        transform: translateY(-10vh) rotate(0deg) translateX(0px);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(105vh) rotate(720deg) translateX(100px);
        opacity: 0;
    }
}

/* --- Quick Nav Bar --- */
.quick-nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-stone-200);
    padding: 0.5rem 0;
    position: sticky;
    top: 4rem;
    z-index: 45;
}

.quick-nav-links {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0 1rem;
    scrollbar-width: none;
}

.quick-nav-links::-webkit-scrollbar {
    display: none;
}

.quick-nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    color: var(--color-stone-600);
    background: var(--color-stone-100);
    border-radius: var(--radius-full);
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
}

.quick-nav-link:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.quick-nav-link.active {
    background: var(--color-primary);
    color: white;
}

/* --- Page-Specific Backgrounds --- */
.page-phase1 {
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 183, 197, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 218, 185, 0.15) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L30 60M0 30L60 30' stroke='%23e7e5e4' stroke-width='0.5' fill='none' opacity='0.3'/%3E%3C/svg%3E");
}

.page-phase2 {
    background-image:
        radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 20% 90%, rgba(147, 197, 253, 0.15) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='20' cy='20' r='1' fill='%23cbd5e1' opacity='0.4'/%3E%3C/svg%3E");
}

.page-phase3 {
    background-image:
        radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(253, 224, 71, 0.1) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L30 60M0 30L60 30' stroke='%23e7e5e4' stroke-width='0.5' fill='none' opacity='0.3'/%3E%3C/svg%3E");
}

.page-phase4 {
    background-image:
        radial-gradient(circle at 0% 50%, rgba(245, 158, 11, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 100% 50%, rgba(252, 211, 77, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(254, 243, 199, 0.3) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 40 Q20 35 40 40 T80 40' stroke='%23fcd34d' stroke-width='0.5' fill='none' opacity='0.3'/%3E%3C/svg%3E");
}

.page-phase5 {
    background-image:
        radial-gradient(circle at 90% 20%, rgba(34, 197, 94, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 10% 80%, rgba(134, 239, 172, 0.12) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='2' fill='%2386efac' opacity='0.2'/%3E%3C/svg%3E");
}

.page-phase6 {
    background-image:
        radial-gradient(circle at 20% 30%, rgba(190, 18, 60, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(251, 113, 133, 0.1) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L30 60M0 30L60 30' stroke='%23fecdd3' stroke-width='0.5' fill='none' opacity='0.4'/%3E%3C/svg%3E");
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-stone-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-stone-300);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-stone-400);
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

/* --- Layout Components --- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* --- Navbar --- */
.navbar {
    background: white;
    border-bottom: 1px solid var(--color-stone-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand h1 {
    font-size: 1.25rem;
    color: var(--color-stone-800);
}

.navbar-brand .badge {
    font-size: 0.75rem;
    background: var(--color-primary-light);
    color: var(--color-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
}

.navbar-links {
    display: flex;
    gap: 0.5rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--color-stone-800);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-stone-900);
}

.btn-outline {
    background: white;
    color: var(--color-stone-600);
    border: 1px solid var(--color-stone-300);
}

.btn-outline:hover:not(:disabled) {
    background: var(--color-stone-50);
}

.btn-accent {
    background: var(--color-accent);
    color: white;
}

.btn-accent:hover:not(:disabled) {
    background: #d97706;
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-blue {
    background: var(--color-info);
    color: white;
}

.btn-blue:hover:not(:disabled) {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-full {
    width: 100%;
}

/* --- Cards --- */
.card {
    background: #ffffff !important;
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--color-stone-200);
    background: var(--color-stone-50);
}

/* Phase Card */
.phase-card {
    position: relative;
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    background: white;
    border: 2px solid var(--color-stone-200);
    transition: all 0.3s ease;
    cursor: pointer;
}

.phase-card:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.phase-card.active {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, #fff1f2 0%, white 100%);
}

.phase-card.completed {
    border-color: var(--color-success);
}

.phase-card .phase-number {
    position: absolute;
    top: -0.75rem;
    left: 1rem;
    background: var(--color-primary);
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.phase-card.completed .phase-number {
    background: var(--color-success);
}

/* --- Phase Card Themes --- */
#phase-card-1 {
    border-color: #0ea5e9;
    background: linear-gradient(135deg, #f0f9ff 0%, white 100%);
}

#phase-card-1 .phase-number {
    background: #0ea5e9;
}

#phase-card-2 {
    border-color: #6366f1;
    background: linear-gradient(135deg, #eef2ff 0%, white 100%);
}

#phase-card-2 .phase-number {
    background: #6366f1;
}

#phase-card-3 {
    border-color: #f43f5e;
    background: linear-gradient(135deg, #fff1f2 0%, white 100%);
}

#phase-card-3 .phase-number {
    background: #f43f5e;
}

#phase-card-4 {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, white 100%);
}

#phase-card-4 .phase-number {
    background: #f59e0b;
}

#phase-card-5 {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, white 100%);
}

#phase-card-5 .phase-number {
    background: #10b981;
}

#phase-card-6 {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, white 100%);
}

#phase-card-6 .phase-number {
    background: #8b5cf6;
}

/* --- Card Header Themes --- */
/* --- Card Header Themes --- */
/* --- Card Header Themes --- */
.card-header-amber {
    background-color: #fffbeb !important;
    background-image: none !important;
    border-bottom: 3px solid #f59e0b !important;
    color: var(--color-stone-800) !important;
}

.card-header-blue {
    background-color: #f0f9ff !important;
    background-image: none !important;
    border-bottom: 3px solid #0ea5e9 !important;
    color: var(--color-stone-800) !important;
}

.card-header-rose {
    background-color: #fef2f2 !important;
    background-image: none !important;
    border-bottom: 3px solid #f43f5e !important;
    color: var(--color-stone-800) !important;
}

.card-header-emerald {
    background-color: #f0fdf4 !important;
    background-image: none !important;
    border-bottom: 3px solid #10b981 !important;
    color: var(--color-stone-800) !important;
}

.card-header-indigo {
    background-color: #eef2ff !important;
    background-image: none !important;
    border-bottom: 3px solid #6366f1 !important;
    color: var(--color-stone-800) !important;
}

.card-header-primary-light {
    background-color: #fef2f2 !important;
    background-image: linear-gradient(135deg, #fff1f2 0%, #fef2f2 100%) !important;
    border-bottom: 3px solid var(--color-primary) !important;
    color: var(--color-stone-800) !important;
}

/* --- Forms --- */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-stone-500);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--color-stone-300);
    border-radius: var(--radius-md);
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* --- Prompt Box --- */
.prompt-box {
    background: #ffffff;
    border: 2px solid var(--color-stone-200);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    position: relative;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.03);
}

.prompt-box .prompt-label {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--color-stone-400);
    text-transform: uppercase;
}

.prompt-box textarea {
    width: 100%;
    min-height: 200px;
    background: transparent;
    border: none;
    resize: none;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    color: var(--color-stone-700);
    padding-top: 1.5rem;
}

.prompt-box textarea:focus {
    outline: none;
}

/* --- Alert Boxes --- */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
}

.alert-info {
    background: #f8faff;
    border: 1px solid #bfdbfe;
    border-left: 6px solid var(--color-info);
    color: #1e40af;
    font-weight: 500;
}

/* Prompt Details Collapsible */
.prompt-details summary {
    list-style: none;
    /* Hide default arrow */
    cursor: pointer;
}

.prompt-details summary::-webkit-details-marker {
    display: none;
    /* Hide default arrow for Safari */
}

.prompt-details[open] .details-icon {
    transform: rotate(180deg);
}

.details-icon {
    transition: transform 0.3s ease;
    font-size: 0.75rem;
}

.alert-success {
    background: #dcfce7;
    border-left: 4px solid var(--color-success);
    color: #166534;
}

.alert-warning {
    background: #fef3c7;
    border-left: 4px solid var(--color-warning);
    color: #92400e;
}

.alert-error {
    background: #fee2e2;
    border-left: 4px solid var(--color-error);
    color: #991b1b;
}

/* --- Tool Card --- */
.tool-card {
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    background: white;
    transition: box-shadow 0.3s ease;
}

.tool-card:hover {
    box-shadow: var(--shadow-md);
}

.tool-card .tool-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.tool-card .tool-title {
    font-weight: 700;
    color: var(--color-stone-700);
}

.tool-card .tool-desc {
    font-size: 0.75rem;
    color: var(--color-stone-500);
    margin-top: 0.25rem;
}

.tool-card .tool-prompt {
    background: var(--color-stone-100);
    border: 1px solid var(--color-stone-200);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--color-stone-600);
    margin: 0.75rem 0;
    white-space: pre-line;
    /* Collapses extra spaces but keeps newlines */
}

/* --- Section Headers --- */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--color-stone-200);
}

.section-header.accent {
    border-bottom-color: var(--color-accent);
}

.section-header.primary {
    border-bottom-color: var(--color-primary);
}

/* --- Progress Indicator --- */
.progress-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.progress-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: var(--radius-full);
    background: var(--color-stone-300);
    transition: all 0.3s ease;
    cursor: pointer;
}

.progress-dot:hover {
    background: var(--color-stone-400);
    transform: scale(1.1);
}

.progress-dot:active {
    transform: scale(0.9);
}

.progress-dot.active {
    background: var(--color-primary);
    transform: scale(1.2);
}

.progress-dot.completed {
    background: var(--color-success);
}

/* --- Footer Navigation --- */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--color-stone-200);
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 40;
}

.footer-nav .nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--color-stone-600);
    background: var(--color-stone-100);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.footer-nav .nav-btn:hover {
    background: var(--color-stone-200);
}

.footer-nav .nav-btn.primary {
    background: var(--color-primary);
    color: white;
}

.footer-nav .nav-btn.primary:hover {
    background: var(--color-primary-dark);
}

/* --- Main Content Padding for Fixed Footer --- */
main {
    flex-grow: 1;
    padding-bottom: 5rem;
}

/* --- Animations --- */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner */
.spinner {
    border: 3px solid var(--color-stone-200);
    border-radius: 50%;
    border-top: 3px solid var(--color-primary);
    width: 1.25rem;
    height: 1.25rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Utility Classes --- */
.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-primary {
    color: var(--color-primary);
}

.text-stone-500 {
    color: var(--color-stone-500);
}

.text-stone-600 {
    color: var(--color-stone-600);
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 1.25rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-grow {
    flex-grow: 1;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.hidden {
    display: none;
}

.block {
    display: block;
}

/* --- Quick Links Bar --- */
.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: var(--spacing-md);
    background: var(--color-stone-100);
    border-radius: var(--radius-lg);
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--color-stone-300);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--color-stone-700);
    text-decoration: none;
    transition: all 0.2s ease;
}

.quick-link:hover {
    background: var(--color-stone-50);
    border-color: var(--color-primary-light);
}

.quick-link img {
    width: 1.25rem;
    height: 1.25rem;
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, #fff1f2 0%, white 50%, #fef3c7 100%);
    border: 1px solid var(--color-primary-light);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '🌸';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 33%;
    background: var(--color-primary-light);
    opacity: 0.2;
    transform: skewX(12deg) translateX(3rem);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 1.875rem;
    color: var(--color-stone-800);
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--color-stone-600);
    max-width: none;
}

/* --- Style Selector --- */
.style-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .style-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.style-option {
    border: 2px solid var(--color-stone-200);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.style-option:hover {
    border-color: var(--color-primary-light);
}

.style-option.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.style-option .style-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.style-option .style-name {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-stone-800);
}

.style-option .style-desc {
    font-size: 0.625rem;
    color: var(--color-stone-500);
    margin-top: 0.25rem;
}

/* --- Copy Toast --- */
.copy-toast {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: var(--color-stone-800);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
}

.copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --- Readability Enhancements --- */
.timer-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: white;
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    margin-top: 1rem;
}

.countdown.readability-fix {
    background: white !important;
    border: 2px solid var(--color-accent) !important;
    color: var(--color-stone-800) !important;
    box-shadow: var(--shadow-md);
}

.countdown.readability-fix .time {
    color: var(--color-accent) !important;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.05);
}

.countdown.readability-fix .font-bold {
    color: var(--color-stone-800);
}

.countdown.readability-fix .text-sm {
    color: var(--color-stone-500);
}

/* --- Global Contrast & Readability Fixes --- */
.card-header h3 {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Standard headers (Red/Dark) still need white text */
.card-header p,
.section-header p {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    margin-top: 0.5rem !important;
    opacity: 1 !important;
}

/* FINAL OVERRIDE for Light Themes - ensures they are NEVER white */
.card-header-amber p,
.card-header-blue p,
.card-header-rose p,
.card-header-emerald p,
.card-header-indigo p,
.card-header-primary-light p {
    color: #44403c !important;
    /* Force a dark grey */
    opacity: 1 !important;
    text-shadow: none !important;
}

.card {
    background: #ffffff !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
}

/* --- Shop.com Logo Integration --- */
.shop-logo-inline {
    height: 1.1em;
    vertical-align: middle;
    display: inline-block;
    margin: 0 0.2rem;
    margin-top: -0.15em;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.05));
    transition: transform 0.2s ease;
}

.shop-logo-inline:hover {
    transform: scale(1.05);
}


/* --- Homepage Hero Premium Theme --- */
.hero {
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3) !important;
}

.hero h2 {
    color: white !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
}

.hero p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500 !important;
}

.hero::after {
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05)) !important;
}

/* --- Shop.com Logo Legibility Fixes --- */
.shop-logo-pill {
    display: inline-flex !important;
    align-items: center !important;
    background: white !important;
    padding: 2px 10px !important;
    border-radius: 999px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    margin: 0 0.2rem !important;
    vertical-align: middle !important;
    transition: transform 0.2s ease !important;
}

.shop-logo-pill:hover {
    transform: translateY(-1px) scale(1.02) !important;
}


/* --- Polyfill for Utility Classes used in Phase 4 Section A --- */

/* Grid System */
.grid {
    display: grid;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:col-span-2 {
        grid-column: span 2 / span 2;
    }

    .md\:flex-row {
        flex-direction: row;
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lg\:col-span-2 {
        grid-column: span 2 / span 2;
    }

    .lg\:col-span-3 {
        grid-column: span 3 / span 3;
    }
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-grow {
    flex-grow: 1;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.h-full {
    height: 100%;
}

/* Background Colors (Opaque) */
.bg-white {
    background: #ffffff !important;
}

/* Slightly increased saturation for better visibility and OPAQUE background */

/* Stone (Grey) */
.bg-stone-100 {
    background: #f0f0eb !important;
}

/* Emerald (Green) */
.bg-emerald-50 {
    background: #d1fae5 !important;
}

/* Indigo (Purple) */
.bg-indigo-50 {
    background: #e0e7ff !important;
}

/* Blue */
.bg-blue-50 {
    background: #dbeafe !important;
}

/* Rose (Red) */
.bg-rose-50 {
    background: #ffe4e6 !important;
}

/* Amber (Yellow) */
.bg-amber-50 {
    background: #fef3c7 !important;
}

/* Text Colors */
.text-emerald-800 {
    color: #065f46;
}

.text-emerald-700 {
    color: #047857;
}

.text-emerald-600 {
    color: #059669;
}

.text-indigo-800 {
    color: #3730a3;
}

.text-indigo-600 {
    color: #4f46e5;
}

.text-indigo-500 {
    color: #6366f1;
}

.text-blue-800 {
    color: #1e40af;
}

.text-blue-600 {
    color: #2563eb;
}

.text-blue-500 {
    color: #3b82f6;
}

.text-rose-800 {
    color: #9f1239;
}

.text-rose-600 {
    color: #e11d48;
}

.text-rose-500 {
    color: #f43f5e;
}

.text-amber-800 {
    color: #92400e;
}

.text-amber-600 {
    color: #d97706;
}

.text-amber-500 {
    color: #f59e0b;
}

.text-stone-500 {
    color: #78716c;
}

.text-stone-600 {
    color: #57534e;
}

.text-stone-700 {
    color: #44403c;
}

.text-stone-800 {
    color: #292524;
}

/* Borders */
.border-2 {
    border-width: 2px;
}

.border {
    border-width: 1px;
    border-style: solid;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

/* Darkened border colors for better contrast */
.border-emerald-200 {
    border-color: #6ee7b7;
}

.border-indigo-200 {
    border-color: #a5b4fc;
}

.border-blue-200 {
    border-color: #93c5fd;
}

.border-rose-200 {
    border-color: #fda4af;
}

.border-amber-200 {
    border-color: #fcd34d;
}

.border-stone-200 {
    border-color: #e7e5e4;
}

.border-stone-300 {
    border-color: #d6d3d1;
}

.border-stone-100 {
    border-color: #f5f5f4;
}

.border-indigo-100 {
    border-color: #e0e7ff;
}

.border-blue-100 {
    border-color: #dbeafe;
}

.border-rose-100 {
    border-color: #ffe4e6;
}

.border-amber-100 {
    border-color: #fef3c7;
}

/* Shadows */
.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Spacing */
.p-5 {
    padding: 1.25rem;
}

.p-4 {
    padding: 1rem;
}

.p-3 {
    padding: 0.75rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.pt-6 {
    padding-top: 1.5rem;
}

.col-span-1 {
    grid-column: span 1 / span 1;
}

/* Font */
.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.font-medium {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.025em;
}

/* Hover transitions */
.transition-shadow {
    transition-property: box-shadow;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.hover\:shadow-md:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.transform {
    transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.hover\:-translate-y-1:hover {
    --tw-translate-y: -0.25rem;
    transform: translateY(-0.25rem);
}