/* ================================================================
   Prompt Yield MVP — Component Styles
   ================================================================ */

/* Score Gauge */
.py-gauge {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

.py-gauge svg {
    transform: rotate(-90deg);
}

.py-gauge-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 10;
}

.py-gauge-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease, stroke 0.5s ease;
}

.py-gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.py-gauge-score {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--color-text);
}

.py-gauge-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Task Type Pills */
.py-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0;
}

.py-pill {
    padding: 0.4rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #555;
}

.py-pill:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.py-pill.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* Prompt Input */
.py-textarea {
    width: 100%;
    min-height: 180px;
    padding: 1rem;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    background: white;
}

.py-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}

.py-textarea::placeholder {
    color: #aaa;
}

/* Analyze Button */
.py-btn-analyze {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    background: var(--color-secondary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.py-btn-analyze:hover {
    background: #d63451;
    transform: translateY(-1px);
}

.py-btn-analyze:active {
    transform: translateY(0);
}

.py-btn-analyze:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.py-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: py-spin 0.6s linear infinite;
}

@keyframes py-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results Panel */
.py-results {
    display: none;
    margin-top: 2.5rem;
    animation: py-fade-in 0.5s ease;
}

.py-results.visible {
    display: block;
}

@keyframes py-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* YIELD Framework Bars */
.py-framework {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.py-bar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.py-bar-letter {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-primary);
    min-width: 20px;
    text-align: center;
}

.py-bar-track {
    flex: 1;
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.py-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.py-bar-score {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    min-width: 32px;
    text-align: right;
}

/* Weakness Tags */
.py-weaknesses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.py-weakness-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: help;
}

.py-weakness-tag.red {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.py-weakness-tag.amber {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* User-specific placeholders in packed prompts */
.py-placeholder {
    background: #fef9c3;
    color: #92400e;
    border: 1.5px dashed #f59e0b;
    border-radius: 4px;
    padding: 0 4px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.py-placeholder:hover {
    background: #fde68a;
}

/* Packed Prompt Card */
.py-packed-card {
    background: #f8fafb;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.5rem;
    position: relative;
    margin: 1rem 0;
}

.py-packed-card pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0;
    color: #333;
}

.py-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.py-copy-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.py-copy-btn.copied {
    background: #059669;
    border-color: #059669;
    color: white;
}

/* Variant Tabs */
.py-variant-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1rem;
}

.py-variant-tab {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.py-variant-tab:hover {
    color: var(--color-primary);
}

.py-variant-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* How It Works Steps */
.py-steps {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    margin: 2.5rem 0;
}

.py-step {
    text-align: center;
}

.py-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.py-step h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.py-step p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Error message */
.py-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    color: #dc2626;
    font-size: 0.95rem;
    margin-top: 1rem;
    display: none;
}

.py-error.visible {
    display: block;
}

/* Results Section Headers */
.py-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .py-framework {
        grid-template-columns: 1fr;
    }

    .py-steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .py-gauge {
        width: 120px;
        height: 120px;
    }

    .py-gauge-score {
        font-size: 2rem;
    }
}