/*
 * Calculadora Gestacional - WordPress Plugin Styles
 * All rules scoped under .cg-plugin-wrapper to avoid conflicts
 * with WordPress core and Kadence theme styles.
 */

/* ============================================================
   RESET & WRAPPER
   ============================================================ */
.cg-plugin-wrapper,
.cg-plugin-wrapper *,
.cg-plugin-wrapper *::before,
.cg-plugin-wrapper *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.cg-plugin-wrapper {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e50;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cg-plugin-wrapper .cg-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================================
   CARDS
   ============================================================ */
.cg-plugin-wrapper .calculator-card,
.cg-plugin-wrapper .results-card,
.cg-plugin-wrapper .week-circles-container,
.cg-plugin-wrapper .week-details-single-container {
    background: white;
    border-radius: 28px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cg-plugin-wrapper .calculator-card:hover,
.cg-plugin-wrapper .results-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   TABS
   ============================================================ */
.cg-plugin-wrapper .tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0e6f5;
    flex-wrap: wrap;
}

.cg-plugin-wrapper .tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #5d5d5d;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 40px 40px 0 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

.cg-plugin-wrapper .tab-btn:hover {
    color: #8e24aa;
    background: rgba(142, 36, 170, 0.05);
}

.cg-plugin-wrapper .tab-btn.active {
    color: #6a1b9a;
    border-bottom-color: #9c27b0;
    background: rgba(156, 39, 176, 0.08);
}

/* ============================================================
   METHOD FORMS
   ============================================================ */
.cg-plugin-wrapper .method-content {
    min-height: 220px;
}

.cg-plugin-wrapper .method-form {
    display: none;
    animation: cgFadeIn 0.3s ease;
}

.cg-plugin-wrapper .method-form.active {
    display: block;
}

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

/* ============================================================
   INPUT GROUPS
   ============================================================ */
.cg-plugin-wrapper .input-group {
    margin-bottom: 22px;
}

.cg-plugin-wrapper .input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.cg-plugin-wrapper .input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.cg-plugin-wrapper .input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9e0f0;
    border-radius: 18px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #fefefe;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e50;
    line-height: 1.6;
}

.cg-plugin-wrapper .input-group input:focus {
    outline: none;
    border-color: #ab47bc;
    box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.2);
}

/* ============================================================
   CALCULATE BUTTON
   ============================================================ */
.cg-plugin-wrapper .calculate-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(100deg, #7b1fa2, #ba68c8);
    color: white;
    border: none;
    border-radius: 40px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 14px rgba(123, 31, 162, 0.25);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

.cg-plugin-wrapper .calculate-btn:hover {
    background: linear-gradient(100deg, #6a1b9a, #ab47bc);
    transform: scale(0.98);
    box-shadow: 0 4px 10px rgba(123, 31, 162, 0.4);
}

/* ============================================================
   RESULTS GRID
   ============================================================ */
.cg-plugin-wrapper .result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.cg-plugin-wrapper .result-item {
    padding: 18px 12px;
    background: #faf5ff;
    border-radius: 24px;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid #ede7f6;
}

.cg-plugin-wrapper .result-item.highlight {
    background: linear-gradient(135deg, #e9d9ff, #e1bee7);
    border: none;
}

.cg-plugin-wrapper .result-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #5e3a6b;
    margin-bottom: 8px;
}

.cg-plugin-wrapper .result-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1f2a3e;
}

.cg-plugin-wrapper .result-item.highlight .result-value {
    color: #4a1d6d;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.cg-plugin-wrapper .progress-section {
    margin: 20px 0 18px;
}

.cg-plugin-wrapper .progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: #4a4a4a;
}

.cg-plugin-wrapper .progress-bar-bg {
    background: #e6d9f0;
    border-radius: 40px;
    height: 14px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px #0001;
}

.cg-plugin-wrapper #cg-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #9c27b0, #e1bee7);
    border-radius: 40px;
    transition: width 0.3s ease;
}

/* ============================================================
   BABY STATUS
   ============================================================ */
.cg-plugin-wrapper .baby-status {
    padding: 18px;
    background: #fff9e0;
    border-radius: 24px;
    border-left: 6px solid #ffb74d;
    margin-top: 12px;
}

.cg-plugin-wrapper .status-label {
    font-weight: 700;
    color: #e67e22;
}

.cg-plugin-wrapper .result-note {
    margin-top: 20px;
    text-align: center;
    background: #f3e5f5;
    padding: 12px;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ============================================================
   WEEK CIRCLES
   ============================================================ */
.cg-plugin-wrapper .week-circles-container h2 {
    font-size: 1.5rem;
    color: #5e2a7a;
    margin-bottom: 20px;
    text-align: center;
}

.cg-plugin-wrapper .week-circles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 14px;
    justify-items: center;
}

.cg-plugin-wrapper .week-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ece3f2;
    border: 2px solid #c9b6db;
    transition: transform 0.2s;
    opacity: 0.7;
}

.cg-plugin-wrapper .week-circle.active {
    background: #ff6b6b;
    border-color: #d32f2f;
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 6px 14px rgba(211, 47, 47, 0.3);
}

.cg-plugin-wrapper .week-circle.active .week-number,
.cg-plugin-wrapper .week-circle.active .week-label {
    color: white;
    font-weight: bold;
}

.cg-plugin-wrapper .week-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

.cg-plugin-wrapper .week-label {
    font-size: 0.65rem;
    color: #5d5d5d;
}

