/* ============================================================
   PORTAL IREJAS PT — Design System
   Paleta: Azul royal + Branco + Cinza claro
   Tipografia: Inter (Google Fonts)
   Framework: Bootstrap 5 (apenas overrides e estilos próprios)
   ============================================================ */

/* ── Custom Properties ───────────────────────────────────── */
:root {
    --color-primary: #1a3c6e;
    --color-primary-dark: #0f2a4f;
    --color-primary-light: #2b5ea7;
    --color-accent: #4a90d9;
    --color-accent-hover: #3a7bc8;
    --color-white: #ffffff;
    --color-gray-50: #f8f9fa;
    --color-gray-100: #e9ecef;
    --color-gray-200: #dee2e6;
    --color-gray-300: #ced4da;
    --color-gray-400: #adb5bd;
    --color-gray-500: #6c757d;
    --color-gray-600: #495057;
    --color-gray-700: #343a40;
    --color-gray-800: #212529;
    --color-gray-900: #0d1117;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-star: #ffb400;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-radius: 0.5rem;
    --border-radius-sm: 0.25rem;
    --border-radius-lg: 1rem;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition-base: all 0.2s ease-in-out;
}

/* ── Reset & Base ────────────────────────────────────────── */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--color-gray-800);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-primary-light);
    transition: var(--transition-base);
}

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

/* ── Bootstrap Overrides ─────────────────────────────────── */
.bg-primary-royal {
    background-color: var(--color-primary) !important;
}

.btn-primary-royal {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

.btn-primary-royal:hover,
.btn-primary-royal:focus {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-white);
}

.btn-accent {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
}

.btn-accent:hover,
.btn-accent:focus {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: var(--color-white);
}

.btn-outline-accent {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-outline-accent:hover {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.text-primary-royal {
    color: var(--color-primary) !important;
}

.text-primary-light {
    color: var(--color-primary-light) !important;
}

.text-accent {
    color: var(--color-accent) !important;
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-base);
}

.navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ── Hero Section ────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 50%, #0d1f3c 100%);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/hero-pattern.svg') repeat;
    opacity: 0.05;
}

.hero-section h1 {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-section .lead {
    font-size: 1.15rem;
    opacity: 0.9;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
}

.hero-search .input-group {
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.hero-search .form-control {
    border: none;
    padding: 0.9rem 1.25rem;
    font-size: 1rem;
}

.hero-search .form-control:focus {
    box-shadow: none;
}

.hero-search .btn {
    padding: 0.9rem 1.75rem;
    font-weight: 600;
}

.hero-stats {
    margin-top: 3rem;
}

.hero-stats .stat-item {
    text-align: center;
    padding: 1rem;
}

.hero-stats .stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
}

.hero-stats .stat-label {
    font-size: 0.85rem;
    opacity: 0.75;
}

/* ── Church Card ─────────────────────────────────────────── */
.church-card {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition-base);
    height: 100%;
}

.church-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.church-card .card-img-top {
    height: 180px;
    object-fit: cover;
    background-color: var(--color-gray-100);
}

.church-card .card-img-placeholder {
    height: 180px;
    background: linear-gradient(135deg, var(--color-gray-100), var(--color-gray-200));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray-400);
    font-size: 3rem;
}

.church-card .card-body {
    padding: 1.25rem;
}

.church-card .church-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.church-card .church-name a {
    color: var(--color-gray-800);
    text-decoration: none;
}

.church-card .church-name a:hover {
    color: var(--color-primary-light);
}

.church-card .church-denomination {
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.church-card .church-location {
    font-size: 0.85rem;
    color: var(--color-gray-500);
    margin-bottom: 0.5rem;
}

.church-card .church-location i {
    margin-right: 0.35rem;
}

.church-card .church-rating {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.church-card .stars {
    color: var(--color-star);
    font-size: 0.85rem;
}

.church-card .rating-value {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    font-weight: 500;
}

.church-card .card-footer {
    background: transparent;
    border-top: 1px solid var(--color-gray-100);
    padding: 0.75rem 1.25rem;
}

.church-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.church-badge-verified {
    background-color: #d4edda;
    color: #155724;
}

.church-badge-featured {
    background-color: #fff3cd;
    color: #856404;
}

/* ── Map Page ────────────────────────────────────────────── */
.map-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
}

.map-container {
    flex: 1;
    position: relative;
}

#churchMap {
    width: 100%;
    height: 100%;
}

.map-sidebar {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 360px;
    max-height: calc(100% - 2rem);
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-sidebar .sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--color-gray-200);
}

.map-sidebar .sidebar-header h5 {
    margin: 0;
    font-weight: 600;
}

.map-sidebar .sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.map-sidebar .sidebar-list .list-item {
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    border-left: 3px solid transparent;
}

