/**
 * Deniz Service Tools - Frontend CSS
 * Flatsome tema uyumlu, responsive, dark mode destekli
 *
 * @package DenizServiceTools
 * @since   1.0.0
 */

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
    --dst-primary: #1a5276;
    --dst-primary-light: #2980b9;
    --dst-success: #27ae60;
    --dst-success-light: #2ecc71;
    --dst-warning: #f39c12;
    --dst-danger: #e74c3c;
    --dst-info: #3498db;
    --dst-text: #2c3e50;
    --dst-text-light: #7f8c8d;
    --dst-bg: #ffffff;
    --dst-bg-alt: #f8f9fa;
    --dst-border: #e9ecef;
    --dst-radius: 12px;
    --dst-radius-sm: 8px;
    --dst-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --dst-shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --dst-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --dst-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */
.dst-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--dst-radius-sm);
    font-family: var(--dst-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--dst-transition);
    line-height: 1.4;
}
.dst-btn:hover { transform: translateY(-1px); box-shadow: var(--dst-shadow); }
.dst-btn:active { transform: translateY(0); }
.dst-btn-primary { background: var(--dst-primary); color: #fff; }
.dst-btn-primary:hover { background: var(--dst-primary-light); color: #fff; }
.dst-btn-success { background: var(--dst-success); color: #fff; }
.dst-btn-success:hover { background: var(--dst-success-light); color: #fff; }
.dst-btn-secondary { background: var(--dst-bg-alt); color: var(--dst-text); border: 1px solid var(--dst-border); }
.dst-btn-secondary:hover { background: var(--dst-border); }
.dst-btn-lg { padding: 14px 28px; font-size: 16px; }
.dst-btn-full { width: 100%; justify-content: center; }

.dst-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--dst-border);
    border-radius: var(--dst-radius-sm);
    font-family: var(--dst-font);
    font-size: 15px;
    transition: border-color var(--dst-transition);
    background: var(--dst-bg);
    color: var(--dst-text);
}
.dst-input:focus { border-color: var(--dst-primary); outline: none; box-shadow: 0 0 0 3px rgba(26,82,118,0.1); }
.dst-input-lg { padding: 16px 20px; font-size: 17px; }

/* ============================================================
   CALCULATOR
   ============================================================ */
.dst-calculator {
    max-width: 680px;
    margin: 2rem auto;
    background: var(--dst-bg);
    border-radius: var(--dst-radius);
    box-shadow: var(--dst-shadow);
    overflow: hidden;
}
.dst-calc-header {
    background: linear-gradient(135deg, var(--dst-primary), var(--dst-primary-light));
    color: #fff;
    padding: 28px 32px;
}
.dst-calc-title { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.dst-calc-subtitle { margin: 0; opacity: 0.9; font-size: 14px; }

.dst-calc-form { padding: 24px 32px; }
.dst-calc-step { display: none; }
.dst-calc-step-active { display: block; animation: dstFadeIn 0.3s ease; }

@keyframes dstFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.dst-step-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--dst-border);
}
.dst-step-num {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--dst-primary);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}
.dst-step-label { font-weight: 600; color: var(--dst-text); font-size: 16px; }

/* Service Cards */
.dst-service-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.dst-service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border: 2px solid var(--dst-border);
    border-radius: var(--dst-radius);
    background: var(--dst-bg);
    cursor: pointer;
    transition: all var(--dst-transition);
    text-align: center;
}
.dst-service-card:hover { border-color: var(--dst-primary-light); background: rgba(26,82,118,0.03); }
.dst-service-card.active { border-color: var(--dst-primary); background: rgba(26,82,118,0.06); box-shadow: 0 0 0 3px rgba(26,82,118,0.15); }
.dst-service-icon { font-size: 36px; }
.dst-service-name { font-weight: 600; font-size: 15px; color: var(--dst-text); }
.dst-service-badge { font-size: 11px; padding: 3px 8px; border-radius: 12px; background: var(--dst-warning); color: #fff; }
.dst-badge-new { background: var(--dst-success); }

/* Radio & Checkbox Cards */
.dst-radio-card, .dst-checkbox-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid var(--dst-border);
    border-radius: var(--dst-radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--dst-transition);
}
.dst-radio-card:hover, .dst-checkbox-card:hover { border-color: var(--dst-primary-light); }
.dst-radio-card:has(input:checked), .dst-checkbox-card:has(input:checked) {
    border-color: var(--dst-primary);
    background: rgba(26,82,118,0.04);
}
.dst-radio-card input, .dst-checkbox-card input { accent-color: var(--dst-primary); }
.dst-radio-label, .dst-checkbox-label { font-size: 14px; font-weight: 500; }

/* Noter Info Box */
.dst-noter-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border: 1px solid #c8e6c9;
    border-radius: var(--dst-radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #2e7d32;
}
.dst-noter-icon { font-size: 24px; flex-shrink: 0; }
.dst-noter-info-box p { margin: 0; }

/* Calculator Nav */
.dst-calc-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--dst-border);
}

