﻿/* File: Content/css/CropPortfolio.css */
/* COMPLETELY REVISED - Fixed hover vanishing issue */

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== MAIN CONTAINER ========== */
.crop-portfolio-section {
    padding: 60px 20px;
    background: linear-gradient(135deg, #f8fff9 0%, #f0f9f1 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ========== HEADER ========== */
.portfolio-header {
    text-align: center;
    margin-bottom: 60px;
    padding: 0 20px;
}

.portfolio-title {
    font-size: 2.8rem;
    color: #1a4721;
    margin-bottom: 15px;
    font-weight: 800;
    position: relative;
    display: inline-block;
}

    .portfolio-title::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 120px;
        height: 4px;
        background: linear-gradient(90deg, #27ae60, #4caf50);
        border-radius: 2px;
    }

.portfolio-subtitle {
    font-size: 1.2rem;
    color: #2e7d32;
    max-width: 700px;
    margin: 25px auto 0;
    line-height: 1.6;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

/* ========== CARDS CONTAINER ========== */
.cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 10px;
}

/* ========== CARD BASE STYLES ========== */
.card-item {
    perspective: 1000px;
    height: 100%;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 15px;
    overflow: visible; /* CHANGED: No overflow hidden */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

/* FIXED: Hover stays stable */
.card-item:hover .card-inner {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* ========== CARD HEADER ========== */
.card-front {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 25px 20px 20px;
    text-align: center;
    border-radius: 15px 15px 0 0;
    position: relative;
}

    .card-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 5px;
        border-radius: 15px 15px 0 0;
    }

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.card-item:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

/* ========== CARD CONTENT ========== */
.card-content {
    padding: 25px 20px;
    flex: 1;
}

.crop-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.crop-name {
    padding: 12px 0;
    font-size: 1.1rem;
    font-weight: 500;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 35px;
    transition: all 0.3s ease;
}

    .crop-name:last-child {
        border-bottom: none;
    }

    .crop-name::before {
        content: '✓';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 24px;
        height: 24px;
        background: #f0f9f0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
        font-weight: bold;
        transition: all 0.3s ease;
    }

    .crop-name:hover {
        padding-left: 40px;
        color: #1a4721;
    }

        .crop-name:hover::before {
            transform: translateY(-50%) scale(1.1);
            background: #27ae60;
            color: white;
        }

/* ========== CARD FOOTER ========== */
.card-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: #f9fdf9;
    border-radius: 0 0 15px 15px;
    position: relative;
    z-index: 10; /* Ensure footer stays on top */
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    min-width: 180px;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.2);
    position: relative;
    overflow: visible; /* CHANGED: Allow button overflow */
}

    .action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
        color: white;
        text-decoration: none;
    }

    .action-btn:active {
        transform: translateY(0);
    }

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.action-btn:hover .btn-icon {
    transform: translateX(5px);
}

/* ========== INDIVIDUAL CARD COLORS ========== */

