/*
Theme Name: Blocksy Child Theme 14
Theme URI: https://dramatv.com
Author: CallFun Team
Description: CallFun - a mobile-first prank video call theme. Models, categories and call videos come from a single embedded JSON file (data/callfun.json) - no API calls.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blocksy-child-theme-14
Tags: custom-theme, json-data, video-call, prank, entertainment, mobile-first
*/

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
    --bg: #0b0314;
    --bg-deep: #07020d;
    --text: #ffffff;
    --muted: #8d8496;
    --pink: #fc3a9c;
    --purple: #a322ee;
    --grad: linear-gradient(90deg, #fc3a9c 0%, #a322ee 100%);
    --card-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.07) 100%);
    --card-border: rgba(240, 80, 200, 0.5);
    --online: #22c55e;
    --offline: #ef4444;
    --radius: 10px;
    --app-max: 480px;
    --nav-h: 62px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    background: var(--bg-deep);
}

body {
    min-height: 100vh;
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(60% 40% at 50% 18%, rgba(120, 20, 160, 0.45) 0%, rgba(120, 20, 160, 0) 70%),
        radial-gradient(70% 35% at 50% 70%, rgba(95, 10, 120, 0.35) 0%, rgba(95, 10, 120, 0) 70%),
        linear-gradient(180deg, #0b0314 0%, #1a0628 45%, #0b0314 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

.cf-svg {
    display: block;
    flex-shrink: 0;
}

/* ==========================================================================
   App shell
   ========================================================================== */

.cf-app {
    max-width: var(--app-max);
    margin: 0 auto;
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 24px);
}

.cf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 8px;
}

.cf-logo {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    object-fit: cover;
}

.cf-logo--default {
    display: grid;
    place-items: center;
    background: var(--grad);
    color: #fff;
    box-shadow: 0 0 14px rgba(252, 58, 156, 0.45);
}

.cf-header-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.cf-header--inner {
    justify-content: flex-start;
    gap: 10px;
    padding-top: 16px;
}

.cf-back {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.cf-page-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 18px;
    font-weight: 600;
}

/* ==========================================================================
   Sections + cards (home / view all)
   ========================================================================== */

.cf-section {
    margin-top: 14px;
}

.cf-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    margin-bottom: 10px;
}

.cf-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.cf-section-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.cf-view-all {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 7px 3px 9px;
    font-size: 10px;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    white-space: nowrap;
}

.cf-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 16px 4px;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    scrollbar-width: none;
}

.cf-row::-webkit-scrollbar {
    display: none;
}

.cf-row .cf-card {
    flex: 0 0 120px;
    scroll-snap-align: start;
}

.cf-card {
    position: relative;
    display: block;
    height: 140px;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    background-size: cover;
    background-position: center top;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cf-card.has-photo::after {
    content: '';
    position: absolute;
    inset: 45% 0 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.cf-card:active {
    transform: scale(0.97);
}

@media (hover: hover) {
    .cf-card:hover {
        box-shadow: 0 0 16px rgba(252, 58, 156, 0.35);
    }
}

.cf-status {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px 2px 5px;
    font-size: 8.5px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 10px;
}

.cf-status i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--online);
}

.cf-status--offline i {
    background: var(--offline);
}

.cf-card-name {
    position: absolute;
    left: 9px;
    bottom: 12px;
    z-index: 1;
    max-width: calc(100% - 52px);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-card-call {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 1;
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 0 8px rgba(252, 58, 156, 0.55));
}

/* View-all (category) screen: 2 large cards per row */
.cf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 22px;
    padding: 0 16px;
}

.callfun-category .cf-header {
    padding-bottom: 16px;
}

.cf-grid + .cf-ad,
.cf-grid {
    margin-bottom: 15px;
}

.cf-grid .cf-card {
    height: auto;
    aspect-ratio: 153 / 178;
    border-radius: 12px;
}

.cf-grid .cf-status {
    top: 10px;
    left: 10px;
    padding: 3px 8px 3px 6px;
    font-size: 10px;
    gap: 4px;
}

.cf-grid .cf-status i {
    width: 6px;
    height: 6px;
}

.cf-grid .cf-card-name {
    left: 10px;
    bottom: 13px;
    max-width: calc(100% - 64px);
    font-size: 18px;
}

