/* ========================================
   Cordyceps Trial Page Styles
   ======================================== */

.trial-page {
    background: radial-gradient(circle at 10% 12%, rgba(15, 118, 110, 0.08), transparent 26%),
    radial-gradient(circle at 88% 10%, rgba(245, 158, 11, 0.08), transparent 22%),
    linear-gradient(180deg, #f6fbf8 0%, #f9fafb 42%, #f5f8f7 100%);
    min-height: 100vh;
}

.trial-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.trial-hero {
    padding: 56px 0 88px;
}

.trial-hero-copy {
    text-align: center;
    margin-bottom: 32px;
}

.trial-title {
    margin-top: 0;
    color: #0f172a;
    font-size: clamp(40px, 7vw, 64px);
    line-height: 1.06;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #0f172a 10%, #0f766e 62%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trial-subtitle {
    max-width: 760px;
    margin: 18px auto 0;
    color: #475569;
    font-size: 18px;
    line-height: 1.85;
}

.trial-upload-card,
.trial-results {
    padding: 32px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 28px 48px -38px rgba(15, 23, 42, 0.42);
}

.trial-results {
    margin-top: 24px;
}

.trial-card-head h2 {
    margin-top: 0;
    color: #0f172a;
    font-size: 30px;
    line-height: 1.25;
}

.trial-card-head p {
    margin-top: 10px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.8;
}

.trial-form {
    margin-top: 24px;
}

.trial-file-label {
    color: #0f766e;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.trial-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.trial-upload-composer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 22px;
    background: linear-gradient(180deg, #fbfffe 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.trial-upload-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 8px 14px;
    border-radius: 16px;
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.12);
}

.trial-file-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(15, 118, 110, 0.16);
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.trial-file-trigger:hover {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 118, 110, 0.3);
    transform: translateY(-1px);
}

.trial-submit,
.trial-camera-link {
    border: none;
    border-radius: 14px;
    padding: 0 24px;
    height: 52px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trial-submit {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #ffffff;
    box-shadow: 0 20px 34px -22px rgba(15, 118, 110, 0.82);
}

.trial-camera-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid rgba(217, 119, 6, 0.24);
    color: #92400e;
    text-decoration: none;
    box-shadow: 0 18px 30px -24px rgba(146, 64, 14, 0.7);
}

.trial-submit:hover,
.trial-camera-link:hover {
    transform: translateY(-1px);
}

.trial-submit:hover {
    box-shadow: 0 24px 38px -22px rgba(15, 118, 110, 0.85);
}

.trial-camera-link:hover {
    box-shadow: 0 22px 34px -24px rgba(146, 64, 14, 0.74);
}

.trial-file-hint {
    flex: 1;
    color: #64748b;
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trial-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr);
    gap: 18px;
    margin-top: 24px;
}

.trial-meta-card {
    padding: 20px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.04);
}

.trial-meta-card h3 {
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.trial-meta-card pre {
    margin-top: 12px;
    white-space: pre-wrap;
    color: #475569;
    font-size: 12px;
    line-height: 1.7;
    font-family: 'SF Mono', Monaco, monospace;
}

.trial-sample-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.trial-sample-links a {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.12);
    color: #0f766e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.trial-sample-links a:hover {
    background: rgba(15, 118, 110, 0.12);
}

.trial-form-tip {
    margin-top: 14px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
}

.trial-result-list {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.trial-result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.618fr);
    gap: 18px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, #fbfffe 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.trial-result-image {
    overflow: hidden;
    border-radius: 18px;
    background: #e2e8f0;
}

.trial-result-image img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: contain;
    background: #f8fafc;
    display: block;
    cursor: zoom-in;
}

.trial-preview-trigger {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.trial-preview-trigger:hover {
    transform: scale(1.01);
    opacity: 0.96;
}

.trial-result-content {
    min-width: 0;
}

.trial-image-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
}

.trial-image-modal.is-open {
    display: flex;
}

.trial-image-modal-dialog {
    position: relative;
    max-width: min(92vw, 1200px);
    max-height: 88vh;
    padding: 14px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 32px 64px -24px rgba(15, 23, 42, 0.5);
}

.trial-image-modal-dialog img {
    display: block;
    max-width: 100%;
    max-height: calc(88vh - 28px);
    width: auto;
    height: auto;
    border-radius: 16px;
    background: #f8fafc;
}

.trial-image-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 1;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 24px -14px rgba(15, 23, 42, 0.5);
}

body.trial-modal-open {
    overflow: hidden;
}

.trial-result-file {
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
}

.trial-result-label {
    margin-top: 14px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(15, 118, 110, 0.04);
    color: #475569;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.trial-empty {
    margin-top: 24px;
    padding: 40px 24px;
    border-radius: 24px;
    text-align: center;
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.9) 0%, rgba(255, 251, 235, 0.76) 100%);
    border: 1px dashed rgba(15, 118, 110, 0.22);
}

.trial-empty h3 {
    color: #0f172a;
    font-size: 24px;
}

.trial-empty p {
    max-width: 460px;
    margin: 12px auto 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.8;
}

@media (max-width: 900px) {
    .trial-meta-grid,
    .trial-result-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .trial-hero {
        padding: 48px 0 64px;
    }

    .trial-title {
        font-size: 38px;
    }

    .trial-subtitle {
        font-size: 16px;
    }

    .trial-upload-card,
    .trial-results,
    .trial-result-card {
        padding: 22px;
    }

    .trial-upload-composer {
        flex-wrap: wrap;
    }

    .trial-file-hint {
        flex-basis: 100%;
    }
}

@media (max-width: 560px) {
    .trial-shell {
        padding: 0 16px;
    }

    .trial-title {
        font-size: 32px;
    }

    .trial-card-head h2,
    .trial-empty h3 {
        font-size: 24px;
    }

    .trial-upload-composer {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .trial-upload-pill {
        justify-content: space-between;
        width: 100%;
    }

    .trial-file-hint {
        flex-basis: 100%;
        white-space: normal;
    }

    .trial-submit,
    .trial-camera-link {
        width: 100%;
    }
}
