/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3ab5c0;
    --primary-dark: #2a9aa5;
    --primary-light: #e0f6f8;
    --secondary: #7ED321;
    --dark: #2C3E50;
    --light: #ECF0F1;
    --white: #FFFFFF;
    --gray: #95A5A6;
    --success: #27AE60;
    --warning: #F39C12;
    --danger: #E74C3C;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --dark: #ECF0F1;
    --light: #1a1a1a;
    --white: #2d2d2d;
    --gray: #b0b0b0;
    --shadow: 0 2px 10px rgba(0,0,0,0.5);
}

[data-theme="dark"] body {
    background: #1a1a1a;
    color: #ECF0F1;
}

[data-theme="dark"] .header {
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
}

[data-theme="dark"] .category-card,
[data-theme="dark"] .psychologist-card,
[data-theme="dark"] .article-card {
    background: #2d2d2d;
    border: 1px solid #404040;
}

[data-theme="dark"] .form-control {
    background: #2d2d2d;
    border-color: #404040;
    color: #ECF0F1;
}

[data-theme="dark"] .lang-btn {
    background: #2d2d2d;
    border-color: #404040;
    color: #ECF0F1;
}

[data-theme="dark"] .lang-btn:hover {
    background: #404040;
}

[data-theme="dark"] .lang-menu {
    background: #2d2d2d;
    border-color: #404040;
}

[data-theme="dark"] .lang-option:hover {
    background: #404040;
}

[data-theme="dark"] .nav {
    background: #2d2d2d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav a {
    text-decoration: none;
    color: var(--dark);
    transition: color 0.3s;
}

.nav a:hover {
    color: var(--primary);
}

.notification-bell {
    position: relative;
    display: inline-block;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: var(--white);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Hero Section */
.hero {
    background: #ffffff;
    color: #1a1a2e;
    padding: 70px 0 60px;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #e0f6f8;
    color: #3ab5c0;
    padding: 7px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-left h1 {
    font-size: clamp(32px, 4.5vw, 54px);
    font-weight: 800;
    line-height: 1.12;
    margin-bottom: 20px;
    color: #1a1a2e;
    letter-spacing: -1px;
}

.hero-accent {
    color: #3ab5c0;
}

.hero-left p {
    font-size: 15px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 32px;
    max-width: 400px;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 44px;
}

.btn-hero-primary {
    background: #3ab5c0;
    color: #fff;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .2s;
    border: none;
}
.btn-hero-primary:hover { background: #2a9aa5; }

.btn-hero-outline {
    background: #fff;
    color: #1a1a2e;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid #e0e0e0;
    transition: border-color .2s, background .2s;
}
.btn-hero-outline:hover { border-color: #1a1a2e; background: #f9f9f9; }

.hero-stats {
    display: flex;
    gap: 36px;
    flex-wrap: wrap;
}

.hero-stat-val {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}

.hero-stat-lbl {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Hero right image */
.hero-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.hero-img-wrap {
    position: relative;
    width: 100%;
    max-width: 440px;
}

.hero-photo {
    width: 100%;
    height: 460px;
    object-fit: cover;
    object-position: center top;
    border-radius: 24px;
    display: block;
    box-shadow: 0 20px 60px rgba(0,0,0,.12);
}

.hero-illustration {
    width: 100%;
    height: 460px;
    border-radius: 24px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    align-items: center;
    justify-content: center;
    font-size: 120px;
    color: rgba(255,255,255,.3);
}

/* ── Hero Float Badges ─────────────────────────────────────── */
@keyframes floatBadgeIn-tl {
    0%   { opacity: 0; transform: translate(-18px, -18px) scale(.85); }
    60%  { transform: translate(4px, 4px) scale(1.03); }
    100% { opacity: 1; transform: translate(0, 0) scale(1); }
}
@keyframes floatBadgeIn-br {
    0%   { opacity: 0; transform: translate(18px, 18px) scale(.85); }
    60%  { transform: translate(-4px, -4px) scale(1.03); }
    100% { opacity: 1; transform: translate(0, 0) scale(1); }
}
@keyframes badgeFloat {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-7px); }
}
@keyframes badgeShimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes iconPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(58,181,192,.35); }
    50%       { box-shadow: 0 0 0 8px rgba(58,181,192,0); }
}
@keyframes iconPulseGreen {
    0%, 100% { box-shadow: 0 0 0 0 rgba(39,174,96,.35); }
    50%       { box-shadow: 0 0 0 8px rgba(39,174,96,0); }
}
@keyframes dotBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: .3; }
}

