/* Design System & Custom Styles for Paroasy */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary: #d97706;
    --secondary-hover: #b45309;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #f1f5f9;
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

header.scrolled {
    box-shadow: var(--shadow-sm);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 76px;
}

.navbar-brand {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand span {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary-light);
    color: var(--primary-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #4f46e5 0%, #1e1b4b 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 32px;
}

/* Search bar on Home */
.search-wrapper {
    background: white;
    padding: 8px;
    border-radius: var(--radius-md);
    display: flex;
    gap: 8px;
    max-width: 650px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    border-radius: var(--radius-sm);
    color: var(--text-main);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Main Grid & Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.card-img-wrapper {
    position: relative;
    height: 180px;
    background-color: var(--border-color);
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: rgba(15, 23, 42, 0.85);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.card-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex: 1;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(248, 250, 252, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background-color: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* Alert notifications */
.alerts-container {
    margin-top: 20px;
}

.alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success {
    background-color: #dcfce7;
    border-left: 4px solid #16a34a;
    color: #14532d;
}

.alert-error, .alert-danger {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #7f1d1d;
}

/* Parish Page Detail Layout */
.parish-header {
    height: 350px;
    position: relative;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

.parish-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.parish-header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    padding: 40px 0;
    color: white;
}

.parish-header-content {
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.parish-logo-wrapper {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    background-color: white;
    padding: 4px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    flex-shrink: 0;
}

.parish-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-md) - 4px);
}

.parish-meta h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.parish-submeta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.parish-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.parish-section {
    background: white;
    padding: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.parish-section h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
}

/* Mass schedules styling */
.mass-table {
    width: 100%;
    border-collapse: collapse;
}

.mass-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
}

.mass-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-color);
}

.mass-day {
    font-weight: 700;
    color: var(--primary);
}

.mass-time {
    font-weight: 600;
    color: var(--text-main);
}

/* Form Styles */
.form-card {
    background-color: white;
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    max-width: 500px;
    margin: 60px auto;
}

.form-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 24px;
    text-align: center;
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab-btn.active, .tab-btn:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Photo Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.gallery-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 150px;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 8px;
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

/* Dashboard Sidebar & Admin layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    margin-top: 40px;
}

.dashboard-sidebar {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: fit-content;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Modern tables for list dashboards */
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.dashboard-table th {
    background-color: var(--bg-main);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

.dashboard-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.dashboard-table tr:last-child td {
    border-bottom: none;
}

/* Footer */
footer {
    background-color: #0f172a;
    color: rgba(255,255,255,0.7);
    padding: 40px 0;
    margin-top: 80px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

footer strong {
    color: white;
}

footer p {
    font-size: 14px;
    margin-top: 8px;
}

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

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

@media(max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 16px 0;
        gap: 12px;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .parish-grid, .dashboard-layout {
        grid-template-columns: 1fr;
    }
    
    .parish-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
