/* resources/css/components/service-page.css */

/*
 |--------------------------------------------------------------------------
 | Service Detail & Premium Content Layout Styles
 |--------------------------------------------------------------------------
 | Driven by CSS variables mapped to the Tema Renk Yönetimi DB system.
 | Scope: `.service-text`, `.service-page`, `.service-wrapper`
 | Supports both legacy page classes and premium .sp- prefixed classes.
 */

:root {
    /* Mappings to DB-driven theme variables */
    --color-primary: var(--theme-primary);
    --color-primary-2: var(--theme-primary-2);
    --color-primary-dark: var(--theme-primary-3);
    --color-accent: var(--theme-accent);
    --color-accent-2: var(--theme-accent-2);
    --color-success: var(--theme-success);
    --color-success-hover: var(--theme-success-2);
    --color-navy: var(--theme-navy);
    /* color-text = dark on service page light bg — NOT --theme-text which can be cream for dark sections */
    --color-text: var(--theme-primary-3);
    --color-muted: var(--theme-muted);
    --color-surface: var(--theme-site-bg, var(--theme-surface));
    --color-border: var(--theme-border);
    --color-focus: var(--theme-focus);
}

/* --- GENERAL LAYOUT AND CONTAINER --- */
.service-wrapper {
    padding: 60px 0;
    background-color: var(--color-surface);
}

.service-layout {
    display: flex !important;
    gap: 50px !important;
    position: relative !important;
    align-items: flex-start !important;
}

.service-content-col {
    flex: 1 !important;
    min-width: 0 !important;
}

/* --- TITLE & BREADCRUMBS --- */
.service-title {
    font-size: 34px;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 20px;
    line-height: 1.2;
}

.service-breadcrumb {
    font-size: 14px;
    color: var(--color-muted);
    margin-bottom: 30px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 20px;
}

.service-breadcrumb a {
    color: var(--color-focus);
    text-decoration: none;
    font-weight: 500;
}

.service-breadcrumb span.divider {
    margin: 0 8px;
    color: var(--color-border);
}

.service-breadcrumb span.current {
    color: var(--color-muted);
}

/* --- FEATURED IMAGE --- */
.featured-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px color-mix(in srgb, var(--color-navy) 6%, transparent);
}

/* --- CONTENT AREA AND SEMANTIC TYPOGRAPHY --- */
.service-text,
.service-page {
    font-size: 17px;
    line-height: 1.8;
    color: var(--color-text);
    font-family: 'Roboto', 'Inter', sans-serif;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
}

.service-text *,
.service-page * {
    max-width: 100%;
}

.service-text h1, .service-page h1,
.service-text h2, .service-page h2,
.service-text h3, .service-page h3,
.service-text h4, .service-page h4,
.service-text h5, .service-page h5,
.service-text h6, .service-page h6 {
    color: var(--color-text);
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    line-height: 1.3;
}

.service-text h1, .service-page h1 { font-size: 28px; }
.service-text h2, .service-page h2 { font-size: 24px; }
.service-text h3, .service-page h3 { font-size: 20px; }
.service-text h4, .service-page h4 { font-size: 18px; }
.service-text h5, .service-page h5 { font-size: 16px; }
.service-text h6, .service-page h6 { font-size: 14px; }

.service-text p, .service-page p {
    margin-bottom: 20px;
}

.service-text strong, .service-page strong {
    color: var(--color-primary);
}

.service-text ul, .service-page ul,
.service-text ol, .service-page ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.service-text ul, .service-page ul { list-style-type: disc; }
.service-text ol, .service-page ol { list-style-type: decimal; }
.service-text li, .service-page li { margin-bottom: 8px; }

/* --- IMAGES AND FIGCAPTIONS --- */
.service-text img, .service-page img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
}

.service-text figure, .service-page figure {
    margin: 20px 0;
    clear: both;
}

.service-text figure.image, .service-page figure.image {
    display: table;
    clear: both;
    text-align: center;
    margin: 20px auto;
}

.service-text figure.image img, .service-page figure.image img {
    display: block;
    margin: 0 auto;
}

