/* Styles pour l'Église Néo-Apostolique Congo Brazzaville */
:root {
    --primary-color: #005CA9;  /* Bleu ENA */
    --secondary-color: #0078D4;
    --accent-color: #FFB81C;
    --dark-blue: #003366;
    --light-blue: #E6F2FF;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --text-dark: #212529;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #f4f6f9;
}

body.menu-open {
    overflow: hidden;
}

body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Header & Navigation */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-blue) 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-main {
    padding: 15px 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section img {
    width: 60px;
    height: 60px;
    background-color: white;
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.logo-section p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Navigation */
.navbar {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0;
    position: relative;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 15px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    display: block;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-bottom: 3px solid var(--accent-color);
}

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

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* Main Content */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #005CA9 0%, #003366 100%) !important;
    color: white !important;
    margin-bottom: 30px;
    border: none;
}

.hero-section .card-body,
.hero-body {
    padding: 50px;
    text-align: center;
    background: transparent !important;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: white !important;
}

.hero-text {
    font-size: 1.2rem;
    margin-bottom: 30px;
    line-height: 1.8;
    color: white !important;
}

@media (max-width: 768px) {
    .hero-section .card-body,
    .hero-body {
        padding: 30px 20px !important;
    }
    
    .hero-title {
        font-size: 1.6rem !important;
        margin-bottom: 15px;
    }
    
    .hero-text {
        font-size: 1rem !important;
        margin-bottom: 20px;
    }
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

@media (max-width: 968px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.stat-card.blue {
    border-left-color: var(--primary-color);
}

.stat-card.green {
    border-left-color: var(--success-color);
}

.stat-card.orange {
    border-left-color: var(--warning-color);
}

.stat-card.purple {
    border-left-color: #6f42c1;
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-card-title {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background-color: var(--light-blue);
    color: var(--primary-color);
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

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

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    border-bottom: none;
}

.card-body {
    padding: 25px;
}

.card-footer {
    background-color: var(--bg-light);
    padding: 15px 25px;
    border-top: 1px solid var(--border-color);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--light-blue);
    transition: background-color 0.2s ease;
}

.table-striped tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 92, 169, 0.3);
}

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

.btn-success:hover {
    background-color: #218838;
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--text-dark);
}

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

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

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-responsive {
    flex: 1;
}

@media (max-width: 768px) {
    .btn-responsive {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
    }
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 92, 169, 0.1);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: var(--success-color);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: var(--warning-color);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--info-color);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: var(--text-dark);
}

.badge-info {
    background-color: var(--info-color);
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-color) 100%);
    color: white;
    padding: 30px 0;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-blue) 100%);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 450px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header img {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-2 {
    gap: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Header adjustments */
    .header-top {
        padding: 8px 0;
    }
    
    .header-top .d-flex {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .header-top span {
        font-size: 0.85rem;
    }
    
    .header-main {
        padding: 10px 0;
    }
    
    .logo-section {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .logo-section img {
        width: 50px;
        height: 50px;
    }
    
    .logo-section h1 {
        font-size: 1.1rem;
    }
    
    .logo-section p {
        font-size: 0.85rem;
    }
    
    /* Navigation mobile */
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-blue) 100%);
        flex-direction: column;
        padding-top: 80px;
        transition: right 0.3s ease;
        z-index: 1000;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-menu a {
        padding: 18px 25px;
        font-size: 1rem;
        border-bottom: none !important;
    }
    
    .nav-menu a:hover,
    .nav-menu a.active {
        background-color: rgba(255, 255, 255, 0.2);
        border-left: 4px solid var(--accent-color);
    }
    
    /* Dashboard grid - 1 column on mobile */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Stats cards */
    .stat-card {
        padding: 20px;
    }
    
    .stat-card-value {
        font-size: 2rem;
    }
    
    /* Tables responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 0.85rem;
        min-width: 600px;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    /* Cards */
    .card {
        margin-bottom: 20px;
    }
    
    .card-header {
        padding: 15px;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-sm {
        padding: 8px 15px;
        font-size: 0.85rem;
        width: auto;
        margin-bottom: 5px;
    }
    
    /* Grid layouts to single column */
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: 2fr 1fr"] {
        display: block !important;
    }
    
    div[style*="grid-template-columns: 1fr 1fr"] > div,
    div[style*="grid-template-columns: 2fr 1fr"] > div {
        margin-bottom: 20px;
    }
    
    /* Quick actions */
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .quick-action-btn {
        padding: 15px;
        font-size: 0.9rem;
    }
    
    .quick-action-btn i {
        font-size: 1.5rem;
    }
    
    /* Footer */
    .footer {
        padding: 20px 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-bottom {
        font-size: 0.85rem;
    }
    
    /* Login page */
    .login-container {
        padding: 15px;
    }
    
    .login-box {
        padding: 25px;
    }
    
    .login-header img {
        width: 80px;
        height: 80px;
    }
    
    /* Utility classes mobile */
    .d-flex {
        flex-direction: column;
        gap: 10px;
    }
    
    .justify-between {
        justify-content: flex-start;
    }
    
    /* Hide on mobile helper */
    .hide-mobile {
        display: none !important;
    }
    
    /* Text adjustments */
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    /* Spacing adjustments */
    .main-content {
        padding: 20px 0;
    }
    
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .mt-3 {
        margin-top: 1rem !important;
    }
    
    /* Hero section on index */
    .card[style*="background: linear-gradient"] .card-body {
        padding: 30px 20px !important;
    }
    
    .card[style*="background: linear-gradient"] h1 {
        font-size: 1.8rem !important;
    }
    
    .card[style*="background: linear-gradient"] p {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    /* Extra small devices */
    .container {
        padding: 0 10px;
    }
    
    .header-main {
        padding: 8px 0;
    }
    
    .logo-section h1 {
        font-size: 1rem;
    }
    
    .logo-section p {
        font-size: 0.8rem;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card-value {
        font-size: 1.8rem;
    }
    
    .stat-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .card-header {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .quick-action-btn {
        padding: 12px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    h2 {
        font-size: 1.1rem;
    }
}

/* Tablet specific (landscape) */
@media (min-width: 769px) and (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-menu {
        flex-wrap: wrap;
    }
    
    .nav-menu li {
        flex: 1 1 auto;
    }
    
    .nav-menu a {
        font-size: 0.9rem;
        padding: 12px 15px;
    }
}

/* Print styles */
@media print {
    .header,
    .navbar,
    .footer,
    .btn,
    .quick-actions {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .header-main {
        padding: 5px 0;
    }
    
    .logo-section {
        flex-direction: row;
        gap: 10px;
    }
    
    .logo-section img {
        width: 40px;
        height: 40px;
    }
    
    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .nav-menu li {
        width: auto;
        flex: 1;
    }
    
    .nav-menu a {
        padding: 10px;
        font-size: 0.85rem;
    }
}

/* High resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-section img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility - Reduce motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Future dark mode styles can go here */
}

/* Additional responsive utilities */
.text-center-mobile {
    text-align: center;
}

@media (min-width: 769px) {
    .text-center-mobile {
        text-align: left;
    }
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive tables wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .table-wrapper {
        margin: 0 -15px;
        padding: 0 15px;
    }
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.quick-action-btn {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 92, 169, 0.3);
}

.quick-action-btn i {
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
