/* Services Section */
.services {
    padding: 10px 0 40px 0; /* much smaller top padding */
    background-color: transparent;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--primary-red);
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.service-card {
    background-color: var(--bauhaus-white);
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-speed) ease, 
                box-shadow var(--transition-speed) ease;
    display: flex;                /* Added for button alignment */
    flex-direction: column;       /* Make children stack vertically */
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background-color: var(--primary-blue);
}

.service-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
}

.service-description {
    margin-bottom: 20px;
    color: #555;
}

/* Service card button positioning */
.service-card .btn {
    margin-top: auto;
}

/* About Section */
.about {
    padding: 40px 0 10px 0; /* reduced top padding */
    background-color: var(--bauhaus-white);
}

.about-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.about-text {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.about-text p {
    margin-bottom: 20px;
    line-height: 1.7;
    max-width: 800px;
    width: 100%;
}

.about-image {
    flex: 1;
    margin-top: 30px;
    position: relative;
    width: 100%;
}

.about-image:empty {
    display: none;   /* Hide placeholder div when no image present */
}

.about-box {
    width: 100%;
    height: 300px;
    background-color: var(--gray-medium);
    position: relative;
    overflow: hidden;
}

.about-box-shape {
    position: absolute;
}

.about-box-shape-1 {
    width: 80px;
    height: 80px;
    background-color: var(--primary-red);
    top: 20px;
    left: 20px;
}

.about-box-shape-2 {
    width: 60px;
    height: 60px;
    background-color: var(--primary-blue);
    bottom: 20px;
    right: 20px;
    border-radius: 50%;
}

.about-box-shape-3 {
    width: 40px;
    height: 40px;
    background-color: var(--primary-yellow);
    bottom: 50px;
    left: 50%;
    transform: rotate(45deg);
}

/* Animation hooks styled consistently */
.services .highlight-row,
.about .highlight-row {
    display: flex;
    height: 10px; /* Reduced height */
    margin: 0; /* Remove extra margin */
    position: relative;
}

.about .highlight-row {
    height: 10px; /* Reduced height */
    margin: 0; /* Remove extra margin */
}

/* Responsive Styles */
@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-content {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 30px;
    }
    
    .about-image {
        margin-top: 0;
        min-width: 300px;
    }
    
    .about-text {
        width: 100%;
        max-width: none;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .about-text {
        padding-right: 20px;
    }
}

/* Mobile: horizontal scroll with snap for Services */
@media (max-width: 767px) {
    .services-grid {
        grid-template-columns: none; /* disable fixed columns */
        grid-auto-flow: column;
        grid-auto-columns: 100%; /* one card per viewport width inside container */
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        gap: 20px; /* slightly tighter on mobile */
        padding-bottom: 10px; /* space for hidden scrollbar area */
    }

    .service-card {
        scroll-snap-align: start;
    }

    /* Hide scrollbars (Firefox + WebKit) */
    .services-grid { scrollbar-width: none; }
    .services-grid::-webkit-scrollbar { display: none; }
}

/* Animation for service cards on hover */
@media (prefers-reduced-motion: no-preference) {
    .service-card {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .service-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }
    
    .about-box-shape {
        transition: transform 0.5s ease;
    }
    
    .about-box:hover .about-box-shape-1 {
        transform: translateX(10px) translateY(10px);
    }
    
    .about-box:hover .about-box-shape-2 {
        transform: translateX(-10px) translateY(-10px);
    }
    
    .about-box:hover .about-box-shape-3 {
        transform: rotate(90deg);
    }
}


/* Accessibility focus states */
.service-card:focus-within {
    outline: 2px solid var(--primary-blue);
    outline-offset: 4px;
}

.service-card .btn:focus,
.about-text .btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 0, 255, 0.2);
}

/* Make sure focus states are visible in dark mode too */
body.dark-mode .service-card:focus-within {
    outline-color: var(--primary-yellow);
}

body.dark-mode .service-card .btn:focus,
body.dark-mode .about-text .btn:focus {
    outline-color: var(--primary-yellow);
    box-shadow: 0 0 0 4px rgba(255, 255, 0, 0.2);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: #ffffff;
    color: #333333;
    border-radius: 8px;
    max-width: 600px;  /* Increased from 480px */
    width: 95%;        /* Slightly increased from 90% */
    margin: auto;
    padding: 32px 28px 28px 28px;  /* Slightly increased horizontal padding */
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    position: relative;
    font-family: 'Roboto Mono', monospace;
    animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from { 
        transform: scale(0.95);
        opacity: 0; 
    }
    to { 
        transform: scale(1);
        opacity: 1; 
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--primary-red);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.modal-close:hover {
    color: var(--primary-blue);
}

.modal-content h2 {
    margin-top: 0;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #333333;
}

.modal-content h3 {
    margin-bottom: 8px;
    margin-top: 20px;
    font-size: 1.1rem;
    color: var(--primary-blue);
}

.modal-content h3:last-of-type {
    margin-top: 24px;
    text-align: center;
    font-size: 1.2rem;
}

.modal-content ul {
    margin: 0 0 12px 18px;
    padding: 0;
    list-style: disc inside;
}

.modal-content p,
.modal-content ul,
.modal-content li {
    font-size: 1rem;
    color: #555;
    font-family: 'Roboto Mono', monospace;
}

@media (max-width: 600px) {
    .modal-content {
        padding: 18px 8px 12px 8px;
        max-width: 98vw;
    }
}

body.dark-mode .modal-content {
    background: #232323;
    color: #f5f5f5;
}

body.dark-mode .modal-content h2 {
    color: #f5f5f5;
}

body.dark-mode .modal-content p,
body.dark-mode .modal-content ul,
body.dark-mode .modal-content li {
    color: #ccc;
}

body.dark-mode .modal-close {
    color: #e57373;
}

body.dark-mode .modal-close:hover {
    color: #3498db;
}