/* Result */
.dst-calc-result { animation: dstFadeIn 0.4s ease; }
.dst-result-breakdown { margin-bottom: 16px; }
.dst-result-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--dst-border);
    font-size: 14px;
}
.dst-result-row-label { color: var(--dst-text); }
.dst-result-row-amount { font-weight: 600; color: var(--dst-text); }
.dst-result-row-note { color: var(--dst-text-light); font-size: 12px; margin-left: 6px; }
.dst-result-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--dst-primary), var(--dst-primary-light));
    border-radius: var(--dst-radius-sm);
    color: #fff;
    margin: 16px 0;
}
.dst-result-total-label { font-size: 16px; font-weight: 600; }
.dst-result-total-amount { font-size: 24px; font-weight: 800; }
.dst-result-disclaimer { font-size: 12px; color: var(--dst-text-light); line-height: 1.5; }

/* CTA */
.dst-calc-cta {
    padding: 24px 32px;
    background: var(--dst-bg-alt);
    border-top: 1px solid var(--dst-border);
    text-align: center;
}
.dst-calc-cta h4 { margin: 0 0 8px; font-size: 18px; color: var(--dst-text); }
.dst-calc-cta p { margin: 0 0 16px; color: var(--dst-text-light); font-size: 14px; }
.dst-cta-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   CHECKLIST
   ============================================================ */
.dst-checklist {
    max-width: 680px;
    margin: 2rem auto;
    background: var(--dst-bg);
    border-radius: var(--dst-radius);
    box-shadow: var(--dst-shadow);
    padding: 28px 32px;
}
.dst-checklist-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.dst-checklist-icon { font-size: 32px; }
.dst-checklist-title { margin: 0; font-size: 20px; flex: 1; }
.dst-checklist-progress { min-width: 120px; }
.dst-progress-bar {
    height: 8px;
    background: var(--dst-border);
    border-radius: 4px;
    overflow: hidden;
}
.dst-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dst-success), var(--dst-success-light));
    border-radius: 4px;
    transition: width 0.4s ease;
}
.dst-progress-text { font-size: 12px; font-weight: 700; color: var(--dst-success); display: block; text-align: right; margin-top: 2px; }

.dst-noter-notice {
    padding: 14px 18px;
    background: linear-gradient(135deg, #e3f2fd, #e8eaf6);
    border: 1px solid #bbdefb;
    border-radius: var(--dst-radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    color: #1565c0;
    line-height: 1.5;
}
.dst-noter-notice p { margin: 0; }

.dst-checklist-group { margin-bottom: 20px; }
.dst-group-title { font-size: 15px; font-weight: 700; color: var(--dst-primary); margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--dst-border); }

.dst-checklist-items { list-style: none; padding: 0; margin: 0; }
.dst-checklist-item { margin-bottom: 6px; }
.dst-checklist-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--dst-radius-sm);
    cursor: pointer;
    transition: background var(--dst-transition);
}
.dst-checklist-item label:hover { background: var(--dst-bg-alt); }
.dst-checklist-item:has(input:checked) label { background: rgba(39,174,96,0.06); }
.dst-checklist-item:has(input:checked) .dst-check-text { text-decoration: line-through; color: var(--dst-text-light); }

.dst-check-input { accent-color: var(--dst-success); width: 18px; height: 18px; flex-shrink: 0; }
.dst-check-text { flex: 1; font-size: 14px; }
.dst-required-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--dst-danger); color: #fff; white-space: nowrap; }
.dst-optional-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--dst-border); color: var(--dst-text-light); white-space: nowrap; }

.dst-checklist-footer { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--dst-border); }

/* ============================================================
   TRACKER
   ============================================================ */
.dst-tracker {
    max-width: 580px;
    margin: 2rem auto;
    background: var(--dst-bg);
    border-radius: var(--dst-radius);
    box-shadow: var(--dst-shadow);
    padding: 28px 32px;
}
.dst-tracker-header { text-align: center; margin-bottom: 24px; }
.dst-tracker-title { margin: 0 0 8px; font-size: 22px; }
.dst-tracker-subtitle { margin: 0; color: var(--dst-text-light); font-size: 14px; }

.dst-tracker-input-group { display: flex; gap: 10px; }
.dst-tracker-input-group .dst-input { flex: 1; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

.dst-tracker-result { margin-top: 24px; animation: dstFadeIn 0.4s ease; }
.dst-track-card {
    border: 2px solid var(--dst-border);
    border-radius: var(--dst-radius);
    overflow: hidden;
}
.dst-track-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--dst-bg-alt);
}
.dst-track-code { font-weight: 700; font-size: 18px; letter-spacing: 1px; }
.dst-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}
.dst-status-pending { background: var(--dst-warning); }
.dst-status-processing { background: var(--dst-info); }
.dst-status-document_review { background: #6f42c1; }
.dst-status-submitted { background: #8e44ad; }
.dst-status-approved { background: var(--dst-success); }
.dst-status-rejected { background: var(--dst-danger); }

.dst-track-card-body { padding: 20px; }
.dst-track-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--dst-border); font-size: 14px; }
.dst-track-row:last-child { border-bottom: none; }
.dst-track-label { color: var(--dst-text-light); }
.dst-track-value { font-weight: 600; }

