/* =========================================================
   ChatVibe.co.za ā€” Consolidated Premium Blue Stylesheet
   Header, mobile navigation, content, forms, sharing and footer
   ========================================================= */

/* ---------- Theme ---------- */
:root {
    --cv-blue: #1877F2;
    --cv-blue-dark: #145DBF;
    --cv-blue-deep: #0D47A1;
    --cv-blue-light: #EAF3FF;
    --cv-page: #F0F2F5;
    --cv-white: #FFFFFF;
    --cv-text: #1C1E21;
    --cv-muted: #65676B;
    --cv-border: #DADDE1;
    --cv-shadow: 0 3px 12px rgba(20, 65, 120, 0.07);
    --cv-radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    background: var(--cv-page);
    color: var(--cv-text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

img { max-width: 100%; }

a {
    color: var(--cv-blue);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #80B7FF;
    outline-offset: 2px;
}

/* ---------- Header and logo ---------- */
header,
.cv-header {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 12px 20px;
    background: var(--cv-blue);
    color: var(--cv-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: #FFFFFF;
    text-decoration: none;
}

.logo:hover { text-decoration: none; }

.logo-text {
    font-size: clamp(25px, 4vw, 34px);
    font-weight: 800;
    letter-spacing: -1.4px;
    line-height: 1.2;
}

.logo-chat { color: #FFFFFF; }
.logo-vibe { color: #DCEBFF; }
.logo-dot { color: #FFFFFF; }

.logo img {
    display: block;
    width: auto;
    max-width: 220px;
    max-height: 60px;
    object-fit: contain;
}

/* ---------- Navigation: desktop defaults ---------- */
.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 9998;
}

.nav-links a {
    display: inline-block;
    padding: 9px 12px;
    border-radius: 8px;
    color: #FFFFFF;
    font-weight: 700;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.17);
    color: #FFFFFF;
    text-decoration: none;
}

.hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 42px;
    padding: 5px 11px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.12);
    color: #FFFFFF;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    position: relative;
    z-index: 9999;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Main content ---------- */
.container {
    width: calc(100% - 32px);
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: var(--cv-white);
    color: var(--cv-text);
    border: 1px solid var(--cv-border);
    border-radius: var(--cv-radius);
    box-shadow: var(--cv-shadow);
}

.intro-text {
    margin-bottom: 20px;
    color: var(--cv-text);
    font-size: 1.1rem;
}

.container h1,
.container h2,
.container h3 {
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.container h1,
.container h2 { color: var(--cv-blue); }

/* ---------- Messages and posts ---------- */
.message,
.post-message {
    margin: 14px 0 18px;
    padding: 16px;
    background: #FFFFFF;
    color: var(--cv-text);
    border: 1px solid var(--cv-border);
    border-left: 4px solid var(--cv-blue);
    border-radius: var(--cv-radius);
    box-shadow: 0 2px 8px rgba(20, 65, 120, 0.05);
    overflow-wrap: anywhere;
    transition: box-shadow 0.2s ease;
}

.message:hover,
.post-message:hover {
    box-shadow: 0 4px 14px rgba(20, 65, 120, 0.09);
}

.post-message h2 {
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--cv-blue);
    font-size: 23px;
}

.message strong,
.reply strong {
    color: #174A83;
    font-size: 15px;
    font-weight: 700;
}

.message small,
.reply small {
    color: var(--cv-muted);
    font-size: 12px;
}

.message p,
.reply p,
.post-message p {
    margin: 10px 0;
    color: #27364A;
    font-size: 15px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.message a,
.reply a { overflow-wrap: anywhere; }

/* ---------- Message and reply images ---------- */
.message img,
.message-image,
.reply-image,
.chat img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 12px auto;
    border-radius: 12px;
    object-fit: contain;
}

.reply-image,
.message-image {
    max-height: 480px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.10);
}

.chat {
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* ---------- Replies ---------- */
.replies {
    margin-top: 12px;
    padding-left: 14px;
    color: var(--cv-text);
    border-left: 3px solid var(--cv-blue);
}

.reply {
    margin: 10px 0;
    padding: 12px;
    background: #F2F7FD;
    color: var(--cv-text);
    border: 1px solid #E0EAF6;
    border-left: 3px solid var(--cv-blue);
    border-radius: 0 10px 10px 0;
    overflow-wrap: anywhere;
}

.replies a,
.load-replies {
    color: var(--cv-blue);
    font-weight: 700;
}

.replies a {
    font-size: 0.95rem;
    text-decoration: underline;
}

.reply-form {
    margin-top: 12px;
    padding: 14px;
    background: #F7FAFF;
    border: 1px solid #DCE5F0;
    border-radius: 12px;
}

/* ---------- Forms and fields ---------- */
form { margin-top: 20px; }

form input[type="text"],
form input[type="search"],
form input[type="email"],
form input[type="password"],
form textarea,
form select {
    max-width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    background: #FFFFFF;
    color: var(--cv-text);
    border: 1px solid #CCD6E2;
    border-radius: 10px;
    font: inherit;
}

form input[type="text"],
form textarea { width: 100%; }

form textarea {
    min-height: 110px;
    resize: vertical;
}

form input[type="file"] {
    display: block;
    max-width: 100%;
    margin: 10px 0;
    font: inherit;
}

form input[type="text"]:focus,
form input[type="search"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form textarea:focus,
form select:focus {
    border-color: var(--cv-blue);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}

form p small {
    color: var(--cv-muted);
    font-size: 0.9rem;
}

/* ---------- Buttons ---------- */
button,
form button,
form button.post-button {
    min-height: 42px;
    padding: 10px 18px;
    background: var(--cv-blue);
    color: #FFFFFF;
    border: none;
    border-radius: 9px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
form button:hover,
form button.post-button:hover {
    background: var(--cv-blue-dark);
    box-shadow: 0 3px 8px rgba(24, 119, 242, 0.18);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 12px 0;
    text-align: center;
}

.pagination a,
.pagination .prev,
.pagination .next {
    display: inline-block;
    padding: 9px 16px;
    margin: 2px;
    background: var(--cv-blue);
    color: #FFFFFF;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}

.pagination a:hover { background: var(--cv-blue-dark); }

/* ---------- Existing social sharing ---------- */
.social-share { margin-top: 20px; }

.social-share a {
    display: inline-block;
    margin: 0 6px;
}

.social-share img {
    width: 107px;
    height: 42px;
    object-fit: contain;
}

.social-share a:hover img { opacity: 0.8; }

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.social-row {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* ---------- Footer base ---------- */
footer {
    width: 100%;
    margin-top: 28px;
    padding: 20px;
    background: var(--cv-blue-deep);
    color: #FFFFFF;
    border: none;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

footer a { color: #FFFFFF; }
footer p { margin: 8px 0; }

footer img {
    max-width: 100%;
    height: auto;
}

/* ---------- Modern ChatVibe footer ---------- */
.cv-footer {
    width: 100%;
    margin-top: 16px;
    padding: 16px 10px 10px;
    background: var(--cv-blue-deep);
    color: #FFFFFF;
}

.cv-footer-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.cv-footer-brand {
    display: inline-block;
    color: #FFFFFF !important;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.2;
    text-decoration: none !important;
}

.cv-footer-chat { color: #FFFFFF; }
.cv-footer-vibe { color: #9EC9FF; }

.cv-footer-tagline {
    margin: 4px 0 10px;
    color: #E4EFFF;
    font-size: 12px;
}

.cv-footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 14px;
}

/* Compact, consistent social-sharing circles */
.cv-footer .cv-footer-social .cv-footer-social-link {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.cv-footer .cv-footer-social .cv-footer-social-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.cv-footer .cv-footer-social .cv-footer-social-link:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: 3px;
}

.cv-footer .cv-footer-social .cv-footer-social-link:active {
    transform: scale(0.96);
}

/* Make inline SVGs crisp and prevent oversized icons */
.cv-footer .cv-footer-social .cv-footer-social-link svg {
    display: block;
    width: 16px;
    height: 16px;
    max-width: 16px;
    flex: 0 0 16px;
    overflow: visible;
}

.cv-footer .cv-footer-social .cv-social-x svg {
    width: 15px;
    height: 15px;
    max-width: 15px;
    flex-basis: 15px;
}

/* Native Share icon and label */
.cv-footer .cv-footer-social .cv-native-share {
    gap: 2px;
    flex-direction: column;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 8px;
    line-height: 1;
}

.cv-footer .cv-footer-social .cv-native-share svg {
    width: 16px;
    height: 16px;
    max-width: 16px;
    flex: 0 0 16px;
}

.cv-share-symbol {
    display: block;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.cv-share-label {
    display: block;
    font-size: 8px;
}

/* Footer advertisement */
.cv-footer-ad {
    max-width: 100%;
    margin: 10px auto;
    overflow-wrap: anywhere;
}

/* Visitor counter */
.cv-footer-counter {
    display: table;
    max-width: 100%;
    margin: 10px auto;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.cv-footer-counter img { max-width: 100%; }

/* Footer navigation */
.cv-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 12px 0;
}

.cv-footer-links a {
    color: #FFFFFF !important;
    font-size: 12px;
    text-decoration: none;
}

.cv-footer-links a:hover { text-decoration: underline; }

/* Copyright */
.cv-footer-copyright {
    margin: 10px 0 0;
    padding-top: 9px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    color: #DBE8FF;
    font-size: 11px;
}

/* ---------- Responsive layout and mobile navigation ---------- */
@media (max-width: 768px) {
    header,
    .cv-header {
        padding: 10px 14px;
    }

    .cv-header .header-container,
    header .header-container {
        position: relative;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Header HTML uses a div with class="hamburger" and id="hamburger-menu". */
    .cv-header .hamburger,
    header .hamburger {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        flex: 0 0 44px;
        width: 44px;
        min-width: 44px;
        height: 42px;
        color: #FFFFFF;
        cursor: pointer;
        z-index: 10000;
    }

    .cv-header .nav-links,
    header .nav-links {
        display: none;
        flex: 0 0 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 4px;
        width: 100%;
        margin: 0;
        padding: 10px;
        background: var(--cv-blue);
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        z-index: 9998;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
    }

    /* Keep the existing JavaScript .show behavior. */
    .cv-header .nav-links.show,
    header .nav-links.show {
        display: flex !important;
    }

    .cv-header .nav-links a,
    header .nav-links a {
        display: block;
        width: 100%;
        padding: 12px;
        border-radius: 8px;
    }

    .container {
        width: calc(100% - 20px);
        margin: 12px auto;
        padding: 14px;
    }

    .message,
    .reply,
    .post-message {
        padding: 13px;
        font-size: 0.95rem;
    }

    .message-image,
    .reply-image { max-height: 360px; }

    .cv-footer {
        margin-top: 14px;
        padding: 14px 8px 9px;
    }

    .cv-footer-brand { font-size: 23px; }

    .cv-footer .cv-footer-social {
        gap: 8px;
        margin: 9px 0 12px;
    }

    .cv-footer .cv-footer-social .cv-footer-social-link {
        flex-basis: 32px;
        width: 32px;
        min-width: 32px;
        max-width: 32px;
        height: 32px;
        min-height: 32px;
    }

    .cv-footer-links { gap: 8px 12px; }
}

@media (min-width: 769px) {
    .cv-header .hamburger,
    header .hamburger { display: none !important; }

    .cv-header .nav-links,
    header .nav-links {
        display: flex;
        position: static;
    }
}

/* ---------- Respect reduced motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}