/* --- Root Variables and Theming --- */
:root {
    --color-dark-1: #070707;
    --color-light-1: #ddddde;
    --color-muted-1: #b3a4a5;
    --color-accent-1: #e31920;
    --color-accent-2: #8a2023;
    --color-muted-2: #ac7e7d;
    --color-gray-1: #646c6d;
    --color-light-2: #edbcb4;
    --color-accent-3: #e94c4b;
    --color-accent-4: #e6615f;

    --font-family: 'Heebo', sans-serif;
    --transition-speed: 0.3s;
}

html[data-theme='dark'] {
    --bg-primary: var(--color-dark-1);
    --bg-secondary: #232222;
    --text-primary: var(--color-light-1);
    --text-secondary: var(--color-muted-1);
    --border-color: var(--color-gray-1);
    --accent-primary: var(--color-accent-1);
    --accent-hover: var(--color-accent-3);
}

html[data-theme='light'] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: var(--color-dark-1);
    --text-secondary: var(--color-gray-1);
    --border-color: var(--color-light-1);
    --accent-primary: var(--color-accent-1);
    --accent-hover: var(--color-accent-2);
}

/* --- General Styles & Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Offset for fixed header */
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Accessibility helper class */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

h1, h2, h3 {
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; text-align: center; margin-bottom: 2.5rem; }
h3 { font-size: 1.5rem; }

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-hover);
}

ul {
    list-style: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 60px 0;
}

/* --- Header & Navigation --- */
.site-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color var(--transition-speed);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 900; /* Bolder font for a stronger logo presence */
    transition: color var(--transition-speed);
}
.logo a:hover {
    color: var(--accent-primary);
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
}

.main-nav ul {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    border-radius: 4px; /* Improves appearance of the focus outline */
    outline-offset: 4px; /* Adds space between the link and the focus outline */
}

.main-nav a:hover,
.main-nav a.active,
.main-nav a:focus-visible {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.main-nav a:focus-visible {
    outline: 2px solid var(--accent-primary);
}
.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.5rem;
}

html[data-theme='dark'] .theme-toggle-btn .fa-sun { display: inline-block; }
html[data-theme='dark'] .theme-toggle-btn .fa-moon { display: none; }
html[data-theme='light'] .theme-toggle-btn .fa-sun { display: none; }
html[data-theme='light'] .theme-toggle-btn .fa-moon { display: inline-block; }

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
}

/* --- Hero Section --- */
.hero-section {
    text-align: center;
    padding: 80px 0;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://images.unsplash.com/photo-1587571432426-697254539c55?q=80&w=2070') center/cover no-repeat;
}

.hero-section h1 {
    color: #fff;
}

#typed-text::after {
    content: '';
    display: inline-block;
    width: 3px;
    height: 1em; /* Match the height of the text line */
    background-color: var(--accent-primary);
    margin-right: 8px; /* Space between text and cursor in RTL */
    animation: blink-caret 0.75s step-end infinite;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--color-light-1);
}

@keyframes blink-caret {
  from, to { background-color: transparent }
  50% { background-color: var(--accent-primary); }
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    text-align: center;
    transition: transform var(--transition-speed), background-color var(--transition-speed);
}
.btn:hover {
    transform: translateY(-3px);
}
.btn-primary {
    background-color: var(--accent-primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--accent-hover);
    color: #fff;
}
.btn-secondary {
    background-color: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}
.btn-secondary:hover {
    background-color: var(--accent-primary);
    color: #fff;
}

/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    perspective: 1500px; /* Provides the 3D space for the flip effect */
}

.service-card {
    /* The card itself is now a 3D container */
    background-color: transparent;
    min-height: 480px; /* Set a fixed height for consistent flipping */
    border: none;
    border-radius: 15px; /* Add radius to the main container for clipping */
    overflow: hidden; /* Add overflow to clip the badge without breaking 3D context */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Move shadow here */
    cursor: pointer;
    /* Initial state for scroll animation */
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, visibility 0.6s;
}

.service-card.is-visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s;
    transform-style: preserve-3d;
    /* Shadow and radius are now on the parent .service-card */
}

