/* ════════════════════════════════════════════════════════════════
   PREMIUM SaaS SERVICE CARDS DESIGN SYSTEM
   Advanced responsive layouts, gradients, and hover elevations
   ═════════════════════════════════════════════════════════════════ */

/* ── Color Variable Mapping for Accent Themes ─────────────────── */
.card-accent-blue {
    --accent-color: #1e40af;
    --shadow-color: rgba(30, 64, 175, 0.12);
    --badge-bg: rgba(30, 64, 175, 0.08);
    --icon-bg: rgba(30, 64, 175, 0.05);
    --accent-gradient: linear-gradient(135deg, #1e40af, #3b82f6);
}
.card-accent-purple {
    --accent-color: #8b5cf6;
    --shadow-color: rgba(139, 92, 246, 0.12);
    --badge-bg: rgba(139, 92, 246, 0.08);
    --icon-bg: rgba(139, 92, 246, 0.05);
    --accent-gradient: linear-gradient(135deg, #8b5cf6, #a78bfa);
}
.card-accent-green {
    --accent-color: #10b981;
    --shadow-color: rgba(16, 185, 129, 0.12);
    --badge-bg: rgba(16, 185, 129, 0.08);
    --icon-bg: rgba(16, 185, 129, 0.05);
    --accent-gradient: linear-gradient(135deg, #10b981, #34d399);
}
.card-accent-orange {
    --accent-color: #e65f05;
    --shadow-color: rgba(230, 95, 5, 0.12);
    --badge-bg: rgba(230, 95, 5, 0.08);
    --icon-bg: rgba(230, 95, 5, 0.05);
    --accent-gradient: linear-gradient(135deg, #e65f05, #fb923c);
}
.card-accent-cyan {
    --accent-color: #0ea5e9;
    --shadow-color: rgba(14, 165, 233, 0.12);
    --badge-bg: rgba(14, 165, 233, 0.08);
    --icon-bg: rgba(14, 165, 233, 0.05);
    --accent-gradient: linear-gradient(135deg, #0ea5e9, #38bdf8);
}
.card-accent-red {
    --accent-color: #f43f5e;
    --shadow-color: rgba(244, 63, 94, 0.12);
    --badge-bg: rgba(244, 63, 94, 0.08);
    --icon-bg: rgba(244, 63, 94, 0.05);
    --accent-gradient: linear-gradient(135deg, #f43f5e, #fb7185);
}
.card-accent-navy {
    --accent-color: #0f172a;
    --shadow-color: rgba(15, 23, 42, 0.12);
    --badge-bg: rgba(15, 23, 42, 0.08);
    --icon-bg: rgba(15, 23, 42, 0.05);
    --accent-gradient: linear-gradient(135deg, #0f172a, #475569);
}
.card-accent-pink {
    --accent-color: #ec4899;
    --shadow-color: rgba(236, 72, 153, 0.12);
    --badge-bg: rgba(236, 72, 153, 0.08);
    --icon-bg: rgba(236, 72, 153, 0.05);
    --accent-gradient: linear-gradient(135deg, #ec4899, #f472b6);
}
.card-accent-slate {
    --accent-color: #64748b;
    --shadow-color: rgba(100, 116, 139, 0.12);
    --badge-bg: rgba(100, 116, 139, 0.08);
    --icon-bg: rgba(100, 116, 139, 0.05);
    --accent-gradient: linear-gradient(135deg, #64748b, #94a3b8);
}
.card-accent-teal {
    --accent-color: #0d9488;
    --shadow-color: rgba(13, 148, 136, 0.12);
    --badge-bg: rgba(13, 148, 136, 0.08);
    --icon-bg: rgba(13, 148, 136, 0.05);
    --accent-gradient: linear-gradient(135deg, #0d9488, #14b8a6);
}
.card-accent-amber {
    --accent-color: #d97706;
    --shadow-color: rgba(217, 119, 6, 0.12);
    --badge-bg: rgba(217, 119, 6, 0.08);
    --icon-bg: rgba(217, 119, 6, 0.05);
    --accent-gradient: linear-gradient(135deg, #d97706, #f59e0b);
}

/* ── Global Service Card Container ─────────────────────────────── */
.service-card {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Accent top bar indicator */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient, linear-gradient(135deg, #1e40af, #3b82f6));
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

/* Soft background glow overlay on hover */
.service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.9), transparent 80%);
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-color, #3b82f6);
    box-shadow: 0 20px 45px -12px var(--shadow-color, rgba(59, 130, 246, 0.15)),
                0 0 0 1px var(--accent-color, rgba(59, 130, 246, 0.1)) inset;
    background: rgba(255, 255, 255, 0.97);
}

.service-card:hover::before {
    height: 6px;
}

/* ── Layout Overrides for Homepage (#services) ─────────────────── */
#services .service-card {
    display: grid;
    grid-template-areas:
        "icon badge"
        "icon title"
        "desc desc"
        "features features"
        "btn btn";
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto 1fr auto auto;
    column-gap: 14px;
    row-gap: 4px;
    height: 100%;
    padding: 24px;
}

#services .service-card .card-badge {
    grid-area: badge;
    justify-self: start;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-color, #3b82f6);
    margin: 0;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
}

#services .service-card .card-icon {
    grid-area: icon;
    font-size: 1.5rem;
    padding: 0;
    margin: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--icon-bg, rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(0, 0, 0, 0.02);
    color: var(--accent-color, #3b82f6);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1;
}

#services .service-card h3 {
    grid-area: title;
    font-size: 1.12rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
}

#services .service-card p {
    grid-area: desc;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.5;
    margin-top: 12px;
    margin-bottom: 12px;
    height: auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

#services .service-card .card-features {
    grid-area: features;
    height: auto;
    margin: 12px 0 16px 0;
    border-top: 1px solid rgba(241, 245, 249, 0.8);
    padding-top: 12px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#services .service-card .card-features li {
    font-size: 0.82rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.25;
    padding-left: 0;
    transition: transform 0.2s ease;
}

#services .service-card .card-features li::before {
    content: "✓";
    position: static;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--accent-color, #10b981);
    transform: none;
    opacity: 1;
    transition: transform 0.3s ease;
}

#services .service-card .btn-card-cta {
    grid-area: btn;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-color, #3b82f6);
    background: none;
    border: none;
    border-radius: 0;
    width: fit-content;
    box-shadow: none;
    letter-spacing: 0;
    height: 24px;
}

#services .service-card .btn-card-cta::before {
    display: none;
}

/* ── Layout Overrides for Services Page (#ict-services) ─────────── */
#ict-services .service-card {
    height: 100%;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#ict-services .service-card > div:first-child {
    display: grid;
    grid-template-areas:
        "icon meta"
        "icon title"
        "desc desc";
    grid-template-columns: 52px 1fr;
    column-gap: 14px;
    row-gap: 4px;
    margin-bottom: 0;
}

#ict-services .service-top-meta {
    grid-area: meta;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

#ict-services .service-category-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-color, #3b82f6);
    margin-bottom: 0;
    padding: 0;
    background: none;
    border-radius: 0;
}

#ict-services .service-number {
    font-size: 1.25rem;
    font-weight: 900;
    color: rgba(148, 163, 184, 0.15);
    letter-spacing: -0.5px;
    transition: color 0.3s ease;
}