/* ============================================================
   SINGLE WEEK DETAIL CARD
   ============================================================ */
.cg-plugin-wrapper .week-details-single-container {
    animation: cgFadeIn 0.5s ease;
}

.cg-plugin-wrapper .week-details-header {
    font-size: 1.7rem;
    font-weight: 700;
    color: #6a1b9a;
    margin-bottom: 20px;
    border-left: 8px solid #ab47bc;
    padding-left: 20px;
}

.cg-plugin-wrapper .week-fact-card {
    background: linear-gradient(135deg, #faf0ff, #f5e9ff);
    border-radius: 32px;
    padding: 24px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cg-plugin-wrapper .week-fact-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #38175c;
    margin-bottom: 16px;
    display: inline-block;
    background: #e9d9ff;
    padding: 4px 20px;
    border-radius: 40px;
}

.cg-plugin-wrapper .week-note {
    margin-top: 20px;
    font-size: 0.9rem;
    background: #ede0f5;
    padding: 12px;
    border-radius: 24px;
    color: #38175c;
}

.cg-plugin-wrapper .seo-text-small {
    text-align: center;
    font-size: 0.85rem;
    color: #5b4c6e;
    background: #faf2ff;
    padding: 12px;
    border-radius: 28px;
    margin-top: 20px;
}

/* ============================================================
   RESPONSIVE - TABLET (<=768px)
   ============================================================ */
@media (max-width: 768px) {
    .cg-plugin-wrapper .cg-container {
        padding: 12px;
    }

    .cg-plugin-wrapper .calculator-card,
    .cg-plugin-wrapper .results-card,
    .cg-plugin-wrapper .week-circles-container,
    .cg-plugin-wrapper .week-details-single-container {
        padding: 20px;
        margin-bottom: 20px;
        border-radius: 24px;
    }

    .cg-plugin-wrapper .tabs {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 24px;
    }

    .cg-plugin-wrapper .tab-btn {
        width: 100%;
        min-width: unset;
        padding: 12px 16px;
        border-radius: 50px;
        border-bottom: none;
        text-align: center;
    }

    .cg-plugin-wrapper .tab-btn.active {
        border-bottom: none;
        background: rgba(156, 39, 176, 0.12);
    }

    .cg-plugin-wrapper .input-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cg-plugin-wrapper .input-group input {
        padding: 10px 14px;
        font-size: 16px;
    }

    .cg-plugin-wrapper .result-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cg-plugin-wrapper .result-item {
        padding: 14px 10px;
    }

    .cg-plugin-wrapper .result-value {
        font-size: 1.3rem;
    }

    .cg-plugin-wrapper .result-label {
        font-size: 0.75rem;
    }

    .cg-plugin-wrapper .week-circles {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
        gap: 10px;
    }

    .cg-plugin-wrapper .week-circle {
        width: 55px;
        height: 55px;
    }

    .cg-plugin-wrapper .week-number {
        font-size: 0.9rem;
    }

    .cg-plugin-wrapper .week-label {
        font-size: 0.6rem;
    }

    .cg-plugin-wrapper .week-details-header {
        font-size: 1.3rem;
        padding-left: 15px;
        margin-bottom: 15px;
    }

    .cg-plugin-wrapper .week-fact-title {
        font-size: 1.2rem;
        padding: 4px 16px;
    }

    .cg-plugin-wrapper .week-fact-card {
        padding: 18px;
    }

    .cg-plugin-wrapper .week-note {
        font-size: 0.85rem;
        padding: 10px;
    }

    .cg-plugin-wrapper .progress-label {
        font-size: 0.75rem;
    }

    .cg-plugin-wrapper .baby-status {
        padding: 14px;
    }

    .cg-plugin-wrapper .status-content {
        font-size: 0.9rem;
    }

    .cg-plugin-wrapper .result-note {
        font-size: 0.85rem;
        padding: 10px;
    }

    .cg-plugin-wrapper .seo-text-small {
        font-size: 0.75rem;
        padding: 10px;
    }

    .cg-plugin-wrapper .calculate-btn {
        padding: 12px;
        font-size: 1rem;
    }
}

/* ============================================================
   RESPONSIVE - EXTRA SMALL (<=480px)
   ============================================================ */
@media (max-width: 480px) {
    .cg-plugin-wrapper .calculator-card,
    .cg-plugin-wrapper .results-card,
    .cg-plugin-wrapper .week-circles-container,
    .cg-plugin-wrapper .week-details-single-container {
        padding: 16px;
    }

    .cg-plugin-wrapper .tab-btn {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .cg-plugin-wrapper .input-group label {
        font-size: 0.85rem;
    }

    .cg-plugin-wrapper .result-value {
        font-size: 1.2rem;
    }

    .cg-plugin-wrapper .week-details-header {
        font-size: 1.1rem;
        border-left-width: 5px;
    }

    .cg-plugin-wrapper .week-fact-title {
        font-size: 1rem;
    }

    .cg-plugin-wrapper .week-circle {
        width: 48px;
        height: 48px;
    }

    .cg-plugin-wrapper .week-number {
        font-size: 0.8rem;
    }
}

/* Inline validation message (v1.1.1) - uses the plugin's existing purple family */
.cg-plugin-wrapper .cg-error {
    background: #fdf4ff;
    border: 1.5px solid #ab47bc;
    color: #6a1b9a;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 600;
    margin: 14px 0 4px;
}
