/* --- GLOBAL VARIABLES & RESET --- */
:root {
    --bg-dark: #0f0f13;
    --card-bg: #1e1e24;
    --card-bg-transparent: rgba(30, 30, 36, 0.7);
    --primary: #00b894;
    --accent: #6c5ce7;
    --blue: #0984e3;
    --orange: #fdcb6e;
    --warning: #fdcb6e;
    --text: #ffffff;
    --text-muted: #a0a0b0;
    --input-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --green: #00b894;
    --cyan-glow: #00cec9;
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- NAVIGATION --- */
.navbar {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(30, 30, 36, 0.95);
    border-bottom: 1px solid var(--border);
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.brand {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(45deg, #00b894, #0984e3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-btn {
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.nav-btn:hover {
    border-color: var(--primary);
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.container {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* --- BUTTONS --- */
.btn-create-loud {
    background: linear-gradient(135deg, var(--primary), #00cec9);
    color: #000;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,184,148,0.3);
    transition: 0.2s;
    white-space: nowrap;
}
.btn-create-loud:active { transform: scale(0.95); }

.btn-analytics-pop {
    display: block; width: 100%; text-align: center;
    background: var(--blue);
    color: #fff; text-decoration: none;
    padding: 12px; border-radius: 10px; font-size: 0.9rem; font-weight: 700; transition: 0.2s;
}
.btn-analytics-pop:hover { background: #076bad; }

/* --- HERO SLIDER (TOP) --- */
.hero-slider-container {
    width: 100%;
    height: 190px;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.hero-slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.hero-slide img {
    width: 100%; height: 100%; object-fit: cover;
    filter: brightness(0.7); /* Darken slightly so text pops */
    transition: transform 10s ease;
}

/* Zoom effect on images */
.hero-slide img { transform: scale(1); }
.hero-slider-container:hover .hero-slide img { transform: scale(1.05); }

/* Hero Overlay Content (Text + Button) */
.hero-overlay-content {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-text {
    color: #fff; font-size: 1.2rem; font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    margin-bottom: 12px;
}

/* Glassmorphism Button */
.btn-hero-glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-hero-glass:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

/* --- CARDS & STATS --- */
.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column; 
}

.stat-icon {
    width: 45px; height: 45px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.purple { background: rgba(108, 92, 231, 0.15); color: #6c5ce7; }
.green { background: rgba(0, 184, 148, 0.15); color: #00b894; }
.orange { background: rgba(253, 203, 110, 0.15); color: #fdcb6e; }
.blue { background: rgba(9, 132, 227, 0.15); color: #0984e3; }

.stat-value { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px; margin-top: 10px;}

/* --- DASHBOARD SPECIFIC --- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.ads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }

.ad-card {
    background: var(--card-bg); border-radius: 16px; padding: 1.5rem;
    border: 1px solid var(--border); transition: transform 0.2s, border-color 0.2s;
    position: relative; overflow: hidden;
}
.ad-card:hover { transform: translateY(-3px); border-color: var(--primary); }

.ad-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 1.2rem; }
.ad-title { font-size: 1.1rem; font-weight: 700; margin: 0; color: #fff; }
.status-badge { background: rgba(0, 184, 148, 0.15); color: var(--primary); padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.status-badge.status-paid { background: rgba(0, 184, 148, 0.15); color: #00b894; }
.status-badge.status-partial { background: rgba(253, 203, 110, 0.15); color: #fdcb6e; }
.status-badge.status-unpaid { background: rgba(214, 48, 49, 0.15); color: #ff7675; }

.ad-stats-row {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    background: rgba(0,0,0,0.3); padding: 12px; border-radius: 12px; margin-bottom: 1rem;
}
.ad-stat-item { text-align: center; border-right: 1px solid var(--border); }
.ad-stat-item:last-child { border-right: none; }
.ad-stat-val { display: block; font-weight: 700; font-size: 1.1rem; margin-bottom: 2px; transition: color 0.3s; }
.ad-stat-lbl { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* --- ANALYTICS SPECIFIC --- */
.page-header { margin-bottom: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.page-header h1 { margin: 0; font-size: 1.3rem; line-height: 1.4; color: #fff; }

/* --- FORMS & INPUTS --- */
input, select, textarea {
    width: 100%; background: var(--input-bg); border: 1px solid var(--border); color: white;
    padding: 10px; border-radius: 8px; font-size: 0.9rem; transition: 0.2s;
}
input:focus { border-color: var(--primary); background: rgba(255,255,255,0.1); }

/* --- MODALS --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px);
    display: none; justify-content: center; align-items: center;
    z-index: 999; opacity: 0; transition: 0.3s;
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal-card {
    background: #1e1e24; width: 90%; max-width: 350px;
    border-radius: 20px; padding: 2rem; text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    transform: translateY(20px); transition: 0.3s; position: relative;
}
.modal-overlay.active .modal-card { transform: translateY(0); }

.modal-icon-circle {
    width: 60px; height: 60px; background: rgba(0, 184, 148, 0.2);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem; color: var(--primary); font-size: 1.5rem;
}

.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 1.5rem; }
.btn-modal-cancel { padding: 12px; border-radius: 10px; border: 1px solid #444; background: transparent; color: #aaa; cursor: pointer; }
.btn-modal-pay { padding: 12px; border-radius: 10px; border: none; background: var(--primary); color: #000; font-weight: bold; cursor: pointer; }

/* BREAKDOWN TABLE IN MODAL */
.breakdown-row {
    display: flex; justify-content: space-between; padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem; color: #ccc;
}
.breakdown-row.total {
    border-top: 1px solid rgba(255,255,255,0.2); border-bottom: none;
    margin-top: 10px; padding-top: 15px; font-weight: bold; color: #fff; font-size: 1.1rem;
}

/* NEW: PHONE INPUT STYLING */
.phone-input-container {
    display:flex; align-items:center; background:rgba(255,255,255,0.05); 
    border:1px solid rgba(255,255,255,0.1); border-radius:8px; padding:0 10px;
    margin-bottom: 5px; /* space for the change button below */
}
.phone-input-field {
    border:none; background:transparent; font-weight:600; 
    text-align:center; /* CENTERED TEXT */
    letter-spacing: 1px;
}
.btn-change-phone {
    background: none; border: none; color: var(--primary); 
    font-size: 0.75rem; text-decoration: underline; cursor: pointer;
    margin-top: 5px; padding: 4px; opacity: 0.8;
}
.btn-change-phone:hover { opacity: 1; color: #fff; }

.loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); display: none; flex-direction: column;
    justify-content: center; align-items: center; z-index: 2000;
}
.spinner {
    width: 40px; height: 40px; border: 4px solid rgba(0, 184, 148, 0.3);
    border-top: 4px solid var(--primary); border-radius: 50%;
    animation: spin 1s linear infinite; margin: 0 auto 1rem auto;
}

/* --- TOASTS --- */
.toast-center {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: #000; padding: 12px 24px;
    border-radius: 30px; font-weight: bold; display: none; align-items: center; gap: 10px;
    box-shadow: 0 10px 30px rgba(0,184,148,0.4); z-index: 1001;
}
.toast-center.show { display: flex; animation: slideDown 0.5s ease; }

/* --- CAROUSEL BANNER (SMALL BOTTOM) --- */
.ad-slider-container {
    width: 100%;
    max-width: 400px;
    height: 75px; 
    margin: 0 auto;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.ad-slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.ad-slide img {
    width: 100%; height: 100%; object-fit: cover;
    filter: brightness(0.6); 
    transition: transform 10s ease;
}

.ad-slider-container:hover .ad-slide img { transform: scale(1.1); }

.ad-content {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-left: 20px;
    z-index: 2;
}

.ad-badge {
    background: #00b894;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.ad-text {
    color: #fff; font-size: 1.1rem; font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 0.5px;
}

/* --- SHARED ANIMATION LOGIC FOR BOTH SLIDERS --- */
/* The keyframes can be reused if named distinctly */
.slide-1, .hero-anim-1 { animation: fadeThree1 15s infinite; }
.slide-2, .hero-anim-2 { animation: fadeThree2 15s infinite; }
.slide-3, .hero-anim-3 { animation: fadeThree3 15s infinite; }

@keyframes fadeThree1 {
    0%    { opacity: 1; z-index: 1; }
    28%   { opacity: 1; z-index: 1; }
    33%   { opacity: 0; z-index: 0; }
    95%   { opacity: 0; z-index: 0; }
    100%  { opacity: 1; z-index: 1; }
}

@keyframes fadeThree2 {
    0%    { opacity: 0; z-index: 0; }
    28%   { opacity: 0; z-index: 0; }
    33%   { opacity: 1; z-index: 1; }
    61%   { opacity: 1; z-index: 1; }
    66%   { opacity: 0; z-index: 0; }
    100%  { opacity: 0; z-index: 0; }
}

@keyframes fadeThree3 {
    0%    { opacity: 0; z-index: 0; }
    61%   { opacity: 0; z-index: 0; }
    66%   { opacity: 1; z-index: 1; }
    95%   { opacity: 1; z-index: 1; }
    100%  { opacity: 0; z-index: 0; }
}

/* --- ANIMATIONS --- */
@keyframes slideDown { from { top: -50px; } to { top: 20px; } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- MEDIA QUERIES --- */
@media (max-width: 768px) {
    .container { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 1rem; }
    .ads-grid { grid-template-columns: 1fr; }
    .desktop-only { display: none; }
}