.hero-float {
    position: absolute;
    background: #fff;
    border-radius: 16px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
    min-width: 178px;
    z-index: 2;
    opacity: 0;
    transition: box-shadow .3s, transform .3s;
    will-change: transform, opacity;
}
.hero-float:hover {
    box-shadow: 0 16px 48px rgba(0,0,0,.18), 0 4px 12px rgba(58,181,192,.15);
    transform: translateY(-3px) !important;
}

/* Entrance + continuous float */
.hero-float-tl {
    top: 30px; left: -30px;
    animation:
        floatBadgeIn-tl .7s cubic-bezier(.34,1.56,.64,1) .3s forwards,
        badgeFloat 4s ease-in-out 1.2s infinite;
}
.hero-float-br {
    bottom: 40px; right: -24px;
    animation:
        floatBadgeIn-br .7s cubic-bezier(.34,1.56,.64,1) .6s forwards,
        badgeFloat 4s ease-in-out 1.5s infinite;
}

.hero-float-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: transform .3s;
}
.hero-float:hover .hero-float-icon { transform: scale(1.12) rotate(-5deg); }

/* Pulse ring on icon */
.hero-float-tl .hero-float-icon { animation: iconPulseGreen 2.5s ease-in-out 1.5s infinite; }
.hero-float-br .hero-float-icon { animation: iconPulse 2.5s ease-in-out 1.8s infinite; }

.hero-float-title {
    font-size: 13px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.3;
    /* shimmer sweep on load */
    background: linear-gradient(90deg, #1a1a2e 30%, #3ab5c0 50%, #1a1a2e 70%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: badgeShimmer 2.8s linear 1s 2;
}

.hero-float-sub {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Live dot on "24/7 tersedia" */
.hero-float-br .hero-float-sub::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3ab5c0;
    flex-shrink: 0;
    animation: dotBlink 1.4s ease-in-out infinite;
}

/* Lock dot on "Data terenkripsi" */
.hero-float-tl .hero-float-sub::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #27AE60;
    flex-shrink: 0;
    animation: dotBlink 1.8s ease-in-out .4s infinite;
}

@media (max-width: 900px) {
    .hero-content { grid-template-columns: 1fr; gap: 40px; }
    .hero-right { justify-content: center; }
    .hero-img-wrap { max-width: 360px; }
    .hero-float-tl { left: -10px; }
    .hero-float-br { right: -10px; }
    .hero-left p { max-width: 100%; }
}

@media (max-width: 480px) {
    .hero-right { display: none; }
}


/* Sections */
section {
    padding: 60px 0;
}

section h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 40px;
    color: var(--dark);
}

/* Home sections */
.home-section { padding: 70px 0; }

.section-head {
    text-align: center;
    margin-bottom: 44px;
}
.section-head h2 {
    font-size: clamp(22px,3vw,32px);
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 10px;
}
.section-head p {
    font-size: 15px;
    color: #888;
}

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media(max-width:900px){ .features-grid{ grid-template-columns: repeat(2,1fr); } }
@media(max-width:480px){ .features-grid{ grid-template-columns: 1fr; } }

