:root {
    --portal-primary: #2563eb;
    --portal-primary-hover: #1d4ed8;
    --portal-secondary: #64748b;
    --portal-dark: #0f172a;
    --portal-light: #f8fafc;
    --portal-white: #ffffff;
    --portal-gray: #f1f5f9;
    --portal-text: #334155;
    --portal-text-muted: #64748b;
    --portal-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --portal-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --portal-radius: 0.75rem;
    --portal-radius-lg: 1rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--portal-text);
    background-color: var(--portal-white);
    line-height: 1.6;
}

.portal-page {
    font-size: 16px;
}

.portal-page .display-2 {
    font-size: clamp(2rem, 4.2vw, 3rem) !important;
    line-height: 1.15;
}
.portal-page .display-5 {
    font-size: clamp(1.6rem, 2.6vw, 2.1rem) !important;
    line-height: 1.2;
}
.portal-page .lead {
    font-size: 1.05rem;
}

/* Navbar */
.navbar {
    padding: 1rem 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s;
}

/* Hero Section */
.portal-hero {
    position: relative;
    padding: 56px 0;
    background-color: var(--portal-dark);
    color: white;
    overflow: hidden;
    min-height: 42vh;
    display: flex;
    align-items: center;
}

.portal-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.6) 100%);
    z-index: 1;
}

.portal-hero-content {
    position: relative;
    z-index: 2;
}

.portal-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.4;
}

.hero-title {
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
}

/* Sections */
.section-title {
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--portal-primary);
    border-radius: 2px;
}

/* Cards */
.portal-card {
    border: none;
    border-radius: var(--portal-radius);
    background: var(--portal-white);
    box-shadow: var(--portal-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.portal-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--portal-shadow-lg);
}

.portal-card-img-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.portal-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portal-card:hover .portal-card-img {
    transform: scale(1.1);
}

.portal-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.portal-card-title {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--portal-dark);
}

.portal-card-text {
    color: var(--portal-text-muted);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}

/* Versiculos */
.versiculo-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    position: relative;
    overflow: hidden;
    padding: 100px 0;
}

.versiculo-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
}

.versiculo-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

.versiculo-card .bi-quote {
    color: var(--portal-primary);
    opacity: 0.4;
    font-size: 4rem;
}

/* Rich text (portal) */
.portal-rich {
    color: var(--portal-text);
    line-height: 1.8;
    font-size: 1rem;
}
.portal-rich p { margin-bottom: 1rem; }
.portal-rich ul, .portal-rich ol { margin: 0 0 1rem 1.25rem; }
.portal-rich a { color: var(--portal-primary); text-decoration: underline; }
.portal-rich b, .portal-rich strong { font-weight: 700 !important; color: #111827; }
.portal-rich i, .portal-rich em { font-style: italic; }

.versiculo-card .display-6 {
    font-size: 2.25rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

@media (max-width: 768px) {
    .versiculo-card {
        padding: 3rem 1.5rem;
    }
    .versiculo-card .display-6 {
        font-size: 1.5rem;
    }
}

/* Buttons */
.btn-portal-primary {
    background-color: var(--portal-primary);
    border-color: var(--portal-primary);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-portal-primary:hover {
    background-color: var(--portal-primary-hover);
    border-color: var(--portal-primary-hover);
    color: white;
    transform: translateY(-1px);
}

/* Footer */
.portal-footer {
    background-color: var(--portal-dark);
    color: #94a3b8;
    padding: 80px 0 40px;
}

.footer-title {
    color: white;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer-link {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    margin-bottom: 0.75rem;
}

.footer-link:hover {
    color: white;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: white;
    transition: all 0.3s;
}

.social-icon:hover {
    background: var(--portal-primary);
    transform: translateY(-3px);
}

/* Agenda */
.agenda-card {
    border: none;
    border-radius: var(--portal-radius);
    background: var(--portal-white);
    box-shadow: var(--portal-shadow);
    overflow: hidden;
    height: 100%;
}

.agenda-item {
    padding: 1.25rem;
    border-bottom: 1px solid var(--portal-gray);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.agenda-item:last-child {
    border-bottom: none;
}

.agenda-item:hover {
    background: var(--portal-light);
}

.day-badge {
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: var(--portal-gray);
    color: var(--portal-primary);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    transition: all 0.2s;
}

.agenda-item:hover .day-badge {
    background: var(--portal-primary);
    color: white;
    transform: scale(1.05);
}

/* Hero & Titlebar */
#carouselHero .carousel-item {
    height: 400px;
}

@media (max-width: 768px) {
    #carouselHero .carousel-item {
        height: 250px;
    }
}

.portal-page-campo #carouselHero .carousel-item,
.portal-page-igreja #carouselHero .carousel-item {
    height: auto;
}

.portal-page-campo #carouselHero .hero-banner-container,
.portal-page-igreja #carouselHero .hero-banner-container {
    min-height: 260px;
    max-height: 420px;
}

.portal-page-campo #carouselHero .hero-banner-img,
.portal-page-igreja #carouselHero .hero-banner-img {
    max-height: 420px;
}

.portal-page-igreja #carouselHero,
.portal-page-igreja #carouselHero .carousel-inner {
    overflow: hidden;
    background: var(--portal-dark);
}

