/* ========================================
   AERTH AUTO - HOW WE WORK CSS
   Single card system for desktop + mobile
======================================== */

/* ===== DESKTOP (1024px and above) ===== */
@media (min-width: 1024px) {
    .aerthwork-section {
        display: block;
        padding: 6rem 2rem;
        background: transparent;
        min-height: 100vh;
        overflow: visible;
    }

    .aerthwork-header {
        text-align: center;
        margin-bottom: 4rem;
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
    }

    .aerthwork-title {
        font-size: clamp(2.5rem, 4vw, 3.5rem);
        font-weight: 700;
        color: var(--eco-green);
        margin: 0 0 1.5rem 0;
        letter-spacing: -0.5px;
        line-height: 1.2;
        text-align: center;
        position: relative;
    }

    .aerthwork-title::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 100px;
        height: 4px;
        background: linear-gradient(90deg, var(--eco-green) 0%, var(--eco-accent) 100%);
        border-radius: 2px;
    }

    .aerthwork-subtitle {
        font-size: 1.3rem;
        color: var(--text-light);
        font-weight: 400;
        line-height: 1.6;
        max-width: 700px;
        margin: 0 auto;
        text-align: center;
    }

    .aerthwork-grid-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 2rem;
    }

    .aerthwork-cards-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
        align-items: start;
        justify-items: center;
        max-width: 100%;
        width: 100%;
    }

    .aerthwork-card {
        width: 100%;
        max-width: 100%;
        position: relative;
        background: transparent;
        border-radius: 20px;
        padding: 0;
        text-align: center;
        border: none;
        transition: none;
        overflow: visible;
        min-height: 320px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        perspective: 1200px;
    }

    .aerthwork-card-inner {
        position: relative;
        width: 100%;
        height: 100%;
        min-height: 320px;
        text-align: center;
        transition: transform 0.8s ease;
        transform-style: preserve-3d;
        cursor: pointer;
    }

    /* Hover flip on desktop */
    .aerthwork-card:hover .aerthwork-card-inner {
        transform: rotateY(180deg);
    }

    .aerthwork-card-front,
    .aerthwork-card-back {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        min-height: 320px;
        backface-visibility: hidden;
        border-radius: 20px;
        padding: 2.5rem 2rem;
        text-align: center;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        border-left: 4px solid var(--aerth-green);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: white;
        overflow: hidden;
    }

    .aerthwork-card-front::before,
    .aerthwork-card-back::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--aerth-green), var(--aerth-accent));
    }

    .aerthwork-card-back {
        transform: rotateY(180deg);
        justify-content: flex-start;
        align-items: flex-start;
        text-align: left;
        padding: 2rem 2rem;
    }

    .aerthwork-flip-icon {
        position: absolute;
        top: 15px;
        right: 15px;
        font-size: 1.2rem;
        opacity: 0.6;
        transition: all 0.3s ease;
        z-index: 15;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .aerthwork-card:hover .aerthwork-flip-icon {
        opacity: 1;
        transform: scale(1.1);
    }

    .aerthwork-card-front .aerthwork-card-icon {
        font-size: 3.5rem;
        margin-bottom: 1.5rem;
        width: 90px;
        height: 90px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--aerth-light);
        border-radius: 50%;
        border: 3px solid var(--aerth-green);
        margin-left: auto;
        margin-right: auto;
        flex-shrink: 0;
        transition: all 0.3s ease;
    }

    .aerthwork-card-front .aerthwork-card-title {
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 1rem;
        line-height: 1.2;
        flex-shrink: 0;
        text-align: center;
    }

    .aerthwork-card-front .aerthwork-card-description {
        font-size: 1rem;
        line-height: 1.4;
        color: var(--text-light);
        text-align: center;
        flex-grow: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 0.5rem;
    }

    .aerthwork-card-back .aerthwork-card-icon {
        display: none;
    }

    .aerthwork-card-back .aerthwork-card-title {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 1.5rem;
        margin-top: 0.5rem;
        line-height: 1.2;
        flex-shrink: 0;
        text-align: center;
        align-self: center;
    }

    .aerthwork-card-details {
        flex-grow: 1;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        margin-top: 0.5rem;
        padding: 0;
        max-height: none;
        overflow: visible;
    }

    .detail-item {
        display: flex;
        align-items: flex-start;
        gap: 0.7rem;
        padding: 0.7rem 0.8rem;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
        border-left: 3px solid var(--aerth-green);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
        min-height: auto;
        flex-shrink: 0;
    }

    .detail-item:hover {
        transform: translateX(3px);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    }

    .detail-icon {
        font-size: 1rem;
        width: 26px;
        height: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--aerth-light);
        border-radius: 50%;
        border: 2px solid var(--aerth-green);
        flex-shrink: 0;
        margin-top: 2px;
    }

    .detail-text {
        font-size: 0.85rem;
        line-height: 1.3;
        color: var(--text-dark);
        font-weight: 500;
        text-align: left;
        flex: 1;
        margin: 0;
        padding: 0;
        word-wrap: break-word;
    }

    /* Color variations per card */
    .aerthwork-card:nth-child(1) .detail-item { border-left-color: var(--aerth-green); }
    .aerthwork-card:nth-child(1) .detail-icon { border-color: var(--aerth-green); background: rgba(5, 111, 55, 0.1); }

    .aerthwork-card:nth-child(2) .detail-item { border-left-color: var(--aerth-accent); }
    .aerthwork-card:nth-child(2) .detail-icon { border-color: var(--aerth-accent); background: rgba(45, 143, 95, 0.1); }

    .aerthwork-card:nth-child(3) .detail-item { border-left-color: var(--aerth-blue); }
    .aerthwork-card:nth-child(3) .detail-icon { border-color: var(--aerth-blue); background: rgba(75, 161, 248, 0.1); }

    .aerthwork-card:nth-child(4) .detail-item { border-left-color: var(--aerth-dark-green); }
    .aerthwork-card:nth-child(4) .detail-icon { border-color: var(--aerth-dark-green); background: rgba(3, 74, 36, 0.1); }

    .aerthwork-card:nth-child(5) .detail-item { border-left-color: #8b5cf6; }
    .aerthwork-card:nth-child(5) .detail-icon { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }

    .aerthwork-card:nth-child(6) .detail-item { border-left-color: #f59e0b; }
    .aerthwork-card:nth-child(6) .detail-icon { border-color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
}

/* ===== MOBILE / TABLET (max-width: 1023px) ===== */
@media (max-width: 1023px) {
    .aerthwork-section {
        display: block;
        padding: 3rem 1rem;
        background: transparent;
        min-height: 100vh;
    }

    .aerthwork-header {
        text-align: center;
        margin-bottom: 3rem;
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
    }

    .aerthwork-title {
        font-size: clamp(2rem, 5vw, 2.5rem);
        font-weight: 700;
        color: var(--eco-green);
        margin: 0 0 2rem 0;
        letter-spacing: -0.5px;
        line-height: 1.2;
        text-align: center;
        position: relative;
    }

    .aerthwork-title::after {
        content: '';
        position: absolute;
        bottom: -15px;
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
        height: 4px;
        background: linear-gradient(90deg, var(--eco-green) 0%, var(--eco-accent) 100%);
        border-radius: 2px;
    }

    .aerthwork-subtitle {
        font-size: 1.05rem;
        color: var(--text-light);
        line-height: 1.6;
        font-weight: 400;
        text-align: justify;
        background: rgba(255, 255, 255, 0.9);
        padding: 1.25rem 1.5rem;
        border-radius: 15px;
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .aerthwork-grid-container {
        max-width: 700px;
        margin: 0 auto;
        padding: 0 0.5rem;
    }

    .aerthwork-cards-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        justify-items: stretch;
    }

    .aerthwork-card {
        background: transparent;
        border-radius: 15px;
        padding: 0;
        text-align: center;
        border: none;
        position: relative;
        overflow: visible;
        min-height: 260px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        perspective: 1000px;
        width: 100%;
    }

    .aerthwork-card-inner {
        position: relative;
        width: 100%;
        height: 100%;
        min-height: 260px;
        text-align: center;
        transition: transform 0.8s ease;
        transform-style: preserve-3d;
        cursor: pointer;
    }

    /* Disable hover flip on mobile; use .is-flipped class instead */
    .aerthwork-card:hover .aerthwork-card-inner {
        transform: none;
    }
    .aerthwork-card.is-flipped .aerthwork-card-inner {
        transform: rotateY(180deg);
    }

    .aerthwork-card-front,
    .aerthwork-card-back {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        min-height: 260px;
        backface-visibility: hidden;
        border-radius: 15px;
        padding: 2rem 1.5rem;
        text-align: center;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        border-left: 4px solid var(--aerth-green);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: white;
        overflow: hidden;
    }

    .aerthwork-card-back {
        transform: rotateY(180deg);
        justify-content: flex-start;
        align-items: center;
        text-align: center;
        padding: 1.5rem 1.3rem;
    }

    .aerthwork-flip-icon {
        position: absolute;
        top: 12px;
        right: 12px;
        font-size: 1.1rem;
        z-index: 15;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }

    .aerthwork-card-front .aerthwork-card-icon {
        font-size: 3rem;
        margin-bottom: 1.2rem;
        width: 75px;
        height: 75px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--aerth-light);
        border-radius: 50%;
        border: 3px solid var(--aerth-green);
        margin-left: auto;
        margin-right: auto;
        flex-shrink: 0;
    }

    .aerthwork-card-front .aerthwork-card-title {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 0.8rem;
        line-height: 1.2;
        flex-shrink: 0;
    }

    .aerthwork-card-front .aerthwork-card-description {
        font-size: 0.95rem;
        line-height: 1.4;
        color: var(--text-light);
        text-align: center;
        flex-grow: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 0.5rem;
    }

    .aerthwork-card-back .aerthwork-card-icon {
        display: none;
    }

    .aerthwork-card-back .aerthwork-card-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 1.2rem;
        margin-top: 0.5rem;
        line-height: 1.2;
        text-align: center;
        align-self: center;
    }

    .aerthwork-card-details {
        flex-grow: 1;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.7rem;
        margin-top: 0;
        padding: 0;
        max-height: none;
        overflow: visible;
    }

    .detail-item {
        display: flex;
        align-items: flex-start;
        gap: 0.6rem;
        padding: 0.6rem 0.7rem;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
        border-left: 3px solid var(--aerth-green);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
        flex-shrink: 0;
    }

    .detail-icon {
        font-size: 0.9rem;
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--aerth-light);
        border-radius: 50%;
        border: 2px solid var(--aerth-green);
        flex-shrink: 0;
        margin-top: 1px;
    }

    .detail-text {
        font-size: 0.8rem;
        line-height: 1.3;
        color: var(--text-dark);
        font-weight: 500;
        text-align: left;
        flex: 1;
        margin: 0;
        padding: 0;
    }

    /* Card color coding reused on mobile */
    .aerthwork-card:nth-child(1) .detail-item,
    .aerthwork-card:nth-child(1) .aerthwork-card-front,
    .aerthwork-card:nth-child(1) .aerthwork-card-back {
        border-left-color: var(--aerth-green);
    }

    .aerthwork-card:nth-child(2) .detail-item,
    .aerthwork-card:nth-child(2) .aerthwork-card-front,
    .aerthwork-card:nth-child(2) .aerthwork-card-back {
        border-left-color: var(--aerth-accent);
    }

    .aerthwork-card:nth-child(3) .detail-item,
    .aerthwork-card:nth-child(3) .aerthwork-card-front,
    .aerthwork-card:nth-child(3) .aerthwork-card-back {
        border-left-color: var(--aerth-blue);
    }

    .aerthwork-card:nth-child(4) .detail-item,
    .aerthwork-card:nth-child(4) .aerthwork-card-front,
    .aerthwork-card:nth-child(4) .aerthwork-card-back {
        border-left-color: var(--aerth-dark-green);
    }

    .aerthwork-card:nth-child(5) .detail-item,
    .aerthwork-card:nth-child(5) .aerthwork-card-front,
    .aerthwork-card:nth-child(5) .aerthwork-card-back {
        border-left-color: #8b5cf6;
    }

    .aerthwork-card:nth-child(6) .detail-item,
    .aerthwork-card:nth-child(6) .aerthwork-card-front,
    .aerthwork-card:nth-child(6) .aerthwork-card-back {
        border-left-color: #f59e0b;
    }

    /* Tablet: 2 columns */
    @media (min-width: 768px) and (max-width: 1023px) {
        .aerthwork-section { padding: 4rem 2rem; }
        .aerthwork-cards-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 2rem;
        }
        .aerthwork-card-inner {
            min-height: 300px;
        }
    }

    /* Small phones tweaks */
    @media (max-width: 480px) {
        .aerthwork-section { padding: 2rem 1rem; }
        .aerthwork-subtitle { font-size: 0.95rem; }
        .aerthwork-card-front,
        .aerthwork-card-back {
            padding: 1.5rem 1.2rem;
        }
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .detail-item {
        border-width: 3px;
    }
}
