/* RESET AND BASE */
.bree-serif-regular {
  font-family: "Bree Serif", serif;
  font-weight: 400;
  font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

.oswald {
    font-family: "Oswald", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

body {
    background: #ffffff;
    color: #212121;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* STARS BACKGROUND EFFECT */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -1;
    animation: twinkle 5s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.3; }
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    box-shadow: 50vw 20vh #fff, 20vw 80vh #ddd, 70vw 50vh #eee, 30vw 30vh #fff, 80vw 10vh #ddd;
    animation: twinkle 3s infinite alternate;
}

/* HEADER */
header, .about-center {
    background: #004d40;
    padding: 1rem 5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    height: 100px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00796B;
}

.logo img {
    max-width: 100px;
    height: auto;
}

nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    color: #FFFFFF;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 1rem;
    transition: color 0.3s;
    font-family: "Oswald", sans-serif;
    font-weight: 500;
}

nav a:hover {
    text-decoration: underline;
}

/* MAIN & HERO */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hero {
    padding-top: 20px;
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 100px;
}

.hero h1 {
    padding-bottom: 15px;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: #03796d;
    font-family: "Special Gothic Expanded One", sans-serif;
    font-weight: 200;
}

.hero p {
    font-family: "Bree Serif", serif;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #424242;
}

/* FORM SECTION */
.form-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.4);
    max-width: 500px;
    margin: 20px auto;
    width: 90%;
}

.tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    color: #100f0f;
    min-width: fit-content;
}

.tab.active {
    background: #009688;
    color: #fff;
}

.tab:hover {
    background: #e0f2f1;
    color: #000;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block !important;
}

.input-group {
    margin-bottom: 1rem;
    position: relative;
}

input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #004d40;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: #151515;
    font-size: 1rem;
    outline: none;
    transition: border 0.3s, box-shadow 0.3s;
}

input:focus {
    border-color: #009688;
    box-shadow: 0 0 10px #00968866;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #004d40;
}

button {
    width: 100%;
    padding: 0.8rem;
    background: #004d40;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

button:hover {
    background: #00796B;
    transform: scale(1.05);
}

.spinner {
    display: none;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #004d40;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#passwordWarning,
#confirmWarning {
    display: block;
    height: 1.2rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    color: red;
    font-size: 0.9rem;
}

.error {
    display: none;
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 5px;
    background: rgba(255, 0, 0, 0.2);
    color: #100f0f;
}

.success {
    display: none;
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 5px;
    background: rgba(0, 255, 0, 0.15);
    color: #100f0f;
}

/* VERIFY SECTION */
#verifySection {
    display: none;
    text-align: center;
}

#verifySection h3 {
    font-size: 1.5rem;
    color: #004d40;
    margin-bottom: 1rem;
}

#verifySection input {
    margin-bottom: 0.8rem;
}

#verifySection button {
    margin-top: 0.5rem;
}

/* RESET STEPS */
.reset-step {
    margin-top: 1rem;
}

.reset-step input {
    margin-bottom: 0.8rem;
}

.reset-step button {
    margin-top: 0.3rem;
}

/* FOOTER */
footer {
    background: #ffffff;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    margin-top: auto;
}

footer h1 {
    font-size: 1.2rem;
    color: #004d40;
    margin-bottom: 1rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.social-icons img {
    width: 50px;
    height: auto;
}

.social-icons a {
    text-decoration: none;
    transition: transform 0.3s;
}

.social-icons a:hover {
    transform: scale(1.1);
}

footer .container {
    font-size: 0.9rem;
    color: #666;
}

/* DONATE SECTION */
.donate-container {
    max-width: 800px;
    margin: 5rem auto;
    padding: 2rem;
    background-color: #f9f9f9;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 121, 107, 0.2);
    text-align: center;
    width: 90%;
}

.donate-title {
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: #004d40;
    margin-bottom: 1rem;
    text-shadow: 0 0 5px rgba(0, 150, 136, 0.3);
}

.donate-paragraph {
    font-family: "Bree Serif", serif;
    font-weight: 600;
    font-style: normal;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #333;
    line-height: 1.4;
    margin-bottom: 2rem;
}

.quotes {
    background: rgba(0, 150, 136, 0.05);
    border-left: 4px solid #009688;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    font-style: italic;
    font-size: 1rem;
    color: #004d40;
}

.quotes p {
    margin-bottom: 0.8rem;
}

.donate-contact {
    font-size: 1rem;
    color: #222;
    background: #e0f2f1;
    padding: 1.2rem;
    border-radius: 10px;
    border: 1px solid #b2dfdb;
}

.email {
    font-weight: bold;
    color: #004d40;
    margin-top: 0.5rem;
}

/* GRANT TABLE */
.grant-table-section {
    padding: 40px 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 121, 107, 0.2);
    width: 100%;
}