/* ============================================================
   APPOINTMENT FORM
   ============================================================ */
.dst-appointment {
    max-width: 580px;
    margin: 2rem auto;
    background: var(--dst-bg);
    border-radius: var(--dst-radius);
    box-shadow: var(--dst-shadow);
    padding: 28px 32px;
}
.dst-appointment-header { text-align: center; margin-bottom: 24px; }
.dst-appointment-header h3 { margin: 0 0 8px; font-size: 22px; }
.dst-appointment-header p { margin: 0; color: var(--dst-text-light); font-size: 14px; }

.dst-form-group { margin-bottom: 16px; }
.dst-form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--dst-text); }

.dst-type-toggle { display: flex; border: 2px solid var(--dst-border); border-radius: var(--dst-radius-sm); overflow: hidden; }
.dst-toggle-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: var(--dst-bg);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--dst-transition);
    font-family: var(--dst-font);
}
.dst-toggle-btn:hover { background: var(--dst-bg-alt); }
.dst-toggle-active { background: var(--dst-primary) !important; color: #fff; }

.dst-kvkk { font-size: 13px; }
.dst-kvkk label { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.dst-kvkk input { margin-top: 3px; }

.dst-appointment-success { text-align: center; padding: 40px 20px; animation: dstFadeIn 0.4s ease; }
.dst-success-icon { font-size: 48px; margin-bottom: 12px; }

/* ============================================================
   WHATSAPP WIDGET
   ============================================================ */
.dst-wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #25d366;
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all var(--dst-transition);
}
.dst-wa-btn:hover { background: #128c7e; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(37,211,102,0.3); }
.dst-wa-link { color: #25d366; font-weight: 600; text-decoration: none; }
.dst-wa-link:hover { color: #128c7e; text-decoration: underline; }

/* Floating Widget */
.dst-wa-floating { position: fixed; bottom: 24px; right: 24px; z-index: 9999; }
.dst-wa-fab {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: #25d366;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37,211,102,0.4);
    transition: all var(--dst-transition);
    animation: dstPulse 2s infinite;
}
.dst-wa-fab:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37,211,102,0.5); }

@keyframes dstPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(37,211,102,0.4); }
    50% { box-shadow: 0 4px 24px rgba(37,211,102,0.6); }
}

.dst-wa-popup {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 320px;
    background: var(--dst-bg);
    border-radius: var(--dst-radius);
    box-shadow: var(--dst-shadow-lg);
    overflow: hidden;
    animation: dstSlideUp 0.3s ease;
}
@keyframes dstSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.dst-wa-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #075e54;
    color: #fff;
}
.dst-wa-popup-title { font-weight: 700; font-size: 15px; }
.dst-wa-popup-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; padding: 0; line-height: 1; }

.dst-wa-popup-body { padding: 16px; }
.dst-wa-greeting { font-size: 13px; color: var(--dst-text-light); margin: 0 0 14px; line-height: 1.5; }

.dst-wa-services { display: flex; flex-direction: column; gap: 6px; }
.dst-wa-service-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--dst-border);
    border-radius: var(--dst-radius-sm);
    text-decoration: none;
    color: var(--dst-text);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--dst-transition);
}
.dst-wa-service-option:hover { border-color: #25d366; background: rgba(37,211,102,0.05); color: var(--dst-text); }
.dst-wa-opt-icon { font-size: 20px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .dst-calculator, .dst-checklist, .dst-tracker, .dst-appointment { margin: 1rem; }
    .dst-calc-header, .dst-calc-form, .dst-calc-cta { padding: 20px; }
    .dst-checklist, .dst-tracker, .dst-appointment { padding: 20px; }
    .dst-service-cards { grid-template-columns: 1fr; }
    .dst-tracker-input-group { flex-direction: column; }
    .dst-cta-buttons { flex-direction: column; }
    .dst-cta-buttons .dst-btn { width: 100%; justify-content: center; }
    .dst-wa-popup { width: 280px; right: -8px; }
    .dst-wa-floating { bottom: 16px; right: 16px; }
    .dst-checklist-footer { flex-direction: column; }
    .dst-checklist-footer .dst-btn { width: 100%; justify-content: center; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .dst-wa-floating, .dst-calc-cta, .dst-calc-nav, .dst-checklist-footer { display: none !important; }
    .dst-calculator, .dst-checklist, .dst-tracker, .dst-appointment { box-shadow: none; border: 1px solid #ccc; }
    .dst-checklist-item:has(input:checked) .dst-check-text::before { content: '✓ '; color: green; }
}

/* ============================================================
   DARK MODE (prefers-color-scheme)
   ============================================================ */
@media (prefers-color-scheme: dark) {
    .dst-calc-dark {
        --dst-bg: #1a1a2e;
        --dst-bg-alt: #16213e;
        --dst-text: #e0e0e0;
        --dst-text-light: #a0a0a0;
        --dst-border: #2a2a4a;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   ERROR STATE
   ============================================================ */
.dst-error {
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--dst-radius-sm);
    color: var(--dst-danger);
    font-size: 14px;
}
