/**
 * Home Page Styles
 * Custom styles for home page components including services section
 */

/* Services Section */
.service-card {
    position: relative;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 430px;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Image Container (40% height) */
.image-container {
    position: relative;
    height: 60%;
    overflow: hidden;
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-card:hover .service-image {
    transform: scale(1.1);
}

/* Content Container (60% height) */
.content-container {
    position: relative;
    height: 50%;
    padding: 24px 20px 20px;
    background: white;
    border-radius: 20px 20px 0 0;
    margin-top: -20px;
    z-index: 2;
}

/* Service Title */
.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
    text-align: center;
}

/* Features Grid (50/50 layout) */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    height: calc(100% - 60px);
}

.features-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #4b5563;
    padding: 4px 0;
}

.feature-item i {
    font-size: 0.875rem;
    width: 16px;
    flex-shrink: 0;
}

.feature-item span {
    font-weight: 500;
}

/* Hover Effects */
.service-card:hover .feature-item {
    color: #374151;
}

.service-card:hover .service-title {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .service-card {
        height: 360px;
        border-radius: 16px;
        margin-bottom: 24px;
    }

    .content-container {
        padding: 20px 16px 16px;
        border-radius: 16px 16px 0 0;
        margin-top: -16px;
    }

    .service-title {
        font-size: 1.25rem;
        margin-bottom: 14px;
        text-align: center;
    }

    .features-grid {
        gap: 10px;
        height: calc(100% - 55px);
    }

    .features-column {
        gap: 8px;
    }

    .feature-item {
        font-size: 0.875rem;
        gap: 8px;
        padding: 4px 0;
        line-height: 1.3;
        display: flex;
        align-items: flex-start;
    }

    .feature-item i {
        font-size: 0.875rem;
        width: 16px;
        margin-top: 1px;
        flex-shrink: 0;
    }

    .feature-item span {
        flex: 1;
        word-wrap: break-word;
    }
}

@media (max-width: 640px) {
    .service-card {
        height: 380px;
    }

    .content-container {
        padding: 20px 16px 16px;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        height: calc(100% - 50px);
    }

    .features-column {
        gap: 8px;
    }

    .feature-item {
        font-size: 0.8rem;
        padding: 4px 0;
        line-height: 1.3;
        display: flex;
        align-items: flex-start;
        gap: 6px;
    }

    .feature-item i {
        font-size: 0.75rem;
        width: 12px;
        margin-top: 2px;
        flex-shrink: 0;
    }

    .feature-item span {
        flex: 1;
        word-wrap: break-word;
        line-height: 1.3;
        font-size: 16px;
    }
}

/* Mobile specific improvements */
@media (max-width: 480px) {
    .service-card {
        height: 380px;
        margin-bottom: 20px;
    }

    .content-container {
        padding: 18px 14px 14px;
    }

    .service-title {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        height: calc(100% - 48px);
    }

    .feature-item {
        font-size: 0.75rem;
        padding: 3px 0;
        gap: 6px;
        line-height: 1.2;
        min-height: 20px;
        display: flex;
        align-items: flex-start;
    }

    .feature-item i {
        font-size: 0.7rem;
        width: 10px;
        margin-top: 1px;
        flex-shrink: 0;
    }

    .feature-item span {
        flex: 1;
        word-break: break-word;
        hyphens: auto;
        font-size: 16px;
        line-height: 1.2;
    }
}

/* Animation for cards appearing */
.service-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.service-card:nth-child(1) {
    animation-delay: 0.1s;
}

.service-card:nth-child(2) {
    animation-delay: 0.2s;
}

.service-card:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Header Styles */
.services-section h2 {
    position: relative;
}

.services-section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Loading Animation */
.service-card.loading {
    opacity: 0.7;
}

.service-card.loading .service-image {
    filter: blur(2px);
}

/* Accessibility */
.service-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.service-card:focus:not(:focus-visible) {
    outline: none;
}

/* Categories Section */
.category-card {
    position: relative;
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 120px;
    border: 1px solid #e2e8f0;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    background: #f1f5f9;
}

.category-content {
    display: flex;
    height: 100%;
    position: relative;
}

/* Content Area (70%) */
.content-area {
    width: 60%;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.3;
}

.category-description {
    font-size: 16px;
    color: #64748b;
    line-height: 1.5;
    font-weight: 400;
}

/* Image Area (30%) */
.image-area {
    width: 40%;
    position: relative;
    overflow: hidden;
}

.category-image {
    width: 120%;
    height: 120%;
    object-fit: cover;
    position: absolute;
    top: -10%;
    right: -20%;
    /* border-radius: 0 16px 0 50px; */
    transition: all 0.4s ease;
    z-index: 1;
    clip-path: ellipse(99% 145px at 100% 50%);
}

.category-card:hover .category-image {
    transform: scale(1.05);
    right: -15%;
}

/* Hover Effects */
.category-card:hover .category-title {
    color: var(--primary-color);
}

.category-card:hover .category-description {
    color: #475569;
}

/* Responsive Design for Categories */
@media (max-width: 768px) {
    .category-card {
        height: 120px;
        margin-bottom: 16px;
    }

    .content-area {
        padding: 20px 16px;
    }

    .category-title {
        font-size: 1.25rem;
        margin-bottom: 6px;
    }

    .category-description {
        font-size: 16px;
        line-height: 1.4;
    }

    .category-image {
        border-radius: 0 12px 0 40px;
    }
}

@media (max-width: 640px) {
    .category-card {
        height: 120px;
        border-radius: 12px;
    }

    .content-area {
        padding: 16px 14px;
    }

    .category-title {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .category-description {
        font-size: 16px;
        line-height: 1.3;
    }

    .category-image {
        border-radius: 0 12px 0 30px;
        width: 110%;
        height: 110%;
        top: -5%;
        right: -10%;
    }

    .category-card:hover .category-image {
        right: -8%;
    }
}

@media (max-width: 480px) {
    .category-card {
        height: 120px;
    }

    .content-area {
        padding: 14px 12px;
    }

    .category-title {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .category-description {
        font-size: 16px;
        line-height: 1.2;
    }

    .category-image {
        border-radius: 0 10px 0 25px;
    }
}

/* Category Animation */
.category-card {
    opacity: 0;
    transform: translateY(20px);
    animation: categoryFadeIn 0.6s ease forwards;
}

.category-card:nth-child(1) {
    animation-delay: 0.1s;
}

.category-card:nth-child(2) {
    animation-delay: 0.2s;
}

.category-card:nth-child(3) {
    animation-delay: 0.3s;
}

.category-card:nth-child(4) {
    animation-delay: 0.4s;
}

.category-card:nth-child(5) {
    animation-delay: 0.5s;
}

.category-card:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes categoryFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {

    .service-card,
    .category-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .service-card:hover,
    .category-card:hover {
        transform: none;
    }
}