:root{
    --primary: #05264b; /* Deep Navy/Teal */
    --accent: #0f766e;  /* Strong Teal */
    --accent-light: #16a34a; /* Slightly lighter accent for hover/detail */
    --accent2: #06b6d4; /* Bright Cyan */
    --muted: #6b7280;   /* Gray for subtle text */
    --light-bg: #f0f8ff; /* Very light blue background base */
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base Styles */
*{
    box-sizing:border-box;
    margin: 0;
    padding: 0;
}
body{
    font-family:'Inter', system-ui, Arial, sans-serif; 
    color:var(--primary);
    /* ATTRACTIVE NGO BACKGROUND: Radial gradient with a slight texture effect */
    background: 
        radial-gradient(circle at 10% 20%, rgba(255,255,255,0.8) 0%, rgba(240,248,255,0.7) 100%), /* Main radial gradient */
        repeating-linear-gradient(45deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02) 20px, transparent 20px, transparent 40px), /* Soft pattern overlay */
        var(--light-bg); /* Base color */
    line-height:1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.container{
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
h1{
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    text-align: center;
}
h2{
    font-size: 2rem;
    font-weight: 700;
    margin-top: 50px;
    margin-bottom: 25px;
    color: var(--accent);
    text-align: center;
}
h3 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--primary);
}
h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary);
}
.muted{
    color: var(--muted);
}
.small {
    font-size: 0.9rem;
}
.text-center {
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    background-color: var(--accent);
    color: white !important;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    font-size: 0.95rem;
}
.btn:hover {
    background-color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.btn-submit {
    display: block;
    padding: 12px 25px;
    border-radius: 8px;
    background-color: var(--accent);
    color: white !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
}
.btn-submit:hover {
    background-color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Header/Nav */
header {
    background-color: var(--primary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}
.logo-text {
    font-size: 1.3rem;
    color: white;
    font-weight: 800;
}
.logo-image-container {
    background: white;
    padding: 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}
.navlinks {
    display: flex;
    align-items: center;
    gap: 5px;
}
.navlinks a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 6px;
}
.navlinks a:hover:not(.btn) {
    color: var(--accent2);
    background-color: rgba(255, 255, 255, 0.1);
}
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}
.mobile-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Banner */
.banner-container {
    width: 100%;
    height: 400px;
    overflow: hidden;
    margin-bottom: 40px;
    position: relative;
}
.banner-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
    display: block;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 50px;
    align-items: center;
    padding: 60px 0;
    margin-bottom: 40px;
}
.hero h1 {
    font-size: 3rem;
    text-align: left;
    margin-bottom: 25px;
}
.hero p {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Fact List */
.fact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}
.fact-list li {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    font-weight: 500;
    font-size: 1rem;
}
.fact-list li:last-child {
    border-bottom: none;
}
.fact-list strong {
    color: var(--accent);
}

/* General Sections */
section {
    padding: 40px 0;
    margin-bottom: 40px;
}
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent2);
}

/* Gallery Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}
.gallery-item {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.gallery-item:hover img {
    transform: scale(1.05);
}
.gallery-item p {
    padding: 20px;
    margin: 0;
    text-align: center;
    background: var(--card-bg);
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Certificate Styles - Optimized for 631x391 images */
.certificate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}
.certificate-item {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
}
.certificate-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.certificate-item img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    background: var(--light-bg);
    cursor: pointer;
    padding: 20px;
    transition: transform 0.3s ease;
}
.certificate-item:hover img {
    transform: scale(1.02);
}
.certificate-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.certificate-year {
    background: var(--accent);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 12px;
}

/* Special styling for the 631x391 certificate */
.certificate-item.horizontal-certificate img {
    height: 220px;
    object-fit: contain;
    background: linear-gradient(45deg, var(--light-bg) 25%, transparent 25%, transparent 75%, var(--light-bg) 75%);
    background-size: 20px 20px;
}

/* Programme Meta Information */
.programme-meta {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid var(--accent2);
    font-size: 0.85rem;
    flex-grow: 1;
}
.programme-meta strong {
    color: var(--primary);
}

/* Timeline markers for programme dates */
.timeline-marker {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 10px;
    margin-bottom: 8px;
}

/* Programme code styling */
.programme-code {
    font-family: 'Courier New', monospace;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 12px;
}

/* Timeline/History Specific */
#timeline {
    padding: 40px 0;
    position: relative;
}
.timeline-item {
    padding: 25px 0 25px 50px;
    position: relative;
    border-left: 3px solid var(--accent2);
    margin-left: 20px;
}
.timeline-item:last-child {
    border-left: none;
}
.timeline-item .year {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    font-weight: 700;
    position: absolute;
    left: 0;
    top: 25px;
    transform: translateX(calc(-100% - 15px));
    white-space: nowrap;
    box-shadow: var(--shadow);
}
.timeline-item::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 0;
    width: 16px;
    height: 16px;
    background-color: var(--accent2);
    border: 4px solid white;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 0 3px var(--light-bg);
}