#ict-services .service-icon-box {
    grid-area: icon;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--icon-bg, rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    color: var(--accent-color, #3b82f6);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#ict-services .service-icon-box svg {
    width: 26px;
    height: 26px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#ict-services .service-title {
    grid-area: title;
    font-size: 1.12rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0;
    line-height: 1.25;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
}

#ict-services .service-description {
    grid-area: desc;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.5;
    margin-top: 12px;
    margin-bottom: 12px;
    height: auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

#ict-services .service-card > div:last-child {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    margin-top: 12px;
}

#ict-services .service-features-list {
    height: auto;
    margin: 0 0 16px 0;
    border-top: 1px solid rgba(241, 245, 249, 0.8);
    padding-top: 12px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#ict-services .service-features-list li {
    font-size: 0.82rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.25;
    margin-bottom: 0;
    transition: transform 0.2s ease;
}

#ict-services .service-features-list li svg {
    width: 14px;
    height: 14px;
    color: var(--accent-color, #10b981);
    margin-right: 0;
    margin-top: 0;
    display: inline-block !important;
    transition: transform 0.3s ease;
}

#ict-services .service-card-action {
    margin-top: auto;
}

#ict-services .service-btn {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-color, #3b82f6);
    background: none;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

#ict-services .service-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* ── Dynamic Hover Animations & Motion Effects ────────────────── */

/* Icon container animation on card hover */
.service-card:hover .service-icon-box,
.service-card:hover .card-icon {
    background: var(--accent-gradient, linear-gradient(135deg, #1e40af, #3b82f6)) !important;
    color: #ffffff !important;
    transform: scale(1.05) rotate(-3deg);
    box-shadow: 0 8px 16px -4px var(--shadow-color, rgba(59, 130, 246, 0.3));
}

.service-card:hover .service-icon-box svg {
    stroke: #ffffff;
    transform: scale(1.05);
}

/* Shift list items on card hover */
.service-card:hover .service-features-list li,
.service-card:hover .card-features li {
    transform: translateX(4px);
}

.service-card:hover .service-features-list li svg,
.service-card:hover .card-features li::before {
    transform: scale(1.2);
}

/* Title highlighting */
.service-card:hover h3,
.service-card:hover .service-title {
    color: var(--accent-color, #3b82f6);
}

/* Arrow micro-interaction on CTA button hover */
.service-card:hover .service-btn,
.service-card:hover .btn-card-cta {
    gap: 10px;
}

.service-card:hover .service-btn svg,
.service-card:hover .btn-card-cta svg {
    transform: translateX(4px);
}

/* ── Responsive Rules ─────────────────────────────────────────── */
@media (max-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    #services .service-card,
    #ict-services .service-card {
        height: auto !important;
    }
    #services .service-card p,
    #ict-services .service-card p,
    #services .service-card .card-features,
    #ict-services .service-features-list {
        height: auto !important;
        -webkit-line-clamp: unset !important;
    }
}

/* ── Interactive Details Modal Overlay Styling ── */
.service-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.service-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.service-modal-content {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 650px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.service-modal.active .service-modal-content {
    transform: translateY(0) scale(1);
}

.service-modal-header {
    padding: 30px;
    color: #ffffff;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.service-modal-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.service-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.service-modal-close svg {
    width: 18px;
    height: 18px;
}

.service-modal-body {
    padding: 35px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 25px;
}

.tech-pill {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.modal-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    margin-bottom: 12px;
}

.deliverables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.deliverable-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #334155;
}

.deliverable-item svg {
    width: 16px;
    height: 16px;
    color: #10b981;
    flex-shrink: 0;
}

.modal-footer-action {
    display: flex;
    gap: 15px;
    margin-top: 35px;
    border-top: 1px solid #f1f5f9;
    padding-top: 25px;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-btn.primary {
    background: var(--btn-bg, #3b82f6);
    color: #ffffff;
    border: none;
    flex-grow: 1;
}

.modal-btn.primary:hover {
    filter: brightness(1.15);
    box-shadow: 0 10px 20px -10px var(--btn-bg, #3b82f6);
}

.modal-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.modal-btn.secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .deliverables-grid {
        grid-template-columns: 1fr;
    }
}