/* The flip happens on hover (for desktop) or when .is-flipped is added (for mobile) */
.service-card:hover .service-card-inner,
.service-card.is-flipped .service-card-inner {
    transform: rotateY(180deg);
}

.service-card-front,
.service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    background-color: var(--bg-secondary);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.service-card-front {
    justify-content: space-between; /* Pushes footer to the bottom */
}

.service-card-back {
    transform: rotateY(180deg);
    justify-content: center; /* Center content vertically on the back */
    gap: 15px; /* Add space between the back-face elements */
}

.service-card-back p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
}

.service-card.featured .service-card-front {
    border: 2px solid var(--accent-primary);
}

.featured-badge {
    position: absolute;
    top: 15px;
    left: -40px;
    transform: rotate(-45deg);
    background-color: var(--accent-primary);
    color: #fff;
    padding: 5px 40px;
    font-size: 0.9rem;
    font-weight: 700;
}

.service-card .price {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-primary);
    margin: 10px 0;
}

.price .strikethrough {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.service-card ul {
    margin: 20px 0;
    text-align: right;
    flex-grow: 1; /* Allows the list to take up available space */
}

.service-card ul li {
    margin-bottom: 10px;
}

.service-card ul li .fa-check {
    color: var(--color-accent-4);
    margin-left: 10px;
}

/* New styles for the card footer and flip indicator */
.card-footer {
    width: 100%;
    text-align: center;
}

.flip-indicator {
    display: block;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.flip-indicator i {
    margin-right: 5px;
}

/* --- Testimonials Section --- */
.testimonials-section {
    background-color: var(--bg-secondary);
}
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
.testimonial-card {
    background-color: var(--bg-primary);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    /* Initial state for scroll animation */
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, visibility 0.6s, box-shadow var(--transition-speed);
}
.testimonial-card.is-visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}
.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.testimonial-card::before {
    content: '“';
    font-size: 6rem;
    color: var(--accent-primary);
    position: absolute;
    top: 10px;
    right: 20px;
    opacity: 0.1;
    line-height: 1;
    z-index: 0;
}
.testimonial-card .quote {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    position: relative; /* To appear above the pseudo-element */
    z-index: 1;
    flex-grow: 1;
}
.testimonial-card .author {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}
.testimonial-card .author img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
}
.testimonial-card .author h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* --- Contact Section --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.contact-main-info {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin: 20px 0;
    flex-wrap: wrap;
}
.contact-main-info ul {
    flex-grow: 1;
}
.contact-details li {
    margin-bottom: 15px;
    font-size: 1.1rem;
}
.vcard-qr {
    text-align: center;
    flex-shrink: 0;
}
.vcard-qr img {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    border: 4px solid var(--bg-primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.vcard-qr p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
}
.contact-details li i {
    margin-left: 15px;
    width: 20px;
    text-align: center;
    color: var(--accent-primary);
}
.working-hours {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.working-hours h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}
.working-hours h3 i {
    margin-left: 10px;
    color: var(--accent-primary);
}
.working-hours p {
    margin-bottom: 8px;
    color: var(--text-secondary);
}
.working-hours p:last-child {
    margin-bottom: 0;
}
.working-hours p strong {
    color: var(--text-primary);
    font-weight: 700;
}
.social-links {
    margin-top: 20px;
    display: flex;
    gap: 20px;
}
.social-links a {
    font-size: 2rem;
    display: inline-block; /* Required for transform to work */
    transition: transform var(--transition-speed), color var(--transition-speed);
}
.social-links a:hover {
    transform: translateY(-5px); /* Moves the icon up on hover */
}
.contact-form .form-group {
    margin-bottom: 20px;
}
.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}
.contact-form .required-indicator {
    color: var(--accent-primary);
    font-weight: 700;
    margin-right: 4px; /* Space between label text and asterisk */
    user-select: none; /* Prevents the asterisk from being selected with text */
}
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--color-accent-2);
}

/* --- Form Status Messages --- */
#form-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
    display: none; /* Hidden by default, made visible via JS */
}
#form-status.visible {
    display: block;
}
#form-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
#form-status.error {
    background-color: var(--color-accent-2);
    color: var(--color-light-1);
    border: 1px solid var(--color-accent-1);
}

