/* ========================================
   BARANGAY SERVICES MODAL
   index_services_modal.css
   ======================================== */

/* --- SERVICES TRIGGER BUTTON --- */
.services-fab {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    animation: fabEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1s backwards;
}

@keyframes fabEntrance {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.5);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.services-fab-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.services-fab-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ade80, #22c55e, #4ade80);
    z-index: -1;
    animation: fabRing 3s linear infinite;
}

@keyframes fabRing {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.services-fab-btn:hover {
    transform: scale(1.12) translateY(-4px);
    box-shadow: 0 16px 40px rgba(34, 197, 94, 0.65);
}

.services-fab-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(13, 59, 46, 0.92);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(74, 222, 128, 0.35);
    white-space: nowrap;
    font-family: 'DM Sans', sans-serif;
}

/* Pulse ring */
.services-fab-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(74, 222, 128, 0.7);
    animation: fabPulse 2s ease-out infinite;
}

@keyframes fabPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* --- MODAL OVERLAY --- */
.services-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 31, 24, 0.88);
    backdrop-filter: blur(8px);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.services-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- MODAL CONTAINER --- */
.services-modal {
    background: #1a4a38;
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 24px;
    width: 100%;
    max-width: 900px;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(74, 222, 128, 0.1);
    transform: translateY(40px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'DM Sans', sans-serif;
}

.services-overlay.active .services-modal {
    transform: translateY(0) scale(1);
}

/* --- MODAL HEADER --- */
.services-modal-header {
    padding: 28px 32px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(74, 222, 128, 0.15);
    position: relative;
    flex-shrink: 0;
}

.services-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #22c55e, #4ade80, #22c55e);
    border-radius: 24px 24px 0 0;
}

.services-modal-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.services-modal-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #4ade80;
}

.services-modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.services-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(74, 222, 128, 0.2);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: #a3c4b5;
    transition: all 0.25s ease;
    flex-shrink: 0;
    margin-top: 4px;
}

.services-modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    transform: rotate(90deg);
}

/* --- MODAL BODY --- */
.services-modal-body {
    padding: 24px 32px 32px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 222, 128, 0.4) transparent;
}

.services-modal-body::-webkit-scrollbar {
    width: 6px;
}

.services-modal-body::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, 0.4);
    border-radius: 3px;
}

/* --- SERVICES INTRO --- */
.services-intro {
    font-size: 0.92rem;
    color: #a3c4b5;
    margin-bottom: 28px;
    line-height: 1.7;
    font-weight: 300;
}

/* --- SERVICES GRID --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

/* --- SERVICE CARD --- */
.service-card {
    background: rgba(13, 59, 46, 0.7);
    border: 1px solid rgba(74, 222, 128, 0.15);
    border-radius: 16px;
    padding: 22px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--service-color, linear-gradient(90deg, #22c55e, #4ade80));
    border-radius: 16px 16px 0 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--service-glow, rgba(34, 197, 94, 0.08));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: rgba(74, 222, 128, 0.4);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover::after {
    opacity: 1;
}

.service-card-icon {
    font-size: 2rem;
    display: block;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.service-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.service-card-desc {
    font-size: 0.78rem;
    color: #a3c4b5;
    line-height: 1.5;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

.service-card-arrow {
    font-size: 0.75rem;
    color: #4ade80;
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.25s ease;
    position: relative;
    z-index: 1;
    margin-top: auto;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.service-card:hover .service-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* --- SERVICE CARD COLOR THEMES --- */
/* All top-bar accents kept colorful for visual variety;
   glow tints are subtle so they don't fight the dark green bg */
.service-card[data-type="clearance"] {
    --service-color: linear-gradient(90deg, #22c55e, #4ade80);
    --service-glow: rgba(34, 197, 94, 0.1);
}

.service-card[data-type="indigency"] {
    --service-color: linear-gradient(90deg, #0ea5e9, #38bdf8);
    --service-glow: rgba(14, 165, 233, 0.1);
}

.service-card[data-type="residency"] {
    --service-color: linear-gradient(90deg, #8b5cf6, #a78bfa);
    --service-glow: rgba(139, 92, 246, 0.1);
}

.service-card[data-type="business"] {
    --service-color: linear-gradient(90deg, #f59e0b, #fbbf24);
    --service-glow: rgba(245, 158, 11, 0.1);
}

.service-card[data-type="complaint"] {
    --service-color: linear-gradient(90deg, #ef4444, #f87171);
    --service-glow: rgba(239, 68, 68, 0.1);
}

.service-card[data-type="health"] {
    --service-color: linear-gradient(90deg, #10b981, #34d399);
    --service-glow: rgba(16, 185, 129, 0.1);
}

.service-card[data-type="id"] {
    --service-color: linear-gradient(90deg, #d97706, #fbbf24);
    --service-glow: rgba(217, 119, 6, 0.1);
}

.service-card[data-type="permit"] {
    --service-color: linear-gradient(90deg, #64748b, #94a3b8);
    --service-glow: rgba(100, 116, 139, 0.1);
}

/* --- MODAL FOOTER --- */
.services-modal-footer {
    padding: 16px 32px 24px;
    border-top: 1px solid rgba(74, 222, 128, 0.12);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.services-footer-note {
    font-size: 0.75rem;
    color: #a3c4b5;
    font-weight: 300;
}

.services-footer-note strong {
    color: #4ade80;
    font-weight: 600;
}

.services-footer-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #22c55e, #4ade80);
    color: #0d3b2e;
    /* dark green text on bright green btn — readable */
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.services-footer-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.45);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .services-fab {
        bottom: 24px;
        right: 24px;
    }

    .services-modal {
        border-radius: 20px;
        max-height: 92vh;
    }

    .services-modal-header {
        padding: 22px 20px 16px;
    }

    .services-modal-title {
        font-size: 1.5rem;
    }

    .services-modal-body {
        padding: 18px 20px 24px;
    }

    .services-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .services-modal-footer {
        padding: 14px 20px 20px;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .services-footer-cta {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
    }

    .services-fab-btn {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
    }
}