.service-text figure.image figcaption, .service-page figure.image figcaption {
    display: table-caption;
    caption-side: bottom;
    padding: 8px;
    font-size: 13px;
    color: var(--color-muted);
    text-align: center;
    background-color: var(--color-surface);
    border-radius: 0 0 8px 8px;
}

/* --- ALIGNMENT CLASSES --- */
.service-text .image-style-side, .service-page .image-style-side {
    float: right;
    margin-left: 20px;
    max-width: 50%;
}

.service-text .image-style-align-left, .service-page .image-style-align-left {
    float: left;
    margin-right: 20px;
    max-width: 50%;
}

.service-text .image-style-align-right, .service-page .image-style-align-right {
    float: right;
    margin-left: 20px;
    max-width: 50%;
}

.service-text .image-style-block-align-left, .service-page .image-style-block-align-left {
    margin-left: 0;
    margin-right: auto;
}

.service-text .image-style-block-align-right, .service-page .image-style-block-align-right {
    margin-left: auto;
    margin-right: 0;
}

.service-text figure.image.image_resized, .service-page figure.image.image_resized {
    max-width: 100%;
    display: block;
}

.service-text figure.image.image_resized img, .service-page figure.image.image_resized img {
    width: 100%;
}


/* --- TWO-COLUMN GRID LAYOUTS --- */
.service-text .sp-two-col,
.service-page .sp-two-col {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: start;
    margin: 24px 0;
}

.service-text .sp-two-col .sp-col-left,
.service-page .sp-two-col .sp-col-left,
.service-text .sp-two-col .sp-col-right,
.service-page .sp-two-col .sp-col-right {
    min-width: 0;
}

@media (max-width: 768px) {
    .service-text .sp-two-col,
    .service-page .sp-two-col {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* --- BLOCKQUOTES --- */
.service-text blockquote, .service-page blockquote {
    border-left: 4px solid var(--color-focus);
    padding: 15px 20px;
    background: var(--color-surface);
    margin: 20px 0;
    font-style: italic;
    color: var(--color-muted);
    border-radius: 0 8px 8px 0;
}

/* --- GENERIC TABLES --- */
.service-text figure.table, .service-page figure.table {
    display: block;
    overflow-x: auto;
    margin: 20px 0;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.service-text table, .service-page table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
    display: table;
}

.service-text table th, .service-page table th,
.service-text table td, .service-page table td {
    border: 1px solid var(--color-border);
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    min-width: 80px;
    word-break: break-word;
}

.service-text table th, .service-page table th {
    background-color: var(--color-surface);
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
}

.service-text table tr:nth-child(even), .service-page table tr:nth-child(even) {
    background-color: var(--color-surface);
}

/* --- FAQ SECTION --- */
.faq-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
}

.faq-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 30px;
}

.faq-item {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 15px;
    background: var(--color-surface);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 15px color-mix(in srgb, var(--color-navy) 5%, transparent);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 20px;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    outline: none;
}

.faq-question:hover {
    color: var(--color-focus);
}

.faq-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border-radius: 50%;
    color: var(--color-focus);
    font-size: 14px;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(135deg);
    background: var(--color-focus);
    color: var(--color-surface);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: var(--color-surface);
}

.faq-answer-inner {
    padding: 20px;
    font-size: 15px;
    color: var(--color-muted);
    line-height: 1.7;
    border-top: 1px solid var(--color-border);
}

/* --- SIDEBAR & OTHER SERVICES --- */
.service-sidebar-col {
    width: 380px !important;
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 120px !important;
    z-index: 10 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 30px !important;
}

.other-services-card {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 0;
    border: 1px solid var(--color-border);
    overflow: hidden;
    box-shadow: 0 4px 20px color-mix(in srgb, var(--color-navy) 3%, transparent);
}

.other-services-header {
    padding: 18px 24px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    font-weight: 800;
    color: var(--color-text);
    font-size: 16px;
}

.service-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    color: var(--color-muted);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--color-surface);
    transition: all 0.2s;
    text-decoration: none;
}