/* --- About Section --- */
.about-section {
    background-color: var(--bg-secondary);
}

.about-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem auto;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.about-card {
    text-align: center;
    padding: 20px;
    transition: transform var(--transition-speed);
}

.about-card:hover {
    transform: translateY(-5px);
}

.about-icon {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform var(--transition-speed);
}

.about-card:hover .about-icon {
    transform: scale(1.1);
}

.about-card h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
}

.about-card p {
    color: var(--text-secondary);
}
/* --- FAQ Section --- */
.faq-container {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.faq-item {
    border-bottom: 1px solid var(--border-color);
}
.faq-question {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1.2rem;
    font-weight: 700;
    text-align: right;
    padding: 20px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question i {
    transition: transform 0.3s ease;
    color: var(--accent-primary);
}
.faq-question.active i {
    transform: rotate(180deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}
.faq-answer p {
    padding-bottom: 20px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.faq-answer ul, .faq-answer ol {
    padding-right: 20px;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}
.faq-answer ul {
    list-style-type: disc;
}
.faq-answer ol {
    list-style-type: decimal;
}
.faq-answer li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    padding-right: 5px;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--color-dark-1);
    color: var(--color-muted-1);
    padding: 20px 0;
    margin-top: 40px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.site-footer p {
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: var(--color-muted-1);
    text-decoration: none;
    font-weight: 700;
    position: relative;
    padding-bottom: 4px;
    transition: color var(--transition-speed);
}

.footer-links a:hover {
    color: var(--color-light-1);
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-primary);
    transition: width var(--transition-speed) ease-out;
}

.footer-links a:hover::after {
    width: 100%;
}

/* --- Cookie Consent Banner --- */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 20px 0;
    z-index: 1001; /* Higher than header and other elements */
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    transform: translateY(0);
    transition: transform 0.5s ease-in-out;
}
.cookie-consent-banner.is-hidden {
    transform: translateY(100%);
}
.cookie-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.cookie-container p {
    margin: 0;
}
.cookie-container p a {
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: underline;
}
.cookie-container p a:hover {
    color: var(--accent-primary);
}
/* --- Back to Top Button --- */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--accent-primary);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: opacity 0.4s, visibility 0.4s, transform 0.4s, background-color var(--transition-speed);
}
.back-to-top-btn:hover {
    background-color: var(--accent-hover);
    color: #fff;
}
.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Privacy Policy Page --- */
.privacy-policy-section {
    background-color: var(--bg-secondary);
    padding: 60px 0;
}
.privacy-policy-section .last-updated {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-style: italic;
}
.privacy-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.privacy-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.privacy-content p, .privacy-content ul {
    margin-bottom: 1rem;
    line-height: 1.8;
}
.privacy-content ul {
    padding-right: 20px; /* Indentation for RTL */
    list-style-type: disc;
}
.privacy-content .disclaimer {
    margin-top: 3rem;
    padding: 15px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
}
/* --- Preloader --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.75s, visibility 0.75s;
}
#preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--color-gray-1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }

    .main-nav {
        position: absolute;
        top: 81px;
        right: 0;
        width: 100%;
        background-color: var(--bg-secondary);
        flex-direction: column;
        text-align: center;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
    }
    .main-nav.is-open {
        max-height: 300px; /* Adjust as needed */
        border-bottom: 1px solid var(--border-color);
    }
    .main-nav ul {
        flex-direction: column;
        padding: 20px 0;
        gap: 0;
    }
    .main-nav li {
        padding: 15px 0;
    }
    .hamburger-btn {
        display: block;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .cookie-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-container {
        justify-content: center;
        text-align: center;
    }
}

/* --- Search Bar Styles --- */
.guide-search-container {
    margin: 2rem 0;
    display: flex;
    gap: 10px;
}

#guide-search-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
}

#guide-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--color-accent-2);
}

#guide-search-submit {
    padding: 12px 20px;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 1px solid var(--accent-primary);
    background-color: var(--accent-primary);
    color: white;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

#guide-search-submit:hover {
    background-color: var(--accent-hover);
}

.no-results-message {
    text-align: center;
    padding: 2rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
}