/* Form Styles for register.php */
.form-card {
    max-width: 500px;
    margin: 50px auto;
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}
.form-group {
    margin-bottom: 25px;
}
.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--primary);
}
.form-card input[type="text"], 
.form-card input[type="email"], 
.form-card input[type="password"],
.form-card input[type="tel"],
.form-card input[type="number"],
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}
.form-card input:focus, 
.form-card select:focus,
.form-card textarea:focus {
    border-color: var(--accent2);
    outline: none;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
    transform: translateY(-2px);
}
.form-card textarea {
    resize: vertical;
    min-height: 120px;
}

/* Checkbox and Radio Styles */
.form-card input[type="checkbox"],
.form-card input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* FACEBOOK WIDGET STYLE */
.facebook-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.fb-page, .fb-page span, .fb-page iframe {
    max-width: 100% !important;
    border-radius: 8px;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: auto;
    color: var(--muted);
    border-top: 1px solid var(--border-color);
    background-color: var(--card-bg);
}
footer h3, footer h4 {
    color: var(--primary);
    margin-bottom: 20px;
}

/* Modal Styles */
.modal {
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.9); 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    background-color: transparent;
    margin: auto;
    padding: 0;
    border: none;
    width: auto;
    max-width: 90%;
    text-align: center;
    position: relative;
}
.close-btn {
    color: white;
    font-size: 40px;
    position: absolute;
    top: 20px;
    right: 30px;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s ease;
}
.close-btn:hover {
    color: var(--accent2);
}

/* Message Modal */
#messageModal .modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 40px;
    border: 1px solid #888;
    width: 80%; 
    max-width: 400px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

/* Press Release Styles */
.press-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.press-item {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.press-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.press-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
}
.press-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.press-date {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

/* Split Layout */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}
.split-image-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.split-text-content {
    padding: 20px;
}
.sidebar-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}
.main-content {
    flex: 1;
}
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Checkmark List */
.checkmark-list {
    list-style: none;
    padding: 0;
}
.checkmark-list li {
    padding: 12px 0;
    padding-left: 35px;
    position: relative;
    font-size: 1rem;
}
.checkmark-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
    font-size: 1.3rem;
}

/* Back to Top Button */
#backToTop {
    transition: all 0.3s ease;
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
}
#backToTop:hover {
    background-color: var(--accent-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Utility Classes */
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--muted); }
.bg-light { background-color: var(--light-bg); }
.bg-white { background-color: var(--card-bg); }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.mb-30 { margin-bottom: 30px; }
.mt-30 { margin-top: 30px; }

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 40px 0;
    }
    .hero h1 {
        font-size: 2.5rem;
        text-align: center;
    }
    .split-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .sidebar-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.7rem;
    }
    h3 {
        font-size: 1.3rem;
    }
    
    nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    .logo-area {
        width: 100%;
        justify-content: space-between;
    }
    .mobile-menu-btn {
        display: block;
    }
    .navlinks {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary);
        padding: 20px;
        box-shadow: var(--shadow-lg);
        z-index: 1000;
    }
    .navlinks.active {
        display: flex;
    }
    .navlinks a {
        margin: 8px 0;
        display: block;
        text-align: center;
        padding: 12px 20px;
    }
    
    .banner-container {
        height: 300px;
    }
    
    .cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .press-grid {
        grid-template-columns: 1fr;
    }
    .certificate-grid {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding: 30px 0;
    }
    .hero h1 {
        font-size: 2rem;
    }
    
    .form-card {
        margin: 30px auto;
        padding: 30px 20px;
    }
    
    /* Adjust timeline for small screens */
    .timeline-item .year {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin-bottom: 15px;
        display: inline-block;
    }
    .timeline-item::before {
        display: none;
    }
    .timeline-item {
        padding-left: 0;
        border-left: none;
        border-bottom: 2px dashed var(--border-color);
        margin-left: 0;
        padding-bottom: 30px;
    }
    .timeline-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* Optimize certificate display on mobile */
    .certificate-item img {
        height: 200px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .btn, .btn-submit {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .modal-content {
        max-width: 95%;
    }
    
    .close-btn {
        font-size: 30px;
        top: 10px;
        right: 15px;
    }

    /* Further optimize certificates for very small screens */
    .certificate-item img {
        height: 180px;
        padding: 10px;
    }
}

/* Print Styles */
@media print {
    .btn, .mobile-menu-btn, #backToTop {
        display: none !important;
    }
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    .certificate-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* High DPI Screen Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .certificate-item img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Success States */
.success {
    border-color: var(--accent-light) !important;
    background-color: rgba(22, 163, 74, 0.05) !important;
}

/* Error States */
.error {
    border-color: #e53e3e !important;
    background-color: rgba(229, 62, 62, 0.05) !important;
}