.feature-card {
    background: #fff;
    border: 1.5px solid #e8eaf0;
    border-radius: 16px;
    padding: 28px 24px;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.feature-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.07);
    transform: translateY(-3px);
}
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 20px;
    flex-shrink: 0;
}
.feature-card h3 { font-size: 15px; font-weight: 700; color: #1a1a2e; margin-bottom: 10px; }
.feature-card p  { font-size: 13px; color: #6b7280; line-height: 1.65; margin: 0; }


/* Categories */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

/* Psychologist Cards */
.psychologist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.psychologist-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.psychologist-card:hover {
    transform: translateY(-5px);
}

.psychologist-card img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    margin: 20px auto 0;
    border: 3px solid var(--primary);
}

.psychologist-info {
    padding: 20px;
}

.psychologist-info h3 {
    margin-bottom: 10px;
}

.specialization {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 10px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.rating i {
    color: var(--warning);
}

.price {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
    margin: 15px 0;
}

/* Articles */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.article-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.article-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: 20px;
}

.article-meta {
    display: flex;
    gap: 15px;
    color: var(--gray);
    font-size: 14px;
    margin: 10px 0;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3, .footer-section h4 {
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: var(--light);
    text-decoration: none;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: background .2s;
}
.social-links a:hover { background: var(--primary-dark); }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Dark Mode Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--dark);
    transition: all 0.3s;
}

.theme-toggle:hover {
    background: #f5f5f5;
    border-color: var(--primary);
}

[data-theme="dark"] .theme-toggle {
    border-color: #404040;
    color: #ECF0F1;
}

[data-theme="dark"] .theme-toggle:hover {
    background: #404040;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
    }
    
    .nav.active {
        display: flex;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
}


/* PWA Install Prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 20px;
    max-width: 400px;
    width: 90%;
    z-index: 10000;
    animation: slideUp 0.3s ease;
}

.pwa-prompt-content {
    text-align: center;
    position: relative;
}

.pwa-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.pwa-prompt-content i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 10px;
}

.pwa-prompt-content h3 {
    margin: 10px 0;
    color: var(--dark);
}

.pwa-prompt-content p {
    margin: 10px 0 20px;
    color: var(--gray);
}

.pwa-prompt-content .btn {
    margin: 5px;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* PWA Mode Adjustments */
.pwa-mode .header {
    padding-top: env(safe-area-inset-top);
}

/* Dark Mode for PWA Prompt */
[data-theme="dark"] .pwa-install-prompt {
    background: #2d2d2d;
    border: 1px solid #404040;
}

[data-theme="dark"] .pwa-prompt-content h3 {
    color: #ECF0F1;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--warning);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    display: none;
}

.offline-indicator.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}


/* WebRTC Video Call Styles */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
    z-index: 10000;
}

.video-container.active {
    display: flex;
    flex-direction: column;
}

.video-main {
    flex: 1;
    position: relative;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

#remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

#localVideo {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    background: #2d2d2d;
}

.video-controls {
    background: rgba(0,0,0,0.9);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    min-height: 100px;
}

.video-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.video-btn.mute {
    background: #4A90E2;
    color: white;
}

.video-btn.mute.active {
    background: #E74C3C;
}

.video-btn.video {
    background: #4A90E2;
    color: white;
}

.video-btn.video.active {
    background: #E74C3C;
}

.video-btn.end {
    background: #E74C3C;
    color: white;
    width: 80px;
}

.video-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.video-btn:active {
    transform: scale(0.95);
}

.call-status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.call-buttons {
    display: flex;
    gap: 10px;
}

.call-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.call-btn.audio {
    background: #27AE60;
    color: white;
}

.call-btn.audio:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39,174,96,0.3);
}

.call-btn.video {
    background: #4A90E2;
    color: white;
}

.call-btn.video:hover {
    background: #357ABD;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74,144,226,0.3);
}

.call-btn:active {
    transform: translateY(0);
}

/* Responsive WebRTC */
@media (max-width: 768px) {
    #localVideo {
        width: 120px;
        height: 90px;
        bottom: 100px;
        right: 10px;
    }
    
    .video-controls {
        padding: 15px;
        gap: 10px;
    }
    
    .video-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .video-btn.end {
        width: 70px;
    }
    
    .call-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .call-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* Dark mode for WebRTC */
[data-theme="dark"] .call-btn.audio {
    background: #229954;
}

[data-theme="dark"] .call-btn.video {
    background: #357ABD;
}

/* Loading animation for call */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.call-status.connecting {
    animation: pulse 1.5s ease-in-out infinite;
}

/* No video placeholder */
.video-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.video-placeholder i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.video-placeholder p {
    font-size: 18px;
    opacity: 0.7;
}