/* PULSES - Green */
.pulses .card-header {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

    .pulses .card-header::before {
        background: linear-gradient(90deg, #27ae60, #2ecc71);
    }

.pulses .card-inner {
    border-color: rgba(39, 174, 96, 0.2);
}

.pulses .crop-name::before {
    color: #27ae60;
}

.pulses .crop-name:hover::before {
    background: #27ae60;
}

.pulses .action-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

    .pulses .action-btn:hover {
        background: linear-gradient(135deg, #219653, #27ae60);
    }

/* CEREALS - Orange */
.cereals .card-header {
    background: linear-gradient(135deg, #e67e22, #f39c12);
}

    .cereals .card-header::before {
        background: linear-gradient(90deg, #e67e22, #f39c12);
    }

.cereals .card-inner {
    border-color: rgba(230, 126, 34, 0.2);
}

.cereals .crop-name::before {
    color: #e67e22;
}

.cereals .crop-name:hover::before {
    background: #e67e22;
}

.cereals .action-btn {
    background: linear-gradient(135deg, #e67e22, #f39c12);
}

    .cereals .action-btn:hover {
        background: linear-gradient(135deg, #d35400, #e67e22);
    }

/* FODDER - Teal */
.fodder .card-header {
    background: linear-gradient(135deg, #1abc9c, #16a085);
}

    .fodder .card-header::before {
        background: linear-gradient(90deg, #1abc9c, #16a085);
    }

.fodder .card-inner {
    border-color: rgba(26, 188, 156, 0.2);
}

.fodder .crop-name::before {
    color: #1abc9c;
}

.fodder .crop-name:hover::before {
    background: #1abc9c;
}

.fodder .action-btn {
    background: linear-gradient(135deg, #1abc9c, #16a085);
}

    .fodder .action-btn:hover {
        background: linear-gradient(135deg, #148f77, #117a65);
    }

/* OILSEEDS - Yellow */
.oilseeds .card-header {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

    .oilseeds .card-header::before {
        background: linear-gradient(90deg, #f1c40f, #f39c12);
    }

.oilseeds .card-inner {
    border-color: rgba(241, 196, 15, 0.2);
}

.oilseeds .crop-name::before {
    color: #f1c40f;
}

.oilseeds .crop-name:hover::before {
    background: #f1c40f;
}

.oilseeds .action-btn {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

    .oilseeds .action-btn:hover {
        background: linear-gradient(135deg, #d4ac0d, #b7950b);
    }

/* VEGETABLES - Blue */
.vegetables .card-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

    .vegetables .card-header::before {
        background: linear-gradient(90deg, #3498db, #2980b9);
    }

.vegetables .card-inner {
    border-color: rgba(52, 152, 219, 0.2);
}

.vegetables .crop-name::before {
    color: #3498db;
}

.vegetables .crop-name:hover::before {
    background: #3498db;
}

.vegetables .action-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

    .vegetables .action-btn:hover {
        background: linear-gradient(135deg, #21618c, #1a5276);
    }

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-item {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

    .card-item:nth-child(1) {
        animation-delay: 0.1s;
    }

    .card-item:nth-child(2) {
        animation-delay: 0.2s;
    }

    .card-item:nth-child(3) {
        animation-delay: 0.3s;
    }

    .card-item:nth-child(4) {
        animation-delay: 0.4s;
    }

    .card-item:nth-child(5) {
        animation-delay: 0.5s;
    }

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1200px) {
    .cards-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .crop-portfolio-section {
        padding: 40px 15px;
    }

    .portfolio-title {
        font-size: 2.4rem;
    }

    .portfolio-subtitle {
        font-size: 1.1rem;
        padding: 12px 20px;
    }

    .cards-wrapper {
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .cards-wrapper {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .portfolio-title {
        font-size: 2rem;
    }

        .portfolio-title::after {
            width: 100px;
        }

    .card-header {
        padding: 20px 15px 15px;
    }

    .card-icon {
        font-size: 3rem;
    }

    .card-title {
        font-size: 1.6rem;
    }

    .card-content {
        padding: 20px 15px;
    }

    .crop-name {
        font-size: 1rem;
        padding: 10px 0 10px 30px;
    }

        .crop-name:hover {
            padding-left: 35px;
        }

    .card-footer {
        padding: 15px;
    }

    .action-btn {
        padding: 12px 25px;
        font-size: 0.95rem;
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    .crop-portfolio-section {
        padding: 30px 10px;
    }

    .portfolio-header {
        margin-bottom: 40px;
    }

    .portfolio-title {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }

    .portfolio-subtitle {
        font-size: 1rem;
        padding: 10px 15px;
        margin-top: 15px;
    }

    .cards-wrapper {
        gap: 20px;
    }

    .card-inner {
        border-radius: 12px;
    }

    .card-header {
        padding: 18px 12px 12px;
    }

    .card-icon {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .card-content {
        padding: 18px 12px;
    }

    .crop-name {
        font-size: 0.95rem;
        padding: 8px 0 8px 28px;
    }

        .crop-name::before {
            width: 22px;
            height: 22px;
            font-size: 0.8rem;
        }

    .action-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-width: 140px;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    .crop-portfolio-section {
        background: white !important;
        padding: 20px !important;
    }

    .card-inner {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    .action-btn {
        display: none;
    }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
    .card-item,
    .card-inner,
    .action-btn,
    .card-icon,
    .crop-name {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus styles for keyboard navigation */
.action-btn:focus {
    outline: 3px solid #3498db;
    outline-offset: 3px;
}

.card-inner:focus-within {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}