.service-link:last-child {
    border-bottom: none;
}

.service-link:hover {
    background: color-mix(in srgb, var(--color-focus) 10%, var(--color-surface));
    color: var(--color-focus);
    padding-left: 28px;
}

.service-link i {
    font-size: 10px;
    color: var(--color-border);
    transition: 0.2s;
}

.service-link:hover i {
    color: var(--color-focus);
    transform: translateX(3px);
}

/* --- SPECIALIZED SERVICE SECTIONS (with CSS variables) --- */

/* Scoped inside .service-text or .service-page */
.service-text .service-section,
.service-page .service-section,
.service-page .sp-section {
    padding: 40px 0;
}

.service-text .service-section h2,
.service-page .service-section h2,
.service-page .sp-section h2 {
    font-size: 24px;
    color: var(--color-navy);
    margin-bottom: 20px;
    font-weight: 700;
}

.service-text .service-section h3,
.service-page .service-section h3,
.service-page .sp-section h3 {
    font-size: 20px;
    color: var(--color-navy);
    margin: 25px 0 15px;
}

/* Info Cards / Callouts */
.service-text .info-card,
.service-page .info-card,
.service-page .sp-callout {
    background: var(--color-surface);
    border-left: 4px solid var(--color-focus);
    padding: 24px 32px;
    border-radius: 12px;
    margin: 24px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

/* Bullet Checkmarks */
.service-text .checkmark-list,
.service-page .checkmark-list,
.service-page .sp-check {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.service-text .checkmark-list li,
.service-page .checkmark-list li,
.service-page .sp-check li {
    padding: 10px 0 10px 30px;
    position: relative;
    border-bottom: 1px solid var(--color-border);
}

.service-text .checkmark-list li::before,
.service-page .checkmark-list li::before,
.service-page .sp-check li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 8px;
    color: var(--color-focus);
    font-weight: 700;
    font-size: 1.25rem;
}

/* Quick Info Grids */
.service-text .quick-info,
.service-page .quick-info,
.service-page .sp-quick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 40px 0;
}

.service-text .quick-info-item,
.service-page .quick-info-item,
.service-page .sp-quick-card {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-primary) 100%);
    color: var(--color-accent);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.service-text .quick-info-item .label,
.service-page .quick-info-item .label,
.service-page .sp-quick-label {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.8;
}

.service-text .quick-info-item .value,
.service-page .quick-info-item .value,
.service-page .sp-quick-value {
    font-size: 1.5rem;
    margin-top: 10px;
    color: var(--color-accent);
    font-weight: 700;
}

/* Treatment / Process Timelines */
.service-text .timeline,
.service-page .timeline,
.service-page .sp-timeline {
    position: relative;
    padding-left: 32px;
    border-left: 2px solid var(--color-focus);
    margin: 32px 0;
}

.service-text .timeline-item,
.service-page .timeline-item,
.service-page .sp-timeline-item {
    padding: 8px 0 24px;
    position: relative;
}

.service-text .timeline-item::before,
.service-page .timeline-item::before,
.service-page .sp-timeline-item::before {
    content: "";
    position: absolute;
    left: -41px;
    top: 14px;
    width: 16px;
    height: 16px;
    background: var(--color-focus);
    border-radius: 50%;
    border: 3px solid var(--color-surface);
    box-shadow: 0 0 0 1px var(--color-focus);
}

.service-text .timeline-item h4,
.service-page .timeline-item h4,
.service-page .sp-timeline-item h4 {
    color: var(--color-navy);
    margin-bottom: 8px;
    font-size: 1.25rem;
    font-weight: 600;
}

.service-text .timeline-item p,
.service-page .timeline-item p,
.service-page .sp-timeline-item p {
    color: var(--color-muted);
}

/* Step Progression Cards */
.service-text .step-cards,
.service-page .step-cards,
.service-page .sp-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

