/* =========================================================
   CROP RECOMMENDATION – ORGANIC EARTH INTELLIGENCE
   ========================================================= */

.crop-page {
    max-width: 1100px;
    margin: auto;
    position: relative;
}

/* ---------------------------------
   PAGE HEADER
---------------------------------- */

.page-header {
    margin-bottom: 40px;
    position: relative;
}

.page-header h2 {
    font-family: var(--heading-font);
    font-size: 2.05rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

.page-header h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 70%;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--accent),
        transparent
    );
}

.page-header p {
    font-size: 1.05rem;
    opacity: 0.85;
    max-width: 720px;
    line-height: 1.6;
    color: var(--text-soft);
}

/* ---------------------------------
   ACTION BUTTON – SOIL CORE
---------------------------------- */

.action-area {
    margin: 45px 0;
    text-align: center;
}

#checkSoilBtn {
    position: relative;
    padding: 18px 46px;
    font-size: 1.15rem;
    font-family: var(--heading-font);
    letter-spacing: 1.6px;
    border-radius: 999px;

    background:
        radial-gradient(
            circle at top left,
            rgba(255,255,255,0.22),
            transparent 55%
        ),
        linear-gradient(
            135deg,
            var(--accent),
            #6f4e37
        );

    border: none;
    color: #1e120a;
    cursor: pointer;

    box-shadow:
        0 14px 35px rgba(199,139,90,0.5),
        inset 0 -4px 10px rgba(0,0,0,0.4);

    transition: transform 0.3s ease,
                box-shadow 0.3s ease,
                filter 0.3s ease;
}

#checkSoilBtn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow:
        0 24px 55px rgba(199,139,90,0.75),
        inset 0 -4px 12px rgba(0,0,0,0.5);
    filter: brightness(1.06);
}

#checkSoilBtn:active {
    transform: translateY(1px) scale(0.97);
}

#checkSoilBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------------------------------
   LOADER – SOIL ENERGY
---------------------------------- */

.loader {
    margin: 45px 0;
    text-align: center;
    position: relative;
}

.loader span {
    width: 50px;
    height: 50px;
    border-radius: 50%;

    border: 3px solid rgba(199,139,90,0.25);
    border-top: 3px solid var(--accent);

    display: inline-block;
    animation: spin 1.1s linear infinite;
    box-shadow: 0 0 22px rgba(199,139,90,0.45);
}

.loader::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 130px;
    height: 130px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(199,139,90,0.25),
        transparent 65%
    );
    animation: pulseGlow 2.2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.75; }
}

.loader p {
    margin-top: 14px;
    opacity: 0.85;
    letter-spacing: 0.4px;
}

/* ---------------------------------
   RESULTS SECTION
---------------------------------- */

.result-area {
    margin-top: 50px;
    animation: revealUp 0.7s ease forwards;
}

.result-area h3 {
    font-family: var(--heading-font);
    font-size: 1.45rem;
    margin-bottom: 22px;
    letter-spacing: 1px;
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------------------------------
   TABLE – FERTILE PANEL
---------------------------------- */

.crop-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 20px;
    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,0.05),
            rgba(0,0,0,0.25)
        ),
        var(--card-bg);

    border: 1px solid var(--card-border);

    box-shadow:
        0 22px 55px rgba(0,0,0,0.65);
}

.crop-table thead {
    background: linear-gradient(
        135deg,
        rgba(199,139,90,0.25),
        rgba(199,139,90,0.1)
    );
}

.crop-table th {
    padding: 16px 22px;
    font-family: var(--heading-font);
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.crop-table td {
    padding: 16px 22px;
    font-size: 0.95rem;
    color: var(--text-soft);
    border-top: 1px solid rgba(255,255,255,0.07);
}

.crop-table tbody tr {
    transition: background 0.35s ease,
                transform 0.25s ease;
}

.crop-table tbody tr:hover {
    background: rgba(199,139,90,0.18);
    transform: scale(1.01);
}

.crop-table td:last-child {
    font-weight: 600;
    color: var(--accent);
    text-shadow: 0 0 8px rgba(199,139,90,0.45);
}

/* ---------------------------------
   SOIL SUMMARY – SENSOR CARDS
---------------------------------- */

.soil-summary {
    margin-bottom: 40px;
    padding: 28px;
    border-radius: 24px 36px;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,0.05),
            rgba(0,0,0,0.3)
        ),
        var(--card-bg);

    border: 1px solid var(--card-border);

    box-shadow:
        0 22px 55px rgba(0,0,0,0.65),
        inset 0 0 22px rgba(199,139,90,0.18);
}

.soil-summary h3 {
    font-family: var(--heading-font);
    letter-spacing: 1px;
    margin-bottom: 22px;
}

.soil-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}

.soil-item {
    text-align: center;
    padding: 20px 16px;
    border-radius: 18px;

    background: rgba(0,0,0,0.3);

    box-shadow:
        inset 0 0 20px rgba(199,139,90,0.15),
        0 12px 30px rgba(0,0,0,0.45);

    transition: transform 0.3s ease,
                box-shadow 0.3s ease;
}

.soil-item:hover {
    transform: translateY(-5px);
    box-shadow:
        inset 0 0 26px rgba(199,139,90,0.25),
        0 18px 45px rgba(0,0,0,0.6);
}

.soil-item span {
    font-size: 1.45rem;
    display: block;
    margin-bottom: 6px;
}

.soil-item strong {
    font-size: 1.55rem;
    display: block;
}

.soil-item small {
    opacity: 0.75;
    font-size: 0.75rem;
}

/* ---------------------------------
   UTILITIES
---------------------------------- */

.hidden {
    display: none;
}
