/*
 * CSWD Custom Styles
 * City Social Welfare and Development - Cagayan de Oro City
 * Color Scheme: CDO Official Blue & Gold
 */

/* ============================================
   CSS Variables - CDO Color Palette
   ============================================ */
:root {
    /* Primary Colors - CDO Blue */
    --cdo-blue: #003366;
    --cdo-blue-dark: #002244;
    --cdo-blue-light: #004488;
    --cdo-blue-soft: #e6f0fa;
    
    /* Secondary Colors - CDO Gold */
    --cdo-gold: #FFD700;
    --cdo-gold-dark: #DAA520;
    --cdo-gold-light: #FFE44D;
    --cdo-gold-soft: #fff9e6;
    
    /* Accent Colors */
    --cdo-success: #28a745;
    --cdo-info: #17a2b8;
    --cdo-warning: #ffc107;
    --cdo-danger: #dc3545;
    --cdo-purple: #6f42c1;
    
    /* Neutral Colors */
    --cdo-white: #ffffff;
    --cdo-light: #f8f9fa;
    --cdo-gray-100: #f1f3f5;
    --cdo-gray-200: #e9ecef;
    --cdo-gray-300: #dee2e6;
    --cdo-gray-400: #ced4da;
    --cdo-gray-500: #adb5bd;
    --cdo-gray-600: #6c757d;
    --cdo-gray-700: #495057;
    --cdo-gray-800: #343a40;
    --cdo-dark: #212529;
    
    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    
    /* Header */
    --header-height: 60px;
    --quick-nav-height: 45px;
    
    /* Transitions */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--cdo-gray-800);
    background-color: var(--cdo-gray-100);
    overflow-x: hidden;
}

a {
    color: var(--cdo-blue);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--cdo-blue-dark);
}

/* ============================================
   Language Toggle Styles
   ============================================ */
.ceb {
    display: none;
}

body.lang-ceb .en {
    display: none;
}

body.lang-ceb .ceb {
    display: inline;
}

/* ============================================
   Bootstrap Overrides
   ============================================ */
.btn-primary {
    background-color: var(--cdo-blue);
    border-color: var(--cdo-blue);
}

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

.btn-gold {
    background-color: var(--cdo-gold);
    border-color: var(--cdo-gold);
    color: var(--cdo-blue-dark);
    font-weight: 600;
}

.btn-gold:hover,
.btn-gold:focus {
    background-color: var(--cdo-gold-dark);
    border-color: var(--cdo-gold-dark);
    color: var(--cdo-blue-dark);
}

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

.btn-outline-gold:hover {
    background-color: var(--cdo-gold);
    color: var(--cdo-blue-dark);
}

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

.btn-purple:hover {
    background-color: #5a32a3;
    border-color: #5a32a3;
    color: white;
}

.bg-primary {
    background-color: var(--cdo-blue) !important;
}

.bg-primary-dark {
    background-color: var(--cdo-blue-dark) !important;
}

.bg-gold {
    background-color: var(--cdo-gold) !important;
}

.bg-purple {
    background-color: var(--cdo-purple) !important;
}

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

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

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

/* ============================================
   Layout - App Wrapper
   ============================================ */
#app-wrapper {
    min-height: 100vh;
}

#main-content-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition-base);
    margin-left: var(--sidebar-width);
}

.main-content {
    flex: 1;
}

/* ============================================
   Sidebar Styles
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--cdo-blue-dark) 0%, var(--cdo-blue) 100%);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: var(--transition-base);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 15px 20px;
    background-color: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    margin-right: 10px;
}

.sidebar-brand-text {
    color: white;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
}

.sidebar-close {
    display: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-header {
    padding: 15px 20px 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cdo-gold);
    font-weight: 600;
}

.sidebar-menu-item {
    margin: 2px 10px;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    transition: var(--transition-fast);
}

.sidebar-menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-menu-link.active {
    background-color: var(--cdo-gold);
    color: var(--cdo-blue-dark);
    font-weight: 600;
}

.sidebar-menu-link i {
    font-size: 1.1rem;
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

/* ============================================
   Header Styles
   ============================================ */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.main-header .navbar {
    height: var(--header-height);
    padding: 0 15px;
}

.header-logo {
    width: 40px;
    height: 40px;
}

.brand-text {
    line-height: 1.2;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: block;
}

.brand-subtitle {
    font-size: 0.7rem;
    opacity: 0.8;
}

.language-toggle .lang-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.language-toggle .lang-btn.active {
    background-color: var(--cdo-gold);
    border-color: var(--cdo-gold);
    color: var(--cdo-blue-dark);
}

/* Quick Nav */
.quick-nav {
    height: var(--quick-nav-height);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.quick-nav-item {
    height: 100%;
}

.quick-nav-link {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    transition: var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.quick-nav-link:hover,
.quick-nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: var(--cdo-gold);
}

.quick-nav-text {
    font-size: 0.8rem;
    padding: 0 15px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--cdo-blue-dark) 0%, var(--cdo-blue) 50%, var(--cdo-blue-light) 100%);
    padding: 60px 0;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><polygon fill="rgba(255,255,255,0.03)" points="0,100 100,0 100,100"/></svg>');
    background-size: cover;
}

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

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.hero-description {
    max-width: 600px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.85);
}

/* ============================================
   Stats Section
   ============================================ */
.stats-section {
    background-color: white;
    margin-top: -30px;
    position: relative;
    z-index: 10;
    border-radius: 0;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: var(--transition-base);
}

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

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
}

.bg-primary-soft {
    background-color: var(--cdo-blue-soft);
}

.bg-success-soft {
    background-color: rgba(40, 167, 69, 0.1);
}

.bg-warning-soft {
    background-color: rgba(255, 193, 7, 0.15);
}