.grant-table-section h2 {
    text-align: center;
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: #03796d;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.grant-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    margin: 0 auto;
    background-color: #ebebeb;
}

.grant-table th,
.grant-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
}

.grant-table th {
    background-color: #e9e0e0;
    font-weight: bold;
}

.grant-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.grant-table a {
    color: rgba(0, 77, 64, 0.7);
    text-decoration: underline;
    word-break: break-all;
}

/* ABOUT US CENTER */
.edit-about {
    max-width: 800px;
    margin: 5rem auto;
    padding: 2rem;
    background-color: #f9f9f9;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 121, 107, 0.2);
    text-align: center;
    width: 90%;
}

.edit-about h2 {
    font-family: "Special Gothic Expanded One", sans-serif;
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: #004d40;
    margin-bottom: 1rem;
}

.edit-about p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.4;
    font-family: "Bree Serif", serif;
}

.sponsor-logos {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sponsor-logos img {
    width: 50px;
    height: auto;
}

/* IMAGE GRID - RESPONSIVE FOR ALL DEVICES */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.grid-item {
    border-radius: 20px;
    background-color: #e0f7f4;
    text-align: center;
    overflow: hidden;
}

.grid-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    background: #ddd;
    display: block;
}

.grid-item p {
    font-family: "Oswald", sans-serif;
    margin-top: 0.5rem;
    padding: 0.5rem;
    font-size: 1rem;
    color: #0c0b0b;
}

/* RESPONSIVE BREAKPOINTS */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    header, .about-center {
        padding: 1rem 3rem;
    }
    
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.2rem;
    }
    
    .grid-item img {
        height: 280px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    header, .about-center {
        flex-direction: column;
        align-items: center;
        padding: 1rem 2rem;
        height: auto;
        text-align: center;
    }

    nav {
        margin-top: 1rem;
        justify-content: center;
    }

    nav a {
        margin: 0.5rem;
        font-size: 0.95rem;
    }

    main {
        padding: 1rem;
    }

    .hero {
        padding-bottom: 50px;
    }

    /* Grid shows 2 columns on tablets */
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .grid-item img {
        height: 220px;
    }

    .donate-container,
    .edit-about {
        padding: 1.5rem;
        margin: 1rem auto;
        width: 95%;
    }

    .form-container {
        width: 95%;
        padding: 1.5rem;
    }

    .tabs {
        gap: 0.3rem;
    }

    .tab {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .grant-table th,
    .grant-table td {
        padding: 8px;
        font-size: 0.9rem;
    }
}

/* Mobile phones */
@media (max-width: 600px) {
    header, .about-center {
        padding: 1rem;
    }

    nav a {
        font-size: 0.85rem;
        margin: 0.3rem;
    }

    .hero {
        padding-bottom: 30px;
    }

    /* Grid shows 2 columns on mobile for your 4 images */
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        padding: 0;
    }

    .grid-item img {
        height: 180px;
    }

    .grid-item p {
        font-size: 0.9rem;
        padding: 0.3rem;
    }

    .form-container,
    .donate-container,
    .edit-about {
        padding: 1rem;
        margin: 0.5rem auto;
        width: 95%;
    }

    input,
    button {
        font-size: 1rem;
        padding: 0.7rem;
    }

    .grant-table {
        min-width: 550px;
        font-size: 0.85rem;
    }

    .grant-table th,
    .grant-table td {
        padding: 6px;
    }

    .sponsor-logos img {
        width: 40px;
    }

    .social-icons img {
        width: 40px;
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .hero {
        padding-top: 10px;
        padding-bottom: 20px;
    }

    /* Still 2 columns but smaller images */
    .grid {
        gap: 0.5rem;
    }

    .grid-item img {
        height: 150px;
    }

    .grid-item p {
        font-size: 0.8rem;
    }

    .tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tab {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .form-container {
        padding: 0.8rem;
    }

    .quotes {
        padding: 0.8rem 1rem;
    }

    .donate-contact {
        padding: 1rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .grid-item img {
        height: 130px;
    }
    
    .grid-item p {
        font-size: 0.75rem;
    }
    
    nav a {
        font-size: 0.8rem;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding-top: 10px;
        padding-bottom: 20px;
    }
    
    .grid-item img {
        height: 160px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo img,
    .social-icons img,
    .sponsor-logos img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}