/*
Theme Name: DietPro
Author: Turgut Yavuz
Description: A sales-ready, OOP-based WordPress theme with a focus on modularity and clean architecture.
Version: 1.0.4
Text Domain: dietpro
*/

/* 
 * 1. CORE SETTINGS & VARIABLES
 * -------------------------------------------------------------------------- */
:root {
    --color-bg-card: #FFFFFF;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
}

/* 
 * 2. TYPOGRAPHY & BASE ELEMENTS
 * -------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    overflow-x: hidden;
}

/* 
 * Modal Scrollbar Reset
 * -------------------------------------------------------------------------- */
.source-modal-content {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.source-modal-content::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

h1,
h2,
h3,
h4,
h5,
h6,
span,
p {
    cursor: pointer;
    user-select: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Merriweather', serif;
    color: var(--color-secondary);
}

.font-signature {
    font-family: 'Dancing Script', cursive;
}

/* 
 * 3. SHARED UTILITIES & BASE ANIMATIONS
 * -------------------------------------------------------------------------- */

[x-cloak] {
    display: none !important;
}

/* Standard Keyframes */
@keyframes writeSignature {
    from {
        clip-path: inset(0 100% 0 0);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes shine {
    0% {
        transform: translateX(-150%) translateY(150%) rotate(135deg);
    }

    100% {
        transform: translateX(150%) translateY(-150%) rotate(135deg);
    }
}

@keyframes floatPulse {

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

    50% {
        transform: scale(1.3);
    }
}

@keyframes ping {

    75%,
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes heroRotateIn {
    0% {
        opacity: 0;
        transform: translateY(30px) rotate(-1deg) scale(0.95);
        filter: blur(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) rotate(2deg) scale(1);
        filter: blur(0);
    }
}

@keyframes heroRotateInNeg {
    0% {
        opacity: 0;
        transform: translateY(30px) rotate(1deg) scale(0.95);
        filter: blur(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) rotate(-2deg) scale(1);
        filter: blur(0);
    }
}

.animate-hero-rotate {
    animation: heroRotateIn 5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-hero-rotate-neg {
    animation: heroRotateInNeg 5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-ping-slow {
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Motion Utilities */
.dietcore-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dietcore-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.1);
}

/* Shine Effect (Premium Glare) */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::after {
    content: "";
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0) 45%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(255, 255, 255, 0) 55%,
            rgba(255, 255, 255, 0) 100%);
    transform: rotate(135deg);
    animation: shine 5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
    z-index: 20;
}

/* Global Accent Strategy */
::selection {
    background-color: var(--color-accent);
    color: white;
}

/* 
 * Standard WordPress selection fallback for Admin/Customizer sidebar.
 * Since CSS variables are in the theme iframe, we force a solid fallback here.
 */
#customize-controls ::selection {
    background-color: #2271b1 !important;
    color: white !important;
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--color-accent);
}

ul li::marker {
    color: var(--color-accent);
}

/* 
 * 4. LAYOUT & SECTIONING
 * -------------------------------------------------------------------------- */
main>section {
    position: relative;
    overflow: hidden;
}

/* Ensure all content stays above background decorations */
main>section>*:not(.decoration-blob):not(.hero-mesh-blob) {
    position: relative;
    z-index: 10;
}

/* Zebra Sectioning (Alternating Backgrounds) */
main>section:not(:first-child):nth-child(odd) {
    background-color: var(--color-bg-body);
}

main>section:not(:first-child):nth-child(even) {
    background-color: #FFFFFF;
}

/* 
 * 5. GLOBAL COMPONENTS
 * -------------------------------------------------------------------------- */

/* dietcore Buttons */
.dietcore-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dietcore-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px -8px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
}

.dietcore-button:active {
    transform: scale(0.96);
}

/* Antigravity Blobs (Decorative Elements) */
.decoration-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background-color: var(--color-accent);
    opacity: 0.12;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
    animation: floatPulse 10s ease-in-out infinite;
}

.blob-top-right {
    top: -100px;
    right: -100px;
}

.blob-top-left {
    top: -100px;
    left: -100px;
}

.blob-center {
    top: calc(50% - 250px);
    left: calc(50% - 250px);
}

.blob-center-right {
    top: calc(50% - 250px);
    right: -250px;
}

.blob-center-left {
    top: calc(50% - 250px);
    left: -250px;
}

.blob-bottom-right {
    bottom: -250px;
    right: -250px;
}

.blob-bottom-left {
    bottom: -250px;
    left: -250px;
}

footer * {
    font-family: 'Nunito', sans-serif;
}

/* Social Media Colors */
.social-instagram:hover {
    color: #E1306C !important;
}

.social-facebook:hover {
    color: #1877F2 !important;
}

.social-x:hover {
    color: #000000 !important;
}

.social-linkedin:hover {
    color: #0077B5 !important;
}