.bg-info-soft {
    background-color: rgba(23, 162, 184, 0.1);
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cdo-gray-800);
    margin-bottom: 0;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--cdo-gray-600);
    margin-bottom: 0;
}

/* ============================================
   Services Section
   ============================================ */
.services-section {
    background-color: var(--cdo-gray-100);
}

.section-header {
    margin-bottom: 40px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cdo-blue-dark);
    margin-bottom: 10px;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--cdo-gray-600);
}

.service-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
}

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

.service-card-header {
    padding: 25px;
    text-align: center;
    position: relative;
}

.service-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2rem;
    color: white;
}

.service-card-body {
    padding: 20px 25px;
    flex: 1;
}

.service-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cdo-gray-800);
    margin-bottom: 10px;
}

.service-description {
    font-size: 0.9rem;
    color: var(--cdo-gray-600);
    margin-bottom: 15px;
}

.service-requirements {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.service-requirements li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
    color: var(--cdo-gray-600);
}

.service-requirements li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--cdo-success);
    font-weight: bold;
}

.service-card-footer {
    padding: 15px 25px 25px;
}

/* ============================================
   Status Check Section
   ============================================ */
.status-section {
    background-color: var(--cdo-gray-100);
}

.status-check-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

.status-check-header {
    margin-bottom: 25px;
}

.status-result {
    animation: fadeIn 0.3s ease;
}

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

/* ============================================
   Districts Section
   ============================================ */
.districts-section {
    background-color: white;
}

.district-card {
    background: var(--cdo-gray-100);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    transition: var(--transition-base);
}

.district-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.district-card.main-office {
    background: linear-gradient(135deg, var(--cdo-blue-soft) 0%, white 100%);
    border: 2px solid var(--cdo-gold);
}

.district-header {
    padding: 15px 20px;
    background: var(--cdo-blue);
    display: flex;
    align-items: center;
}

.district-card.main-office .district-header {
    background: linear-gradient(135deg, var(--cdo-blue-dark) 0%, var(--cdo-blue) 100%);
}

.district-badge {
    width: 40px;
    height: 40px;
    background: var(--cdo-gold);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--cdo-blue-dark);
    margin-right: 12px;
}

.district-name {
    color: white;
    margin: 0;
    font-size: 1.1rem;
}

.district-body {
    padding: 20px;
}

.district-body p {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.district-barangays {
    padding-top: 10px;
    border-top: 1px solid var(--cdo-gray-300);
    margin-top: 10px;
}

/* ============================================
   Contact Section
   ============================================ */
.contact-section {
    background: linear-gradient(135deg, var(--cdo-blue-dark) 0%, var(--cdo-blue) 100%);
}

.contact-item {
    display: flex;
    align-items: flex-start;
}

.contact-item i {
    font-size: 1.25rem;
    width: 30px;
}

.contact-form-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    color: var(--cdo-gray-800);
}

.captcha-display {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: 3px;
    background: linear-gradient(45deg, var(--cdo-blue-soft), var(--cdo-gray-200));
    min-width: 120px;
    justify-content: center;
}

/* ============================================
   Quick Links Section
   ============================================ */
.quick-link-card {
    background: white;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition-base);
    height: 100%;
}

.quick-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Footer Styles
   ============================================ */
.main-footer {
    background: var(--cdo-blue-dark);
    color: white;
}

.footer-main {
    padding: 50px 0 30px;
}

.footer-brand {
    display: flex;
    align-items: center;
}

.footer-logo {
    width: 50px;
    height: 50px;
}

.footer-title {
    color: var(--cdo-gold);
}

.footer-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.social-link {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--cdo-gold);
    color: var(--cdo-blue-dark);
}

.footer-heading {
    color: var(--cdo-gold);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--cdo-gold);
    padding-left: 5px;
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-contact li i {
    margin-right: 10px;
    margin-top: 3px;
    color: var(--cdo-gold);
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-contact a:hover {
    color: var(--cdo-gold);
}

.footer-hotline {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 3px solid var(--cdo-gold);
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px 0;
    font-size: 0.85rem;
}

/* ============================================
   Back to Top Button
   ============================================ */
.btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.btn-back-to-top.show {
    display: flex;
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner .spinner-border {
    width: 50px;
    height: 50px;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb-container {
    background: white;
    padding: 12px 0;
    border-bottom: 1px solid var(--cdo-gray-200);
}

.breadcrumb {
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: var(--cdo-gray-600);
}

.breadcrumb-item.active {
    color: var(--cdo-blue);
}

/* ============================================
   Form Styles
   ============================================ */
.form-label {
    font-weight: 500;
    color: var(--cdo-gray-700);
    margin-bottom: 6px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cdo-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 51, 102, 0.15);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--cdo-danger);
}

/* ============================================
   Modal Styles
   ============================================ */
.modal-header.bg-primary {
    background: linear-gradient(135deg, var(--cdo-blue-dark) 0%, var(--cdo-blue) 100%) !important;
}

.modal-content {
    border: none;
    border-radius: 12px;
}

.modal-header {
    border-radius: 12px 12px 0 0;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 991.98px) {
    #main-content-wrapper {
        margin-left: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 767.98px) {
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .service-card-header {
        padding: 20px;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }
    
    .footer-main {
        padding: 30px 0 20px;
    }
    
    .contact-form-card {
        padding: 20px;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .stats-section {
        margin-top: -20px;
    }
    
    .btn-back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .sidebar,
    .main-header,
    .main-footer,
    .btn-back-to-top,
    .loading-overlay {
        display: none !important;
    }
    
    #main-content-wrapper {
        margin-left: 0 !important;
    }
    
    body {
        background: white;
    }
    
    .service-card,
    .stat-card,
    .district-card {
        break-inside: avoid;
    }
}