.cf-grid .cf-card-call {
    right: 8px;
    bottom: 8px;
    width: 44px;
    height: 44px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.cf-cta-wrap {
    display: flex;
    justify-content: center;
    padding: 18px 16px 6px;
}

.cf-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 262px;
    max-width: 100%;
    height: 50px;
    padding: 0 22px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--grad);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 26px;
    box-shadow: 0 0 26px rgba(252, 58, 156, 0.5), 0 0 60px rgba(163, 34, 238, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cf-cta:active {
    transform: scale(0.97);
}

.cf-cta--small {
    width: 100%;
    height: 46px;
    font-size: 15px;
}

.cf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 22px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--grad);
    border-radius: 22px;
}

.cf-btn--ghost {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.cf-link {
    font-size: 13px;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ==========================================================================
   Ads (visible + labelled)
   ========================================================================== */

.cf-ad {
    margin: 20px 16px 6px;
    text-align: center;
}

.cf-ad-label {
    display: block;
    margin-bottom: 4px;
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
}

.cf-ad-slot {
    display: flex;
    justify-content: center;
}

/* Label + spacing only once an ad is actually served */
.cf-ad:not(.is-filled) {
    margin-top: 0;
    margin-bottom: 0;
}

.cf-ad:not(.is-filled) .cf-ad-label {
    display: none;
}

/* Keep theme 13 bottom banner above the bottom nav */
body.callfun:not(.callfun-call) #bottom-ad-container {
    bottom: calc(var(--nav-h) + var(--safe-bottom));
}

body.callfun-call #bottom-ad-container,
body.callfun-call #floatingRightWrapper,
body.callfun-call #outstreamAdContainer {
    display: none !important;
}

/* ==========================================================================
   Bottom navigation
   ========================================================================== */

.cf-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 10000;
    transform: translateX(-50%);
    display: flex;
    width: 100%;
    max-width: var(--app-max);
    height: calc(var(--nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(14, 4, 24, 0.92);
    border-top: 1px solid rgba(240, 80, 200, 0.22);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.cf-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    color: var(--muted);
}

.cf-nav-item.is-active {
    color: #fff;
}

.cf-nav-item.is-active .cf-svg {
    color: var(--pink);
    filter: drop-shadow(0 0 6px rgba(252, 58, 156, 0.6));
}

/* ==========================================================================
   Empty states, disclaimer
   ========================================================================== */

.cf-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 70px 24px 30px;
    text-align: center;
}

.cf-empty-title {
    font-size: 18px;
    font-weight: 600;
}

.cf-empty-text {
    max-width: 280px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin: 0 auto 8px;
}

.cf-disclaimer {
    margin: 26px 16px 0;
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    opacity: 0.8;
}

/* ==========================================================================
   Recent calls
   ========================================================================== */

.cf-recent {
    list-style: none;
    padding: 6px 16px 0;
}

.cf-recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cf-recent-avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 600;
    background: var(--card-bg);
    background-size: cover;
    background-position: center top;
    border: 1px solid var(--card-border);
}

.cf-recent-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cf-recent-name {
    font-size: 15px;
    font-weight: 500;
}

.cf-recent-meta {
    font-size: 11.5px;
    color: var(--muted);
}

.cf-recent-meta--missed {
    color: #ff6b8a;
}

.cf-recent-call {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: url('assets/images/icons/video-call.png') center / 36px 36px no-repeat;
    filter: drop-shadow(0 0 8px rgba(252, 58, 156, 0.5));
}

.cf-recent-clear {
    display: flex;
    margin: 20px auto 0;
}

/* ==========================================================================
   Settings
   ========================================================================== */

.cf-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 16px 0;
}

.cf-setting {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px;
    text-align: left;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
}

.cf-setting-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cf-setting-title {
    font-size: 14.5px;
    font-weight: 500;
}

.cf-setting-desc {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.45;
}

.cf-switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: background 0.2s ease;
}

.cf-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.cf-switch:checked {
    background: var(--grad);
}

.cf-switch:checked::after {
    transform: translateX(18px);
}

.cf-switch:focus-visible {
    outline: 2px solid var(--pink);
    outline-offset: 2px;
}

.cf-about {
    margin-top: 10px;
    padding: 14px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--muted);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
}