.portal-page-campo #carouselHero .carousel-item {
    height: auto;
}

.portal-page-campo #carouselHero .hero-banner-container {
    max-height: 420px;
}

.portal-page-campo #carouselHero .hero-banner-img {
    max-height: 420px;
}

/* Specific Card adjustments */
.church-logo-card {
    width: clamp(56px, 6vw, 76px);
    height: clamp(56px, 6vw, 76px);
    object-fit: contain;
    margin-bottom: 1rem;
    background: white;
    padding: 6px;
    border-radius: 50%;
    box-shadow: var(--portal-shadow);
}

.section-about-img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--portal-radius-lg);
}

@media (max-width: 991px) {
    .section-about-img {
        max-height: 300px;
        margin-top: 2rem;
    }
}

.carousel-caption {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--portal-radius-lg);
    padding: 2rem;
    bottom: 10%;
    left: 5%;
    right: 5%;
    max-width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-page-campo #carouselHero .carousel-caption,
.portal-page-igreja #carouselHero .carousel-caption {
    background: rgba(15, 23, 42, 0.55);
    padding: 0.75rem 1rem;
    bottom: 6%;
    left: 4%;
    right: 4%;
    max-width: 520px;
}

.portal-page-campo #carouselHero .carousel-caption h1,
.portal-page-igreja #carouselHero .carousel-caption h1 {
    font-size: clamp(1.25rem, 2.2vw, 2.1rem) !important;
    line-height: 1.15;
    margin-bottom: 0.75rem !important;
}

.portal-page-campo #carouselHero .carousel-caption .btn,
.portal-page-igreja #carouselHero .carousel-caption .btn {
    padding: 0.45rem 1rem !important;
    font-size: 0.9rem !important;
}

@media (min-width: 768px) {
    .carousel-caption {
        bottom: 15%;
        left: 10%;
        max-width: 600px;
        padding: 3rem;
    }

    .portal-page-campo #carouselHero .carousel-caption,
    .portal-page-igreja #carouselHero .carousel-caption {
        bottom: 8%;
        left: 6%;
        right: auto;
        max-width: 520px;
        padding: 1rem 1.25rem;
    }
}

@media (max-width: 576px) {
    .carousel-caption {
        padding: 1.25rem;
        bottom: 5%;
    }
    .carousel-caption h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.75rem !important;
    }
    .carousel-caption .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }
}

.hero-titlebar {
    background: #1e293b;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 10;
}

.hero-logo-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    padding: 2px;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.hero-logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hero-logo-main {
    width: clamp(84px, 10vw, 124px);
    height: clamp(84px, 10vw, 124px);
    object-fit: contain;
    background: #fff;
    padding: 8px;
}

.hero-pastor-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--portal-primary);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
}

.letter-spacing-1 {
    letter-spacing: 0.05em;
}

.hero-pastor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Alertas */
.alertas-container {
    position: relative;
    z-index: 1050;
}

.alert-modern {
    background: #fbbf24;
    color: #000;
    border: none;
    font-size: 0.9375rem;
}

.alert-title-truncate {
    max-width: 420px;
}

@media (max-width: 576px) {
    .alert-title-truncate {
        max-width: 100%;
    }
}

.btn-alert-details {
    font-size: 0.7rem;
}

.alert-index-badge {
    font-size: 0.7rem;
    min-width: 30px;
    text-align: center;
}

/* Church Portal Header Banner (Further Reduction - No Cropping) */
.hero-banner-img {
    width: 100%;
    height: auto;
    max-height: 350px; /* Limit height to avoid "gigantic" appearance */
    object-fit: contain; /* Ensure no cropping */
    background-color: var(--portal-dark); /* Fallback background */
}

.hero-banner-container {
    background-color: var(--portal-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

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

.portal-page-campo .navbar-brand img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    flex-shrink: 0;
}

.portal-card-clickable {
    cursor: pointer;
}

.portal-page-campo #eventos .portal-card-img-wrapper {
    background: var(--portal-dark);
}

.portal-page-campo #eventos .portal-card-img {
    object-fit: contain;
    background: var(--portal-dark);
}

.portal-page-campo #eventos .portal-card:hover .portal-card-img {
    transform: none;
}

.portal-page-igreja #eventos .portal-card-img-wrapper {
    background: var(--portal-dark);
}

.portal-page-igreja #eventos .portal-card-img {
    object-fit: contain;
    background: var(--portal-dark);
}

.portal-page-igreja #eventos .portal-card:hover .portal-card-img {
    transform: none;
}

.footer-contact-icon {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.text-micro-uppercase {
    font-size: 0.65rem;
    letter-spacing: 1px;
}

.agenda-time-icon {
    font-size: 0.75rem;
}

.agenda-month {
    font-size: 0.6rem;
}

.agenda-color-bar {
    border-left-width: 4px !important;
}

.agenda-desc-truncate {
    max-width: 200px;
}

.pre-wrap {
    white-space: pre-wrap;
}

.modal-scroll-box {
    max-height: 250px;
}

.modal-event-img {
    object-fit: cover;
}

.border-dashed {
    border-style: dashed !important;
}

.aviso-image {
    max-height: 250px;
    width: 100%;
    object-fit: cover;
}

.alert-modal-img {
    max-height: 300px;
    object-fit: cover;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}
