/* =========================================================
   Caando public polish V20.7
   Header theme switch + clearer city hero + footer motion
   ========================================================= */

:root {
    --caando-polish-blue: #2563eb;
    --caando-polish-cyan: #0ea5e9;
    --caando-polish-navy: #153c61;
    --caando-polish-line: #c9deef;
    --caando-polish-text: #173550;
}

/* ---------- Header ---------- */
.caando-site-header {
    background: rgba(238, 247, 253, .94) !important;
    border-bottom-color: rgba(61, 112, 153, .16) !important;
    box-shadow: 0 8px 28px rgba(29, 72, 111, .08) !important;
}

.caando-role-header {
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(238,247,253,.98)) !important;
    border-color: #c8deee !important;
    box-shadow: 0 14px 34px rgba(31, 77, 115, .10) !important;
}

.caando-role-nav a,
.caando-login-btn,
.caando-role-user .caando-logout-btn,
.caando-role-user > span {
    background: #f3f8fc !important;
    border-color: #c9ddec !important;
    color: #214e72 !important;
}

.caando-role-nav a:hover,
.caando-login-btn:hover,
.caando-role-user .caando-logout-btn:hover {
    color: #0b63d9 !important;
    border-color: #83b9e2 !important;
    background: #eaf5ff !important;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .12) !important;
}

/* ---------- Day / night switch ---------- */
.caando-theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 5px 9px 5px 11px;
    border: 1px solid #c6dbea;
    border-radius: 999px;
    background: #f2f8fc;
    color: #28516f;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease, color .22s ease;
}

.caando-theme-toggle:hover {
    transform: translateY(-2px);
    border-color: #7eb6df;
    background: #e7f4ff;
    box-shadow: 0 9px 22px rgba(37,99,235,.12);
}

.caando-theme-toggle-track {
    position: relative;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff7d6, #ffd45f);
    box-shadow: inset 0 0 0 1px rgba(190, 136, 0, .12), 0 5px 13px rgba(245, 158, 11, .18);
    overflow: hidden;
    transition: background .35s ease, box-shadow .35s ease, transform .35s ease;
}

.caando-theme-icon {
    position: absolute;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity .28s ease, transform .38s cubic-bezier(.2,.8,.2,1);
}

