:root {
    --otter-dark-blue: #1a2a4c;
    --otter-light-blue: #4a90e2;
    --otter-brown: #8b572a;
    --otter-bg: #f8f9fa;
}

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    h1, h2, h3, h4, h5, h6 {
        @apply text-otter-dark-blue;
    }
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--otter-bg);
}


/* --- HEADER STYLES --- */
.site-header { @apply bg-white shadow-sm sticky top-0 z-50; }
.main-nav { display: flex; align-items: center; justify-content: space-between; height: 7rem; }
.nav-logo { flex-shrink: 0; }
.nav-search { flex-grow: 1; min-width: 100px; padding: 0 2rem; }
.nav-links { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.search-container { position: relative; max-width: 42rem; margin: 0 auto; }
.search-bar { width: 100%; height: 3rem; padding-left: 3rem; padding-right: 1rem; background-color: #f1f5f9; border: 2px solid transparent; border-radius: 9999px; font-size: 0.875rem; transition: all 0.3s ease; }
.search-bar:focus { outline: none; background-color: white; border-color: var(--otter-light-blue); }
.search-icon { position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); color: #94a3b8; transition: color 0.3s ease; }
.search-bar:focus + .search-icon { color: var(--otter-light-blue); }
.dropdown { position: relative; display: inline-block; padding-bottom: 0.75rem; margin-bottom: -0.75rem; }
.dropdown-content { display: none; position: absolute; right: 0; top: 100%; background-color: white; min-width: 14rem; border-radius: 0.5rem; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); z-index: 10; opacity: 0; transform: translateY(-10px); transition: opacity 0.3s ease, transform 0.3s ease; max-height: 70vh; overflow-y: auto; }
.dropdown:hover .dropdown-content { display: block; opacity: 1; transform: translateY(0); }
.dropdown-content a { display: block; padding: 0.75rem 1.25rem; font-size: 0.875rem; color: #334155; transition: background-color 0.2s ease, color 0.2s ease; }
.dropdown-content a:hover { background-color: var(--otter-light-blue); color: white; }
.dropdown-arrow { transition: transform 0.3s ease; }
.dropdown:hover .dropdown-arrow { transform: rotate(180deg); }
.nav-button { display: flex; align-items: center; padding: 0.5rem 1rem; border-radius: 9999px; font-size: 0.875rem; font-weight: 500; color: #475569; background-color: #f1f5f9; transition: all 0.3s ease; white-space: nowrap; }
.nav-button:hover { background-color: var(--otter-light-blue); color: white; cursor: pointer; }


/* Hero Section & Animated Text */
@keyframes gradient-pan { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }
.hero-section { animation: fadeInDown 0.8s ease-out forwards; }
.animated-gradient-text { background: linear-gradient(90deg, var(--otter-dark-blue), var(--otter-light-blue), var(--otter-dark-blue)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: gradient-pan 6s linear infinite; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }


/* --- PREFERENCE MODAL STYLES --- */
.preferences-btn { @apply bg-white text-otter-dark-blue font-semibold px-6 py-3 rounded-full shadow-md border-2 border-slate-200 hover:border-otter-light-blue hover:text-otter-light-blue transition-all duration-300 transform hover:scale-105; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 50; opacity: 1; transition: opacity 0.3s ease; }
.modal-overlay.hidden { opacity: 0; pointer-events: none; }
.modal-box { background-color: white; border-radius: 0.5rem; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); width: 100%; max-width: 36rem; margin: 1rem; transform: scale(1); opacity: 1; transition: all 0.3s ease; }
.modal-overlay.hidden .modal-box { transform: scale(0.95); opacity: 0; }
.modal-header { padding: 1.25rem; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 1.25rem; font-weight: 700; }
.modal-close-btn { font-size: 1.875rem; color: #94a3b8; font-weight: 300; line-height: 1; border: none; background: none; cursor: pointer; }
.modal-close-btn:hover { color: #475569; }
.modal-body { padding: 1.5rem; max-height: 60vh; overflow-y: auto; }
.preference-table-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; font-weight: 700; color: #64748b; margin-bottom: 0.5rem; padding: 0 1rem; }
.options-header { display: flex; justify-content: space-between; width: 10rem; text-align: center; }
.preferences-list .preference-row { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border-radius: 0.5rem; }
.preferences-list .preference-row:nth-child(odd) { background-color: #f8fafc; }
.preference-row .category-name { font-weight: 600; color: #334155; }
.preference-row .options { display: grid; grid-template-columns: repeat(3, 1fr); width: 10rem; }
.preference-row .option { display: flex; justify-content: center; }
.preference-row input[type="radio"] { appearance: none; -webkit-appearance: none; width: 1.25rem; height: 1.25rem; border: 2px solid #cbd5e1; border-radius: 50%; cursor: pointer; transition: all 0.2s ease; }
.preference-row input[type="radio"]:hover { border-color: var(--otter-light-blue); }
.preference-row input[type="radio"]:checked { background-color: var(--otter-light-blue); border-color: var(--otter-light-blue); }
.modal-footer { padding: 1.25rem; background-color: #f8fafc; border-top: 1px solid #e2e8f0; border-bottom-left-radius: 0.5rem; border-bottom-right-radius: 0.5rem; display: flex; justify-content: space-between; align-items: center; }
.modal-save-btn { background-color: var(--otter-light-blue); color: white; font-weight: 700; padding: 0.625rem 1.5rem; border-radius: 0.5rem; transition: background-color 0.3s ease; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); border: none; cursor: pointer; }
.modal-save-btn:hover { background-color: var(--otter-dark-blue); }
.modal-secondary-btn { background-color: transparent; color: #475569; font-weight: 600; padding: 0.625rem 1.5rem; border-radius: 0.5rem; transition: background-color 0.3s ease; border: none; cursor: pointer; }
.modal-secondary-btn:hover { background-color: #e2e8f0; }


/* --- CATEGORY PAGE SORTING STYLES --- */
.sort-control { @apply flex flex-col; }
.sort-label { @apply text-sm font-semibold text-slate-600 mb-1; }
.sort-select { @apply bg-white border-2 border-slate-200 rounded-md py-2 px-3 text-sm text-slate-800 focus:outline-none focus:ring-2 focus:ring-otter-light-blue focus:border-transparent; }


/* --- SUBMIT DEAL PAGE STYLES --- */
.submission-container { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 768px) { .submission-container { grid-template-columns: 1fr 2fr; } }
.submission-form { background-color: white; padding: 2rem; border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }
.progress-circle { position: relative; width: 8rem; height: 8rem; margin: 0 auto 1.5rem auto; }
.progress-ring-circle, .progress-ring-circle-bg { transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 0.5s; }
.progress-ring-circle-bg { stroke: #e2e8f0; }
.progress-ring-circle { stroke: var(--otter-light-blue); }
.progress-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.5rem; font-weight: 700; color: var(--otter-dark-blue); }
.progress-steps { list-style: none; padding: 0; }
.progress-steps li { display: flex; align-items: center; color: #64748b; transition: color 0.3s ease; }
.progress-steps li + li { margin-top: 1rem; }
.progress-steps li span { display: flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; font-size: 0.75rem; font-weight: 700; border: 2px solid #cbd5e1; border-radius: 50%; margin-right: 0.75rem; transition: all 0.3s ease; }
.progress-steps li.completed { color: var(--otter-dark-blue); font-weight: 600; }
.progress-steps li.completed span { background-color: var(--otter-light-blue); color: white; border-color: var(--otter-light-blue); }
.progress-steps li.completed::after { content: '✔'; color: var(--otter-light-blue); margin-left: auto; }
.form-group { margin-bottom: 1.5rem; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 700; color: #334155; margin-bottom: 0.5rem; }
.form-group input, .form-group textarea, .form-group select { display: block; width: 100%; padding: 0.75rem 1rem; background-color: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.375rem; transition: all 0.2s ease; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; box-shadow: 0 0 0 2px var(--otter-light-blue); border-color: var(--otter-light-blue); }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.auto-fill-loader { text-align: center; padding: 1.5rem; background-color: #f8fafc; border-radius: 0.5rem; margin-bottom: 1.5rem; }
.image-upload-box { position: relative; border: 2px dashed #cbd5e1; border-radius: 0.5rem; padding: 2rem; text-align: center; color: #64748b; transition: all 0.3s ease; }
.image-upload-box:hover { border-color: var(--otter-light-blue); background-color: #f8fafc; }
.image-upload-box i { font-size: 2.5rem; color: var(--otter-light-blue); margin-bottom: 1rem; }
.image-upload-input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.image-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 1rem; }
.image-result-item { aspect-ratio: 1 / 1; border: 2px solid transparent; border-radius: 0.5rem; overflow: hidden; cursor: pointer; transition: all 0.2s ease; }
.image-result-item:hover { border-color: var(--otter-light-blue); }
.image-result-item.selected { border-width: 4px; border-color: var(--otter-light-blue); box-shadow: 0 4px 14px 0 rgba(74, 144, 226, 0.39); }
.image-result-item img { width: 100%; height: 100%; object-fit: cover; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #e2e8f0; }


/* --- STATIC PAGE STYLES --- */
.page-container { max-width: 1024px; margin: 0 auto; background-color: white; padding: 2.5rem; border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }
.page-header { text-align: center; margin-bottom: 3rem; }
.page-header h1 { font-size: 2.25rem; font-weight: 800; }
.page-header p { font-size: 1.125rem; color: #475569; margin-top: 1rem; max-width: 600px; margin-left: auto; margin-right: auto;}
.about-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-top: 3rem; }
@media(min-width: 768px){ .about-grid { grid-template-columns: 1fr 1fr; } }
.about-card { text-align: center; }
.about-icon { width: 4rem; height: 4rem; background-color: var(--otter-light-blue); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem auto; font-size: 1.75rem; }
.about-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }
.about-card p { color: #64748b; }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media(min-width: 768px){ .contact-grid { grid-template-columns: 2fr 1fr; } }
.contact-info { background-color: #f8fafc; padding: 2rem; border-radius: 0.5rem; }
.social-links { display: flex; gap: 1.5rem; margin-top: 2rem; }
.social-links a { font-size: 1.25rem; color: #94a3b8; transition: color 0.3s ease; }
.social-links a:hover { color: var(--otter-light-blue); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.guide-card { background-color: white; border-radius: 0.5rem; padding: 2rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); text-align: center; }
.guide-icon { width: 4rem; height: 4rem; background-color: var(--otter-light-blue); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem auto; font-size: 1.75rem; }
.guide-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }
.guide-card p { color: #64748b; }
.guide-example { background-color: #f8fafc; border-left: 4px solid var(--otter-light-blue); padding: 1rem; margin-top: 1.5rem; text-align: left; border-radius: 0.25rem; font-size: 0.875rem; }
.guide-example p { font-family: monospace; }


/* --- BLOG STYLES --- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.blog-card { background-color: white; border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); display: flex; flex-direction: column; transition: all 0.3s ease; }
.blog-card:hover { transform: translateY(-0.5rem); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }
.blog-card-image-container { width: 100%; height: 200px; overflow: hidden; border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; }
.blog-card-image { width: 100%; height: 100%; object-fit: cover; }
.blog-card-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.blog-card-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
.blog-card-summary { color: #64748b; flex-grow: 1; }
.blog-card-footer { display: flex; justify-content: space-between; font-size: 0.875rem; color: #94a3b8; margin-top: 1.5rem; border-top: 1px solid #e2e8f0; padding-top: 1rem; }

/* --- ARTICLE PAGE STYLES --- */
.article-container { max-width: 800px; margin: 0 auto; background-color: white; border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); overflow: hidden; }
.article-header { height: 300px; background-size: cover; background-position: center; position: relative; }
.article-header-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent); display: flex; flex-direction: column; justify-content: flex-end; padding: 2rem; }
.article-title { color: white; font-size: 2.25rem; font-weight: 800; line-height: 1.2; }
.article-meta { color: #e2e8f0; font-size: 0.875rem; margin-top: 0.5rem; }
.article-content { padding: 2.5rem; line-height: 1.8; color: #334155; }


/* --- ADMIN DASHBOARD STYLES --- */
.admin-deals-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 1.5rem; }
.admin-deal-card { font-family: 'Poppins', sans-serif; background-color: white; border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); display: flex; flex-direction: column; transition: opacity 0.5s ease, transform 0.5s ease; }
.admin-deal-card.removing { opacity: 0; transform: scale(0.95); }
.admin-deal-image-container { width: 100%; height: 180px; background-color: #f8fafc; display: flex; align-items: center; justify-content: center; border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; border-bottom: 1px solid #e2e8f0; }
.admin-deal-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.admin-deal-content { flex-grow: 1; padding: 1rem; }
.admin-deal-content-view p { margin-bottom: 0.5rem; }
.admin-deal-content-view .label { font-weight: 700; color: var(--otter-dark-blue); }
.admin-deal-title-view { font-weight: 700; font-size: 1.125rem; color: var(--otter-dark-blue); margin-bottom: 0.5rem; }
.admin-deal-link { font-size: 0.875rem; color: var(--otter-light-blue); font-weight: 600; text-decoration: underline; margin-top: 0.75rem; display: inline-block; }
.admin-deal-content-edit { display: none; }
.admin-deal-content-edit .form-group { margin-bottom: 1rem; }
.admin-deal-actions { display: flex; gap: 0.5rem; padding: 0 1rem 1rem 1rem; }
.admin-btn { flex-grow: 1; padding: 0.5rem 1rem; border: none; border-radius: 0.375rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; }
.approve-btn, .save-btn { background-color: #10b981; color: white; }
.approve-btn:hover, .save-btn:hover { background-color: #059669; }
.reject-btn, .cancel-btn { background-color: #ef4444; color: white; }
.reject-btn:hover, .cancel-btn:hover { background-color: #dc2626; }
.edit-btn { background-color: #f59e0b; color: white; }
.edit-btn:hover { background-color: #d97706; }


/* --- DEAL CARD STYLES --- */
.deal-card { background-color: white; border-radius: 0.5rem; border: 1px solid #e2e8f0; display: flex; flex-direction: column; transition: all 0.3s ease-in-out; opacity: 0; transform: translateY(20px); animation: fadeInUp 0.5s ease-out forwards; }
.deal-card:hover { transform: translateY(-0.5rem); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
.deal-card-image-container { width: 100%; height: 13rem; background-color: white; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 1rem; border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; }
.deal-card-image { width: 100%; height: 100%; object-fit: contain; transition: transform 0.5s ease-in-out; }
.deal-card:hover .deal-card-image { transform: scale(1.05); }
.deal-card-content { padding: 1.25rem; display: flex; flex-direction: column; flex-grow: 1; }
.deal-card-store { font-size: 0.75rem; font-weight: 700; color: var(--otter-light-blue); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.deal-card-title { font-size: 1rem; font-weight: 600; color: var(--otter-dark-blue); margin-bottom: 0.75rem; line-height: 1.25; flex-grow: 1; }
.deal-card-price { font-size: 1.5rem; font-weight: 800; color: var(--otter-dark-blue); }
.deal-card-old-price { font-size: 0.875rem; color: #94a3b8; text-decoration: line-through; margin-left: 0.5rem; font-weight: 500; align-self: flex-end; margin-bottom: 0.25rem; }
.deal-card-button { display: block; width: 100%; text-align: center; background-color: var(--otter-light-blue); color: white; font-weight: 700; padding: 0.75rem 1rem; border-radius: 0.5rem; transition: all 0.3s ease-in-out; position: relative; overflow: hidden; transform: scale(1); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }
.deal-card-button:hover { transform: scale(1.05); }
.deal-card-button::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.3), transparent); transition: left 0.6s ease; }
.deal-card-button:hover::before { left: 100%; }


/* --- FOOTER STYLES --- */
.site-footer { background-color: #cbd5e1; color: var(--otter-dark-blue); margin-top: 5rem; padding-top: 2rem; padding-bottom: 2rem; }
.footer-logo { height: 9rem; width: auto; margin-left: auto; margin-right: auto; margin-bottom: 1rem; }
.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1.5rem; }
.footer-links a { color: #1e293b; font-weight: 600; transition: color 0.3s ease; }
.footer-links a:hover { color: var(--otter-light-blue); }
.footer-disclosure { font-size: 0.75rem; margin-top: 1rem; max-width: 42rem; margin-left: auto; margin-right: auto; color: #475569; }

.spinner { border: 5px solid rgba(0, 0, 0, 0.1); width: 40px; height: 40px; border-radius: 50%; border-left-color: var(--otter-light-blue); margin: auto; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- SUBMISSION SUCCESS INDICATOR --- */
.success-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 1; transition: opacity 0.5s ease; }
.success-overlay.hidden { opacity: 0; pointer-events: none; }
.success-animation { text-align: center; }
.success-animation p { font-size: 1.5rem; font-weight: 700; color: white; margin-top: 1rem; }
.checkmark { width: 100px; height: 100px; border-radius: 50%; display: block; stroke-width: 2; stroke: #fff; stroke-miterlimit: 10; margin: 10% auto; box-shadow: inset 0px 0px 0px var(--otter-light-blue); animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both; }
.checkmark-circle { stroke-dasharray: 166; stroke-dashoffset: 166; stroke-width: 2; stroke-miterlimit: 10; stroke: var(--otter-light-blue); fill: none; animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards; }
.checkmark-check { transform-origin: 50% 50%; stroke-dasharray: 48; stroke-dashoffset: 48; animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards; }
@keyframes stroke { 100% { stroke-dashoffset: 0; } }
@keyframes scale { 0%, 100% { transform: none; } 50% { transform: scale3d(1.1, 1.1, 1); } }
@keyframes fill { 100% { box-shadow: inset 0px 0px 0px 50px var(--otter-light-blue); } }

/* --- PAGINATION STYLES --- */
.pagination-controls { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 3rem; }
.pagination-button { background-color: white; border: 2px solid #e2e8f0; color: var(--otter-dark-blue); font-weight: 600; padding: 0.5rem 1rem; border-radius: 0.5rem; transition: all 0.3s ease; }
.pagination-button:hover:not(:disabled) { background-color: var(--otter-light-blue); color: white; border-color: var(--otter-light-blue); }
.pagination-button:disabled { background-color: #f8fafc; color: #94a3b8; cursor: not-allowed; }
.page-info { font-weight: 600; color: #475569; }