.cf-about-title {
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

/* ==========================================================================
   Call screen
   ========================================================================== */

body.callfun-call {
    overflow: hidden;
    background: #000;
}

.cf-call {
    position: fixed;
    inset: 0;
    z-index: 1;
    max-width: var(--app-max);
    margin: 0 auto;
    overflow: hidden;
    background: #12051d;
}

.cf-call-bg {
    position: absolute;
    inset: -30px;
    background:
        radial-gradient(60% 45% at 50% 35%, rgba(163, 34, 238, 0.45) 0%, rgba(163, 34, 238, 0) 70%),
        linear-gradient(180deg, #2a0b3d 0%, #12051d 100%);
    background-size: cover;
    background-position: center;
    filter: blur(22px) brightness(0.55);
}

.cf-call-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cf-call[data-state="connected"] .cf-call-video {
    opacity: 1;
}

.cf-call-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 30px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%);
}

.cf-call-back {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
}

.cf-call-top-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cf-call[data-state="connected"] .cf-call-top-info {
    opacity: 1;
}

.cf-call-top-name {
    font-size: 16px;
    font-weight: 600;
}

.cf-call-timer {
    font-size: 12px;
    color: #d7cde0;
    font-variant-numeric: tabular-nums;
}

.cf-call-ringing,
.cf-call-end {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 24px 140px;
    text-align: center;
}

.cf-call-end {
    padding-bottom: 40px;
    display: none;
}

.cf-call[data-state="connected"] .cf-call-ringing,
.cf-call[data-state="ended"] .cf-call-ringing {
    display: none;
}

.cf-call[data-state="ended"] .cf-call-end {
    display: flex;
}

.cf-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    background: var(--card-bg);
    background-color: #3a2148;
    background-size: cover;
    background-position: center top;
    border: 2px solid rgba(252, 58, 156, 0.7);
}

.cf-avatar--pulse::before,
.cf-avatar--pulse::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid rgba(252, 58, 156, 0.6);
    animation: cf-pulse 2s ease-out infinite;
}

.cf-avatar--pulse::after {
    animation-delay: 1s;
}

@keyframes cf-pulse {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.7); opacity: 0; }
}

.cf-call-name {
    margin-top: 22px;
    font-size: 26px;
    font-weight: 600;
}

.cf-call-status,
.cf-call-result {
    margin-top: 4px;
    font-size: 14px;
    color: #d7cde0;
}

.cf-call.is-noanswer .cf-call-result {
    color: #ff8aa5;
}

.cf-call-end-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 270px;
    margin-top: 30px;
}

.cf-call-end-actions .cf-btn {
    width: 100%;
}

.cf-self {
    position: absolute;
    top: calc(70px + env(safe-area-inset-top, 0px));
    right: 14px;
    z-index: 3;
    width: 96px;
    height: 136px;
    border-radius: 12px;
    overflow: hidden;
    background: #2a1838;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.cf-self-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.cf-self-video.is-mirrored {
    transform: scaleX(-1);
}

.cf-self.is-live .cf-self-video {
    display: block;
}

.cf-self-off {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.55);
}

.cf-self.is-live .cf-self-off {
    display: none;
}

.cf-call[data-state="ringing"] .cf-self,
.cf-call[data-state="ended"] .cf-self {
    display: none !important;
}

.cf-sound-hint {
    position: absolute;
    left: 50%;
    bottom: 150px;
    z-index: 4;
    transform: translateX(-50%);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.cf-call-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding: 50px 16px calc(34px + var(--safe-bottom));
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
}

.cf-call[data-state="ended"] .cf-call-controls {
    display: none;
}

.cf-call[data-state="ringing"] .cf-ctrl:not(.cf-ctrl--end) {
    opacity: 0.45;
    pointer-events: none;
}

.cf-ctrl {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.cf-ctrl .cf-slash {
    display: none;
}

.cf-ctrl[aria-pressed="true"] {
    color: #1a0628;
    background: #fff;
}

.cf-ctrl[aria-pressed="true"] .cf-slash {
    display: inline;
}

.cf-ctrl--end {
    width: 66px;
    height: 66px;
    background: #ff3b4e;
    border-color: transparent;
    box-shadow: 0 0 22px rgba(255, 59, 78, 0.55);
}

.cf-ctrl:active {
    transform: scale(0.94);
}

/* Screen reader only */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}