.service-text .step-card,
.service-page .step-card,
.service-page .sp-step {
    background: var(--color-surface);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.service-text .step-card .step-number,
.service-page .step-card .step-number,
.service-page .sp-step-num {
    font-size: 3rem;
    color: var(--color-focus);
    opacity: 0.25;
    position: absolute;
    top: -8px;
    right: 16px;
    line-height: 1;
    font-weight: 800;
}

.service-text .step-card h4,
.service-page .step-card h4,
.service-page .sp-step h4 {
    color: var(--color-navy);
    margin-bottom: 8px;
    font-size: 1.2rem;
    font-weight: 600;
}

.service-text .step-card p,
.service-page .step-card p,
.service-page .sp-step p {
    color: var(--color-muted);
}

/* Accordion FAQs inside Service Text */
.service-text .faq-item,
.service-page .faq-item,
.service-page .sp-faq-item {
    border-bottom: 1px solid var(--color-border);
    padding: 4px 0;
}

.service-text .faq-item summary,
.service-page .faq-item summary,
.service-page .sp-faq-item summary {
    font-size: 1.2rem;
    color: var(--color-navy);
    cursor: pointer;
    padding: 16px 32px 16px 0;
    list-style: none;
    position: relative;
    font-weight: 600;
}

.service-text .faq-item summary::after,
.service-page .faq-item summary::after,
.service-page .sp-faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 14px;
    color: var(--color-focus);
    font-size: 1.4rem;
    transition: transform 0.3s;
}

.service-text .faq-item[open] summary::after,
.service-page .faq-item[open] summary::after,
.service-page .sp-faq-item[open] summary::after {
    transform: rotate(45deg);
}

.service-text .faq-item p,
.service-page .faq-item p,
.service-page .sp-faq-item p {
    padding: 0 0 16px;
    color: var(--color-muted);
}

/* Technical / Compare Table */
.service-text table.tech-compare,
.service-page table.tech-compare,
.service-page .sp-tech-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.service-text table.tech-compare th,
.service-page table.tech-compare th,
.service-page .sp-tech-table th {
    background: var(--color-navy);
    color: var(--color-accent);
    padding: 14px;
    text-align: left;
    font-weight: 600;
}

.service-text table.tech-compare td,
.service-page table.tech-compare td,
.service-page .sp-tech-table td {
    padding: 14px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.service-text table.tech-compare tr:nth-child(even) td,
.service-page table.tech-compare tr:nth-child(even) td,
.service-page .sp-tech-table tr:nth-child(even) td {
    background: color-mix(in srgb, var(--color-focus) 8%, var(--color-surface));
}

/* Call to Action Box */
.service-text .cta-box,
.service-page .cta-box,
.service-page .sp-cta {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-primary) 100%);
    color: var(--color-accent);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    margin: 40px 0 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.service-text .cta-box h3,
.service-page .cta-box h3,
.service-page .sp-cta h3 {
    font-size: 2rem;
    color: var(--color-accent);
    margin-bottom: 12px;
    font-weight: 700;
}

.service-text .cta-box p,
.service-page .cta-box p,
.service-page .sp-cta p {
    color: var(--color-accent);
    opacity: 0.9;
    max-width: 540px;
    margin: 0 auto 20px;
}

.service-text .cta-button,
.service-page .cta-button,
.service-page .sp-cta-btn {
    display: inline-block;
    background: var(--color-focus);
    color: var(--color-accent);
    padding: 12px 36px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.service-text .cta-button:hover,
.service-page .cta-button:hover,
.service-page .sp-cta-btn:hover {
    background-color: var(--color-accent);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--color-focus) 25%, transparent);
}

/* --- RESPONSIVENESS AND ADJUSTMENTS --- */
@media (max-width: 992px) {
    .service-layout {
        flex-direction: column !important;
    }

    .service-sidebar-col {
        width: 100% !important;
        position: static !important;
        margin-top: 40px !important;
    }
}

@media (max-width: 768px) {
    .service-text .quick-info,
    .service-page .quick-info,
    .service-page .sp-quick {
        grid-template-columns: 1fr 1fr;
    }
    
    .service-text .service-section,
    .service-page .service-section,
    .service-page .sp-section {
        padding: 25px 0;
    }
    
    .service-title {
        font-size: 28px;
    }
}