.caando-theme-icon-sun { color: #ad6b00; opacity: 1; transform: rotate(0) scale(1); }
.caando-theme-icon-moon { color: #dcecff; opacity: 0; transform: rotate(-55deg) scale(.55); }

html[data-caando-theme="dark"] .caando-theme-icon-sun { opacity: 0; transform: rotate(55deg) scale(.55); }
html[data-caando-theme="dark"] .caando-theme-icon-moon { opacity: 1; transform: rotate(0) scale(1); }
html[data-caando-theme="dark"] .caando-theme-toggle-track {
    background: linear-gradient(135deg, #173d68, #0b1f39);
    box-shadow: inset 0 0 0 1px rgba(125,211,252,.18), 0 6px 16px rgba(0,0,0,.25);
    transform: rotate(8deg);
}

/* ---------- Clear city hero ---------- */
.caando-home .hero-section {
    background-image: url('/images/caando-city-hero-v5.webp?v=6') !important;
    background-position: center 56% !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    filter: none !important;
}

.caando-home .hero-section::before {
    background: linear-gradient(180deg, rgba(9, 30, 53, .12) 0%, rgba(5, 21, 39, .18) 55%, rgba(3, 15, 30, .28) 100%) !important;
}

.caando-home .hero-section::after {
    background: linear-gradient(90deg, rgba(37,99,235,.10), transparent 34%, transparent 66%, rgba(14,165,233,.08)) !important;
    animation: none !important;
}

.caando-home .hero-title-wrap h1 {
    text-shadow: 0 4px 18px rgba(0,0,0,.56), 0 16px 46px rgba(0,0,0,.25) !important;
}

.caando-home .hero-title-wrap p {
    color: #f1f7fc !important;
    text-shadow: 0 3px 14px rgba(0,0,0,.5);
}

.caando-home .brand-pill {
    color: #fff !important;
    background: rgba(9, 38, 67, .58) !important;
    border-color: rgba(255,255,255,.32) !important;
    backdrop-filter: blur(6px);
}

.caando-home .search-panel {
    background: rgba(7, 28, 51, .68) !important;
    backdrop-filter: blur(5px) saturate(115%) !important;
    -webkit-backdrop-filter: blur(5px) saturate(115%) !important;
    border-color: rgba(191, 226, 250, .28) !important;
    box-shadow: 0 28px 80px rgba(0,0,0,.30) !important;
}

/* ---------- Footer contact ---------- */
.footer-contact-items .footer-contact-item {
    min-height: 58px;
    padding: 8px 13px;
}

.footer-contact-icon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #e7f3ff;
    color: #176bd4;
    transition: transform .24s ease, background .24s ease, color .24s ease;
}

.footer-contact-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-contact-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.footer-contact-copy small {
    color: #7b91a8;
    font-size: 10px;
    font-weight: 800;
}

.footer-contact-copy strong {
    color: #304f6b;
    font-size: 12px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.footer-contact-items .footer-contact-item:hover .footer-contact-icon {
    transform: translateY(-2px) rotate(-5deg) scale(1.06);
    background: #2563eb;
    color: #fff;
}

/* ---------- Trust chips: soft animated blue hover ---------- */
.footer-trust-chips span {
    transition: transform .25s ease, background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.footer-trust-chips span b {
    transition: background .3s ease, color .3s ease, transform .45s ease;
}

.footer-trust-chips span:hover {
    transform: translateY(-4px);
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 12px 28px rgba(37,99,235,.20);
}

.footer-trust-chips span:hover b {
    background: #fff;
    color: #2563eb;
    transform: rotate(360deg);
}

/* ---------- Social icons ---------- */
.footer-social-links a {
    width: 44px;
    height: 44px;
    overflow: hidden;
    transition: transform .3s cubic-bezier(.2,.8,.2,1), background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease !important;
}

.footer-social-links svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .3s ease;
}

.footer-social-links svg .social-fill { fill: currentColor; stroke: none; }
.footer-social-links a:hover {
    transform: translateY(-5px) scale(1.08) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 13px 28px rgba(37,99,235,.24) !important;
}
.footer-social-links a:hover svg { transform: rotate(-7deg) scale(1.04); }
.footer-social-links .social-instagram:hover { background: linear-gradient(135deg,#7c3aed,#db2777,#f97316); }
.footer-social-links .social-telegram:hover { background: linear-gradient(135deg,#229ED9,#0b77b4); }
.footer-social-links .social-bale:hover { background: linear-gradient(135deg,#2563eb,#0ea5e9); }

/* ---------- App icon ---------- */
.footer-app-icon {
    position: relative;
    isolation: isolate;
    overflow: visible;
    transition: transform .32s cubic-bezier(.2,.8,.2,1), box-shadow .32s ease;
}

.footer-app-icon svg {
    position: relative;
    z-index: 2;
    width: 31px;
    height: 31px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-app-check { stroke-width: 2.1; }
.footer-app-glow {
    position: absolute;
    z-index: 0;
    inset: -7px;
    border-radius: 22px;
    background: rgba(37,99,235,.18);
    opacity: .45;
    animation: caandoAppPulse 2.7s ease-in-out infinite;
}

.footer-app-block:hover .footer-app-icon {
    transform: translateY(-6px) rotate(-4deg) scale(1.08);
    box-shadow: 0 18px 38px rgba(37,99,235,.32);
}
.footer-app-block:hover .footer-app-glow { animation-duration: 1.15s; }

@keyframes caandoAppPulse {
    0%,100% { transform: scale(.9); opacity: .18; }
    50% { transform: scale(1.15); opacity: .52; }
}

/* ---------- Dark mode ---------- */
html[data-caando-theme="dark"],
html[data-caando-theme="dark"] body.caando-public-theme,
html[data-caando-theme="dark"] .caando-page-frame {
    background: #06111f !important;
    color: #eaf4ff !important;
}

html[data-caando-theme="dark"] .caando-site-header {
    background: rgba(4, 15, 29, .93) !important;
    border-bottom-color: rgba(125,211,252,.14) !important;
    box-shadow: 0 8px 30px rgba(0,0,0,.24) !important;
}

html[data-caando-theme="dark"] .caando-role-header {
    background: linear-gradient(135deg, rgba(10,31,54,.97), rgba(5,20,38,.98)) !important;
    border-color: rgba(125,211,252,.19) !important;
    box-shadow: 0 16px 38px rgba(0,0,0,.26) !important;
}

html[data-caando-theme="dark"] .caando-role-nav a,
html[data-caando-theme="dark"] .caando-login-btn,
html[data-caando-theme="dark"] .caando-role-user .caando-logout-btn,
html[data-caando-theme="dark"] .caando-role-user > span,
html[data-caando-theme="dark"] .caando-theme-toggle {
    background: rgba(10, 37, 63, .86) !important;
    border-color: rgba(125,211,252,.19) !important;
    color: #d9edff !important;
}

html[data-caando-theme="dark"] .caando-role-nav a:hover,
html[data-caando-theme="dark"] .caando-login-btn:hover,
html[data-caando-theme="dark"] .caando-role-user .caando-logout-btn:hover,
html[data-caando-theme="dark"] .caando-theme-toggle:hover {
    background: rgba(37,99,235,.24) !important;
    border-color: rgba(56,189,248,.48) !important;
    color: #fff !important;
    box-shadow: 0 10px 28px rgba(0,0,0,.22) !important;
}

html[data-caando-theme="dark"] .caando-role-user,
html[data-caando-theme="dark"] .caando-role-user strong { color: #d5e8f9 !important; }

html[data-caando-theme="dark"] .caando-home-v206,
html[data-caando-theme="dark"] .home-showcase-section,
html[data-caando-theme="dark"] .caando-rich-footer {
    background: #071523 !important;
    color: #e9f4ff !important;
}

html[data-caando-theme="dark"] .home-section-title-copy h2,
html[data-caando-theme="dark"] .footer-about-copy h3,
html[data-caando-theme="dark"] .footer-trust-box h3,
html[data-caando-theme="dark"] .footer-app-social h3,
html[data-caando-theme="dark"] .footer-contact-title h2 { color: #f1f8ff !important; }

html[data-caando-theme="dark"] .home-section-title-copy p,
html[data-caando-theme="dark"] .footer-about-copy p,
html[data-caando-theme="dark"] .footer-app-copy p { color: #9bb2c8 !important; }

html[data-caando-theme="dark"] :where(.featured-property-card,.agency-showcase-card,.latest-property-card,.home-article-card,.footer-contact-panel,.footer-app-social,.footer-enamad-image,.footer-enamad-placeholder) {
    background: #0b2036 !important;
    border-color: rgba(125,211,252,.15) !important;
    color: #eaf4ff !important;
    box-shadow: 0 18px 48px rgba(0,0,0,.22) !important;
}

html[data-caando-theme="dark"] :where(.featured-property-card,.agency-showcase-card,.latest-property-card,.home-article-card) :where(h3,strong) { color: #f3f8ff !important; }
html[data-caando-theme="dark"] :where(.featured-property-card,.agency-showcase-card,.latest-property-card,.home-article-card) :where(p,small,span) { color: #9eb5ca; }

html[data-caando-theme="dark"] .footer-contact-items .footer-contact-item,
html[data-caando-theme="dark"] .footer-trust-chips span,
html[data-caando-theme="dark"] .footer-social-links a,
html[data-caando-theme="dark"] .footer-app-links a {
    background: #0b2138 !important;
    border-color: rgba(125,211,252,.16) !important;
    color: #d9ebfa !important;
}
html[data-caando-theme="dark"] .footer-contact-copy strong { color: #e8f4ff; }
html[data-caando-theme="dark"] .footer-contact-copy small { color: #8ea9c0; }
html[data-caando-theme="dark"] .footer-contact-icon { background: #102c49; color: #7dd3fc; }

html[data-caando-theme="dark"] .footer-title-line { background: linear-gradient(90deg,#38bdf8 0 24%,rgba(125,211,252,.12) 24% 100%); }
html[data-caando-theme="dark"] .footer-corevia-line a { color: #8ea7bd; }
html[data-caando-theme="dark"] .footer-corevia-line a:hover { color: #7dd3fc; }

html[data-caando-theme="dark"] .caando-public-theme :where(.agency-panel,.agency-edit-card,.agency-staff-shell,.crm-card,.form-card,.property-details-card,.search-filter-card,.membership-card,.normal-register-card,.support-card,.profile-card,.plan-card,.dashboard-card,.finance-entry-card,.finance-report-card) {
    background: #0a1e33 !important;
    color: #e7f2fc !important;
    border-color: rgba(125,211,252,.15) !important;
    box-shadow: 0 16px 44px rgba(0,0,0,.18) !important;
}

html[data-caando-theme="dark"] .caando-public-theme :where(input,select,textarea) {
    background: #07182a !important;
    color: #e9f5ff !important;
    border-color: rgba(125,211,252,.20) !important;
}

html[data-caando-theme="dark"] .caando-public-theme :where(.agency-table,.crm-table,.dashboard-table,.finance-table) th {
    background: #0f2b48 !important;
    color: #cdeaff !important;
    border-color: rgba(125,211,252,.15) !important;
}
html[data-caando-theme="dark"] .caando-public-theme :where(.agency-table,.crm-table,.dashboard-table,.finance-table) td {
    background: #091c30 !important;
    color: #dcecf9 !important;
    border-color: rgba(125,211,252,.12) !important;
}

@media (max-width: 768px) {
    .caando-home .hero-section {
        background-position: 58% center !important;
    }
    .caando-theme-toggle-label { display: none; }
    .caando-theme-toggle { padding: 4px; min-width: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    .footer-app-glow { animation: none; }
    .caando-theme-toggle,
    .caando-theme-icon,
    .footer-trust-chips span,
    .footer-social-links a,
    .footer-app-icon { transition: none !important; }
}

/* Dark-mode finishing touches */
html[data-caando-theme="dark"] .caando-home .hero-section {
    background-image: url('/images/caando-tehran-blue-night.webp?v=1') !important;
}

html[data-caando-theme="dark"] .caando-home .hero-section::before {
    background: linear-gradient(180deg, rgba(2,8,23,.18), rgba(2,8,23,.30) 58%, rgba(2,8,23,.42)) !important;
}

html[data-caando-theme="dark"] .caando-public-theme :where(p,small,.muted,.text-muted) {
    color: #9cb4ca !important;
}

html[data-caando-theme="dark"] .footer-trust-chips span:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

html[data-caando-theme="dark"] .footer-social-links .social-instagram:hover {
    background: linear-gradient(135deg,#7c3aed,#db2777,#f97316) !important;
}
html[data-caando-theme="dark"] .footer-social-links .social-telegram:hover {
    background: linear-gradient(135deg,#229ED9,#0b77b4) !important;
}
html[data-caando-theme="dark"] .footer-social-links .social-bale:hover {
    background: linear-gradient(135deg,#2563eb,#0ea5e9) !important;
}


/* V20.9 floating WhatsApp support */
.caando-whatsapp-float{
    position:fixed;
    left:24px;
    bottom:24px;
    z-index:1150;
    display:flex;
    align-items:center;
    gap:10px;
    text-decoration:none!important;
    direction:rtl;
    filter:drop-shadow(0 14px 24px rgba(5,150,105,.24));
}
.caando-whatsapp-icon{
    position:relative;
    width:58px;
    height:58px;
    flex:0 0 58px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:linear-gradient(145deg,#2bd66f,#16a34a);
    border:2px solid rgba(255,255,255,.92);
    color:#fff;
    transition:transform .22s ease,box-shadow .22s ease,filter .22s ease;
    box-shadow:0 10px 28px rgba(22,163,74,.30);
}
.caando-whatsapp-icon::before{
    content:"";
    position:absolute;
    inset:-7px;
    border:1px solid rgba(34,197,94,.32);
    border-radius:50%;
    animation:caandoWhatsappPulse 2.2s ease-out infinite;
}
.caando-whatsapp-icon svg{width:31px;height:31px;fill:#fff;display:block}
.caando-whatsapp-icon svg path:first-child{fill:none;stroke:#fff;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round}
.caando-whatsapp-icon svg path:last-child{fill:#fff;stroke:none}
.caando-whatsapp-label{
    max-width:0;
    overflow:hidden;
    opacity:0;
    white-space:nowrap;
    padding:10px 0;
    border-radius:12px;
    background:#fff;
    color:#14532d;
    font-size:12px;
    font-weight:900;
    box-shadow:0 10px 28px rgba(15,23,42,.12);
    transition:max-width .25s ease,opacity .2s ease,padding .25s ease,transform .25s ease;
    transform:translateX(-8px);
}
.caando-whatsapp-float:hover .caando-whatsapp-icon,
.caando-whatsapp-float:focus-visible .caando-whatsapp-icon{transform:translateY(-4px) scale(1.06);filter:saturate(1.08);box-shadow:0 16px 34px rgba(22,163,74,.38)}
.caando-whatsapp-float:hover .caando-whatsapp-label,
.caando-whatsapp-float:focus-visible .caando-whatsapp-label{max-width:180px;opacity:1;padding:10px 13px;transform:none}
html[data-caando-theme="dark"] .caando-whatsapp-label{background:#0b2036;color:#dcfce7;border:1px solid rgba(74,222,128,.18)}
@keyframes caandoWhatsappPulse{0%{transform:scale(.92);opacity:.75}70%,100%{transform:scale(1.18);opacity:0}}
@media(max-width:768px){.caando-whatsapp-float{left:15px;bottom:16px}.caando-whatsapp-icon{width:54px;height:54px;flex-basis:54px}.caando-whatsapp-label{display:none}}
@media(prefers-reduced-motion:reduce){.caando-whatsapp-icon::before{animation:none}.caando-whatsapp-icon,.caando-whatsapp-label{transition:none!important}}