.map-sidebar .sidebar-list .list-item:hover {
    background-color: var(--color-gray-50);
    border-left-color: var(--color-accent);
}

/* ── Church Profile ──────────────────────────────────────── */
.profile-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 3rem 0 2rem;
    color: var(--color-white);
}

.profile-header .church-name {
    font-size: 2rem;
    font-weight: 700;
}

.profile-header .church-meta {
    opacity: 0.85;
    font-size: 0.95rem;
}

.profile-cover {
    height: 300px;
    background-size: cover;
    background-position: center;
    background-color: var(--color-gray-200);
}

.profile-section {
    padding: 2rem 0;
    border-bottom: 1px solid var(--color-gray-100);
}

.profile-section:last-child {
    border-bottom: none;
}

.profile-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.service-time-card {
    background: var(--color-gray-50);
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid var(--color-gray-200);
}

.service-time-card .day {
    font-weight: 600;
    color: var(--color-primary);
    min-width: 100px;
}

.service-time-card .time {
    color: var(--color-gray-600);
}

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

.gallery-grid img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
}

.gallery-grid img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* ── Review Card ─────────────────────────────────────────── */
.review-card {
    background: var(--color-gray-50);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    border: 1px solid var(--color-gray-200);
}

.review-card .review-author {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.review-card .review-date {
    font-size: 0.8rem;
    color: var(--color-gray-500);
}

.review-card .review-stars {
    color: var(--color-star);
}

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard-wrapper {
    display: flex;
    min-height: calc(100vh - 56px);
}

.dashboard-sidebar {
    width: 250px;
    background: var(--color-primary);
    color: var(--color-white);
    flex-shrink: 0;
    padding-top: 1rem;
}

.dashboard-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition-base);
}

.dashboard-sidebar .nav-link:hover,
.dashboard-sidebar .nav-link.active {
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--color-accent);
}

.dashboard-sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

.dashboard-content {
    flex: 1;
    padding: 2rem;
    background-color: var(--color-gray-50);
    overflow-y: auto;
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--color-gray-200);
    transition: var(--transition-base);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gray-800);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--color-gray-500);
}

.stat-card .stat-label a {
    font-size: 0.8rem;
}

/* ── Admin Dashboard ─────────────────────────────────────── */
.quick-actions .btn {
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.quick-actions .btn i {
    width: 1.5rem;
}

/* ── Tables ──────────────────────────────────────────────── */
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-gray-500);
}

/* ── Forms ───────────────────────────────────────────────── */
.form-section {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--color-gray-200);
    margin-bottom: 1.5rem;
}

.form-section h5 {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-gray-100);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 217, 0.25);
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-page {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-gray-50);
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
}

.auth-card .auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card .auth-header h3 {
    font-weight: 700;
    color: var(--color-primary);
}

.auth-card .auth-header p {
    color: var(--color-gray-500);
    font-size: 0.9rem;
}

/* ── Filters ─────────────────────────────────────────────── */
.filters-section {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    border: 1px solid var(--color-gray-200);
    margin-bottom: 1.5rem;
}

.filters-section .filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-500);
    margin-bottom: 0.35rem;
}

/* ── Stars Rating Input ──────────────────────────────────── */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.15rem;
}

.star-rating input {
    display: none;
}

.star-rating label {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--color-gray-300);
    transition: var(--transition-base);
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: var(--color-star);
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .map-sidebar {
        width: 300px;
    }

    .dashboard-sidebar {
        width: 200px;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 3rem 0 2.5rem;
    }

    .hero-section h1 {
        font-size: 1.6rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .hero-stats .stat-number {
        font-size: 1.35rem;
    }

    .map-page {
        height: auto;
        min-height: calc(100vh - 56px);
    }

    .map-sidebar {
        position: static;
        width: 100%;
        max-height: none;
        box-shadow: none;
        border-radius: 0;
        border-bottom: 1px solid var(--color-gray-200);
    }

    #churchMap {
        height: 400px;
    }

    .profile-header .church-name {
        font-size: 1.5rem;
    }

    .dashboard-wrapper {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        padding-top: 0;
    }

    .dashboard-sidebar .nav {
        display: flex;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .dashboard-sidebar .nav-link {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        padding: 0.75rem;
    }

    .dashboard-sidebar .nav-link:hover,
    .dashboard-sidebar .nav-link.active {
        border-left-color: transparent;
        border-bottom-color: var(--color-accent);
    }

    .dashboard-content {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
        box-shadow: none;
    }

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

@media (max-width: 575.98px) {
    .hero-section h1 {
        font-size: 1.35rem;
    }

    .church-card .card-img-top,
    .church-card .card-img-placeholder {
        height: 140px;
    }
}
