
/* CHOLAKKULAM COMMUNITY WEBSITE */
/* PREMIUM MOBILE FIRST DESIGN */

:root {
    --bg: #101c18;
    --card: #20332b;
    --surface: #172720;
    --primary: #81c995;
    --text: #ffffff;
    --muted: #a5b9ad;
    --border: #30463a;
    --red: #ff8585;
    --blue: #8ab4f8;
    --gold: #fbd36b;
    --purple: #d5b2ff;
    --orange: #f5b87e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    padding-bottom: calc(85px + env(safe-area-inset-bottom));
}

[hidden] {
    display: none !important;
}

button, input, select, textarea {
    font: inherit;
}

button {
    border: none;
    color: inherit;
    background: none;
    cursor: pointer;
    touch-action: manipulation;
}

button:focus-visible, a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

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

img {
    max-width: 100%;
    display: block;
}

svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* HEADER */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top));
    background: rgba(16, 28, 24, 0.96);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
}

.brand {
    text-align: center;
}

.brand h1 {
    font-size: clamp(18px, 5vw, 24px);
    font-weight: 800;
    letter-spacing: 1px;
}

.brand p {
    font-size: 9px;
    letter-spacing: 1.2px;
    color: var(--primary);
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--card);
}

/* MAIN CONTENT */

#mainContent {
    width: 100%;
    max-width: 1100px;
    margin: auto;
    padding: 16px;
}

/* HERO SECTION */

.hero {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 22px;
    background:
        linear-gradient(
            0deg,
            rgba(5, 20, 12, 0.95),
            rgba(5, 20, 12, 0.12)
        ),
        linear-gradient(
            135deg,
            #315e43,
            #183d2b,
            #10261c
        );
    border: 1px solid var(--border);
}

.hero-content {
    padding: 25px 20px;
}

.hero-content span {
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--primary);
}

.hero-content h2 {
    font-size: clamp(23px, 7vw, 38px);
    font-weight: 800;
    letter-spacing: 0.5px;
}

.hero-content p {
    color: #d3e5d8;
    font-size: 14px;
    margin-top: 5px;
}

/* BLOOD BANK BANNER */

.blood-banner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 15px;
    margin: 18px 0;
    border-radius: 16px;
    text-align: left;
    background: linear-gradient(
        135deg, #a83b46, #77252f
    );
    border: 1px solid #bc505a;
}

.blood-banner > svg:first-child {
    width: 34px;
    height: 34px;
}

.blood-banner div {
    flex: 1;
}

.blood-banner h3 {
    font-size: 15px;
}

.blood-banner p {
    font-size: 12px;
    color: #f7cdd1;
}

/* SERVICE GRID */

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 105px;
    padding: 14px 5px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: transform 0.2s, background 0.2s;
}

.service-card svg {
    width: 30px;
    height: 30px;
}

.service-card span {
    font-size: 12px;
    font-weight: 600;
}

.service-card:active {
    transform: scale(0.96);
    background: #30483b;
}

.green { color: var(--primary); }
.red { color: var(--red); }
.blue { color: var(--blue); }
.gold { color: var(--gold); }
.purple { color: var(--purple); }
.orange { color: var(--orange); }

/* CONTENT SECTIONS */

.content-section {
    margin: 26px 0;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.section-heading h2 {
    font-size: 19px;
    font-weight: 700;
}

.section-heading button {
    color: var(--primary);
    font-size: 12px;
    min-height: 44px;
    padding: 5px;
}

.empty-message {
    color: var(--muted);
    padding: 20px 12px;
    text-align: center;
    font-size: 13px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px dashed var(--border);
    grid-column: 1 / -1;
}

/* TOURNAMENTS */

.tournament-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tournament-card {
    background: linear-gradient(
        145deg, #293f32, #172720
    );
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px 10px;
    text-align: center;
}

.tournament-card svg {
    width: 36px;
    height: 36px;
    color: var(--gold);
    margin-bottom: 8px;
}

.tournament-card:nth-child(2) svg {
    color: var(--purple);
}

.tournament-card h2 {
    font-size: 25px;
    letter-spacing: 2px;
}

.tournament-card p {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
}

/* PHOTO GALLERY */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
}

