@import url('https://fonts.googleapis.com/css2?family=Karla:wght@400;700&family=Montserrat:wght@700;800&display=swap');

/* Global layout */

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f9fafb;
    color: #111827;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.dashboard-main {
    padding-top: 0; /* Remove padding for transparent navbar */
}

/* Navbar */
.dashboard-navbar,
.navbar.dashboard-navbar {
    background-color: transparent !important;
    backdrop-filter: blur(8px);
    box-shadow: none !important;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Larger logo and side-by-side text for index page */
.dashboard-navbar .navbar-brand,
.navbar.dashboard-navbar .navbar-brand {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-direction: row !important;
}

.dashboard-navbar .navbar-brand img,
.navbar.dashboard-navbar .navbar-brand img {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    margin-right: 8px !important;
}

.dashboard-navbar .navbar-brand .d-block,
.navbar.dashboard-navbar .navbar-brand .d-block {
    display: inline !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.dashboard-navbar .navbar-brand span,
.navbar.dashboard-navbar .navbar-brand span {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dashboard-navbar .navbar-brand span:first-of-type,
.navbar.dashboard-navbar .navbar-brand span:first-of-type {
    font-weight: 600 !important;
    margin-right: 8px !important;
}

/* Keep transparent on homepage, only add background when scrolled */
.dashboard-navbar.scrolled {
    background-color: rgba(107, 70, 193, 0.95);
    box-shadow: 0 2px 6px rgba(107, 70, 193, 0.3);
}


/* Navbar hover dropdown for Parish Services - JavaScript controlled */
.navbar .dropdown {
    position: relative;
}

.navbar .dropdown-menu {
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    top: 100%;
    margin-top: 0.5rem !important;
}

/* Show dropdown when clicked (open state) - override Bootstrap */
.navbar .dropdown.show .dropdown-menu,
.navbar .dropdown[aria-expanded="true"] .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure dropdown doesn't overlap navbar and stays aligned */
.dropdown-menu {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(52, 21, 57, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    padding: 0.5rem 0 !important;
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 0.6rem 1rem;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

/* Auto-hide navbar on scroll for homepage - HIGHEST PRIORITY */
.navbar.navbar-autohide {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.navbar.navbar-autohide.navbar-hidden {
    transform: translateY(-150px) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Allow background color change even when hidden */
.navbar.navbar-autohide.navbar-hidden.scrolled {
    transform: translateY(-150px) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    background-color: rgba(52, 21, 57, 0.96) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

/* Removed body:hover - now handled by JavaScript for precise cursor detection */

.navbar-brand {
    font-weight: 600;
    font-size: 18px;
    color: #ffffff !important;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.navbar-brand span {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-nav .nav-link {
    font-size: 14px;
    padding: 0.5rem 0.75rem;
    position: relative;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: color 0.2s ease;
    text-transform: none !important;
    letter-spacing: 0.05em;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.navbar-nav .nav-link:hover {
    color: #ffffff !important;
}

.navbar-nav .nav-link::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.1rem;
    height: 2px;
    border-radius: 999px;
    background-color: #341539;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    transform: scaleX(1);
}

.btn-login {
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
    border: 2px solid #1B4332;
    color: #ffffff;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #2D6A4F 0%, #1B4332 100%);
    border-color: #2D6A4F;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(107, 70, 193, 0.2);
    text-decoration: none;
}

.btn-login:active {
    transform: translateY(0);
}

.btn-logout {
    background: linear-gradient(135deg, #D32F2F 0%, #F4B400 100%);
    border: 2px solid #D32F2F;
    color: #ffffff;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #b02a37 0%, #dc2626 100%);
    border-color: #b02a37;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.2);
    text-decoration: none;
}

/* Hero section */

.hero-section {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../images/aglipayMIS.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
    padding: 2rem 1rem;
}

.hero-title {
    font-size: 58px !important;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    text-transform: none !important;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.hero-primary,
.hero-secondary {
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    padding: 0.75rem 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: none !important;
    letter-spacing: 0.05em;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-primary {
    background-color: #ffffff;
    color: #1B4332;
    box-shadow: 0 10px 25px rgba(27, 67, 50, 0.2);
}

.hero-primary:hover {
    background-color: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    color: #111827;
}

.hero-secondary {
    border: 2px solid rgba(255, 255, 255, 0.8);
    background-color: transparent;
    color: #ffffff;
}

.hero-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-2px);
}

/* Sections */

.section {
    padding: 3.5rem 0;
}

.section-muted {
    background-color: #f3f4f6;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.75rem;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
}

.section-subtitle {
    font-size: 13px;
    color: #6b7280;
}

/* Events */

.event-card {
    border-radius: 12px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.event-image-wrapper {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.event-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.event-body {
    padding: 1rem 1.1rem 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-date {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.event-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.event-description {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 0.75rem;
}

.event-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.btn-outline-dark {
    border-radius: 999px;
    font-size: 13px;
    padding: 0.4rem 1rem;
    border-color: #111827;
    color: #111827;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-outline-dark:hover {
    background-color: #111827;
    color: #f9fafb;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* Mass schedule */

.schedule-table {
    font-size: 14px;
}

.schedule-table thead th {
    border-bottom-width: 1px;
    border-color: #e5e7eb;
    font-weight: 500;
    color: #4b5563;
}

.schedule-table tbody tr {
    transition: background-color 0.2s ease;
}

.schedule-table tbody tr:hover {
    background-color: #f3f4f6;
}

/* Gallery */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: #e5e7eb;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.gallery-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-category {
    position: absolute;
    left: 0.75rem;
    bottom: 0.6rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 11px;
    background-color: rgba(17, 24, 39, 0.8);
    color: #f9fafb;
}

/* About */

.about-text {
    font-size: 14px;
    color: #4b5563;
    max-width: 46rem;
}

/* Footer */

.dashboard-footer {
    background-color: #341539;
    color: #e5e7eb;
    padding: 2.5rem 0 2rem;
    font-size: 13px;
}

.footer-heading {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer-link {
    color: #d1d5db;
    font-size: 13px;
}

.footer-link:hover {
    color: #f9fafb;
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 0.5rem;
}

.social-pill {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(209, 213, 219, 0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #e5e7eb;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social-pill:hover {
    background-color: #26102a;
    border-color: #f9fafb;
    transform: translateY(-1px);
}

.footer-bottom {
    border-top: 1px solid #26102a;
    margin-top: 1.5rem;
    padding-top: 1rem;
    font-size: 12px;
    color: #9ca3af;
}

@media (max-width: 767.98px) {
    .hero-section {
        min-height: 70vh;
    }

    .hero-title {
        font-size: 58px !important;
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-primary,
    .hero-secondary {
        width: 100%;
    }
}