/* 
 * 6. HEADER & NAVIGATION
 * -------------------------------------------------------------------------- */
.dietcore-logo-wrapper img {
    height: auto;
    max-height: 50px;
    width: auto;
    transition: max-height 0.3s ease;
}

/* Scrolled state (h-16 class added to flex container inside header) */
.at-top-false .dietcore-logo-wrapper img {
    max-height: 40px;
}

/* Ensure header doesn't shrink layout when scrolling */
header.fixed {
    transition: height 0.3s ease, background-color 0.3s ease;
}

/* 
 * 7. FEATURE-SPECIFIC STYLES
 * -------------------------------------------------------------------------- */

/* Hero Section */
#hero-section {
    position: relative;
    background-color: #FFFFFF;
}

#hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    /* Noise texture overlay for dithering (removes lines) */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

.hero-mesh-blob {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
}

.animate-signature {
    display: inline-block;
    animation: writeSignature 5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    vertical-align: bottom;
}

/* Success Stories (Slider & Carousel) */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.slider-container {
    transform: translateZ(0);
}

.before-image,
.slider-handle {
    will-change: clip-path, left;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.slider-container:has(.slider-input:active) .before-image,
.slider-container:has(.slider-input:active) .slider-handle {
    transition: none !important;
}

/* Process Flow Animation */
@keyframes flowDash {
    to {
        stroke-dashoffset: -16;
    }
}

.flow-arrow {
    animation: flowDash 1s linear infinite;
}

/* About Me Spotlight Orbit */
@keyframes spotlight-orbit {

    0%,
    100% {
        top: 0%;
        left: 0%;
        opacity: 0.7;
    }

    22% {
        top: 0%;
        left: 100%;
        opacity: 0.9;
    }

    50% {
        top: 100%;
        left: 100%;
        opacity: 0.7;
    }

    72% {
        top: 100%;
        left: 0%;
        opacity: 0.9;
    }
}

.animate-spotlight-orbit {
    animation: spotlight-orbit 14s ease-in-out infinite;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 30%, transparent 60%);
    margin: -75px;
}

@keyframes border-beam {
    100% {
        offset-distance: 100%;
    }
}

.border-beam {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    border-radius: inherit;
    /* Create a 2px 'track' for the beam using a mask */
    padding: 2px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

.border-beam::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at center, var(--color-accent, --color-primary) 0%, transparent 70%);
    offset-path: inset(0 round 24px);
    animation: border-beam 14s linear infinite;
    filter: blur(8px);
    opacity: 1;
    margin: -100px;
}

.border-beam-delayed::after {
    animation-delay: -7s;
}

/* Contact Section */
.btn-whatsapp {
    background-color: #25D366 !important;
}

/* 
 * 8. ADMIN & CUSTOMIZER STYLES
 * -------------------------------------------------------------------------- */
.customizer-separator {
    margin: 25px 0 10px;
    border-top: 1px dashed #ddd;
    text-align: center;
    height: 1px;
    width: 100%;
}

.agency-branding-footer {
    padding: 15px;
    border-top: 1px solid #ddd;
    background: #f7f7f7;
    text-align: center;
    margin-top: 20px;
}

.agency-branding-footer img {
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.agency-branding-footer h4 {
    margin: 0 0 5px;
    font-size: 13px;
    color: #555;
}

.agency-branding-footer .button-help {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 8px 0;
    background-color: #25D366;
    border: 1px solid #25D366;
    color: #fff;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    margin-top: 12px;
}

.agency-branding-footer .button-help:hover {
    background-color: #128C7E;
    border-color: #128C7E;
    color: #fff;
}

/* 
 * 9. PAGINATION
 * -------------------------------------------------------------------------- */
.dietcore-pagination {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
}

.dietcore-pagination .nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.dietcore-pagination .page-numbers {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    font-weight: 700;
    color: var(--color-secondary);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dietcore-pagination .page-numbers:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.dietcore-pagination .page-numbers.current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.dietcore-pagination .page-numbers.prev,
.dietcore-pagination .page-numbers.next {
    width: auto;
    padding: 0 1.25rem;
}

/* 
 * 10. SOURCE INFO MODAL
 * -------------------------------------------------------------------------- */
.source-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.source-modal-content {
    background: #FFFFFF;
    width: 100%;
    max-width: 600px;
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile optimizations for Small Screens */
@media (max-width: 520px) {
    .source-modal-content {
        padding: 1.5rem 1.25rem;
        border-radius: 20px;
    }
}

.modal-close-sticky {
    position: sticky;
    top: -1rem;
    /* Hit the top scroll boundary */
    float: right;
    z-index: 50;
    margin-right: -1rem;
    margin-top: -1rem;
}

.modal-title-scroll {
    padding-right: 3rem;
    /* Leave room for sticky close button */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

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