/* EMERGENCY CONTACT */

.emergency-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 15px;
    border-radius: 15px;
    background: var(--card);
    border: 1px solid var(--border);
    text-align: left;
}

.emergency-card svg:first-child {
    color: var(--primary);
}

.emergency-card svg:last-child {
    margin-left: auto;
}

/* BOTTOM NAVIGATION */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-around;
    background: rgba(19, 34, 27, 0.98);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--border);
    padding: 9px 4px;
    padding-bottom: calc(9px + env(safe-area-inset-bottom));
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 3px;
    min-height: 50px;
    color: var(--muted);
    border-radius: 12px;
}

.nav-item svg {
    width: 23px;
    height: 23px;
}

.nav-item span {
    font-size: 10px;
}

.nav-item.active {
    color: var(--primary);
    background: rgba(129, 201, 149, 0.08);
}

/* SIDEBAR MENU */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(85vw, 320px);
    z-index: 200;
    background: #172720;
    padding: 24px 18px;
    padding-top: calc(24px + env(safe-area-inset-top));
    border-right: 1px solid var(--border);
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 21px;
    color: var(--primary);
    margin-bottom: 20px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.sidebar nav button,
.sidebar nav a,
#closeMenu {
    display: block;
    padding: 14px;
    text-align: left;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
}

.sidebar nav a {
    margin-top: 15px;
    color: var(--primary);
}

/* INNER PAGES */

.page-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.page-heading button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    background: var(--card);
    border-radius: 12px;
}

.page-heading h2 {
    font-size: 22px;
}

#pageContent {
    display: grid;
    gap: 14px;
}

/* DATA CARDS */

.data-card, .news-card, .donor-card {
    padding: 18px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    overflow-wrap: anywhere;
}

.data-card h3,
.news-card h3,
.donor-card h3 {
    font-size: 17px;
    margin-bottom: 7px;
}

.data-card p,
.news-card p,
.donor-card p {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 6px;
    white-space: pre-wrap;
}

.data-card img,
.news-card img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
}

.blood-group {
    display: inline-block;
    background: #942e38;
    color: white;
    padding: 7px 12px;
    border-radius: 8px;
    font-weight: bold;
}

.call-btn, .primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 18px;
    margin-top: 10px;
    border-radius: 10px;
    background: var(--primary);
    color: #102018;
    font-weight: bold;
}

/* SEARCH AND FORM INPUTS */

input, select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 16px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary);
}

/* FOOTER */

footer {
    text-align: center;
    padding: 35px 10px;
    color: var(--muted);
}

footer h3 {
    font-size: 18px;
    color: var(--primary);
    letter-spacing: 2px;
}

footer p {
    font-size: 11px;
    margin-top: 7px;
}

/* TABLET AND DESKTOP */

@media (min-width: 768px) {

    #mainContent {
        padding: 25px;
    }

    .hero {
        min-height: 350px;
    }

    .hero-content {
        padding: 35px;
    }

    .services-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 15px;
    }

    .service-card {
        min-height: 135px;
    }

    .service-card span {
        font-size: 14px;
    }

    .gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .bottom-nav {
        max-width: 650px;
        left: 50%;
        right: auto;
        width: 100%;
        transform: translateX(-50%);
        border-radius: 20px 20px 0 0;
        border: 1px solid var(--border);
    }
}

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

    * {
        transition: none !important;
    }
}

/* ADMIN INPUT FIX */

[hidden] {
    display: none !important;
}

#loginForm {
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

#adminEmail,
#adminPassword {
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    cursor: text !important;
    color: #ffffff !important;
    caret-color: #81c995;
    position: relative;
}

#adminEmail:focus,
#adminPassword:focus {
    outline: 2px solid #81c995;
}

