/* ============================================
   PEPTIDE CALCULATOR - WordPress Plugin Styles
   ============================================ */

:root {
    --pep-primary: #0f6fec;
    --pep-primary-hover: #0b5cc5;
    --pep-primary-light: #e8f1fd;
    --pep-primary-glow: rgba(15, 111, 236, 0.15);
    --pep-accent: #10b981;
    --pep-accent-light: #d1fae5;
    --pep-warning: #f59e0b;
    --pep-warning-bg: #fef3c7;
    --pep-danger: #ef4444;
    --pep-danger-bg: #fef2f2;
    --pep-text: #0f172a;
    --pep-text-secondary: #475569;
    --pep-text-muted: #94a3b8;
    --pep-bg: #f8fafc;
    --pep-card: #ffffff;
    --pep-border: #e2e8f0;
    --pep-border-hover: #cbd5e1;
    --pep-radius: 14px;
    --pep-radius-sm: 10px;
    --pep-radius-xs: 7px;
    --pep-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.06);
    --pep-shadow-lg: 0 4px 16px rgba(15, 23, 42, 0.06), 0 12px 40px rgba(15, 23, 42, 0.08);
    --pep-shadow-glow: 0 0 0 3px var(--pep-primary-glow);
    --pep-font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --pep-font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --pep-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Wrapper ---- */
.pepcalc-wrapper {
    font-family: var(--pep-font);
    color: var(--pep-text);
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.pepcalc-wrapper *, .pepcalc-wrapper *::before, .pepcalc-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---- Header ---- */
.pepcalc-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    border-radius: var(--pep-radius) var(--pep-radius) 0 0;
    position: relative;
    overflow: hidden;
}
.pepcalc-header::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -15%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(15, 111, 236, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.pepcalc-header::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.pepcalc-header-icon {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 1;
}
.pepcalc-header-icon svg {
    width: 28px;
    height: 28px;
    color: #60a5fa;
}
.pepcalc-header-text {
    position: relative;
    z-index: 1;
}
.pepcalc-header-text h2 {
    font-family: var(--pep-font-display);
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.pepcalc-header-text p {
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    margin: 2px 0 0 0;
    font-weight: 400;
}

/* ---- Tabs ---- */
.pepcalc-tabs {
    display: flex;
    gap: 0;
    background: var(--pep-card);
    border-bottom: 1px solid var(--pep-border);
    padding: 0 24px;
}
.pepcalc-tab {
    font-family: var(--pep-font);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--pep-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--pep-transition);
    white-space: nowrap;
}
.pepcalc-tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.pepcalc-tab:hover {
    color: var(--pep-text-secondary);
}
.pepcalc-tab.active {
    color: var(--pep-primary);
    border-bottom-color: var(--pep-primary);
    font-weight: 600;
}
.pepcalc-tab-content {
    display: none;
    background: var(--pep-bg);
    padding: 28px;
}
.pepcalc-tab-content.active {
    display: block;
}

/* ---- Grid Layout ---- */
.pepcalc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

/* ---- Fields & Labels ---- */
.pepcalc-inputs-section {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.pepcalc-field {
    background: var(--pep-card);
    border-radius: var(--pep-radius-sm);
    padding: 20px;
    border: 1px solid var(--pep-border);
    transition: border-color var(--pep-transition), box-shadow var(--pep-transition);
}
.pepcalc-field:hover {
    border-color: var(--pep-border-hover);
}
.pepcalc-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pep-text);
    margin-bottom: 14px;
    font-family: var(--pep-font-display);
    letter-spacing: -0.01em;
}
.pepcalc-step-badge {
    width: 24px;
    height: 24px;
    background: var(--pep-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--pep-font-display);
}

/* ---- Option Buttons ---- */
.pepcalc-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pepcalc-option-btn {
    font-family: var(--pep-font);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pep-text-secondary);
    background: var(--pep-bg);
    border: 1.5px solid var(--pep-border);
    border-radius: var(--pep-radius-xs);
    cursor: pointer;
    transition: all var(--pep-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
}
.pepcalc-option-btn span {
    font-size: 10px;
    color: var(--pep-text-muted);
    font-weight: 400;
}
.pepcalc-option-btn:hover {
    border-color: var(--pep-primary);
    color: var(--pep-primary);
    background: var(--pep-primary-light);
}
.pepcalc-option-btn.active {
    background: var(--pep-primary);
    color: #fff;
    border-color: var(--pep-primary);
    box-shadow: 0 2px 8px rgba(15, 111, 236, 0.25);
}
.pepcalc-option-btn.active span {
    color: rgba(255,255,255,0.75);
}
.pepcalc-option-btn-other {
    background: transparent;
    border-style: dashed;
}

/* ---- Inputs ---- */
.pepcalc-custom-input {
    margin-top: 12px;
    position: relative;
    display: flex;
    align-items: center;
}
.pepcalc-input {
    font-family: var(--pep-font);
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--pep-text);
    background: var(--pep-bg);
    border: 1.5px solid var(--pep-border);
    border-radius: var(--pep-radius-xs);
    outline: none;
    transition: all var(--pep-transition);
    -moz-appearance: textfield;
}
.pepcalc-input::-webkit-inner-spin-button,
.pepcalc-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}
.pepcalc-input:focus {
    border-color: var(--pep-primary);
    box-shadow: var(--pep-shadow-glow);
    background: #fff;
}
.pepcalc-input-suffix {
    position: absolute;
    right: 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pep-text-muted);
    pointer-events: none;
}
.pepcalc-input-wide {
    flex: 1;
}
.pepcalc-inline-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ---- Toggle Group ---- */
.pepcalc-toggle-group {
    display: flex;
    background: var(--pep-bg);
    border: 1.5px solid var(--pep-border);
    border-radius: var(--pep-radius-xs);
    overflow: hidden;
    flex-shrink: 0;
}
.pepcalc-toggle-btn {
    font-family: var(--pep-font);
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pep-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: all var(--pep-transition);
}
.pepcalc-toggle-btn.active {
    background: var(--pep-primary);
    color: #fff;
}

/* ---- Select ---- */
.pepcalc-select {
    font-family: var(--pep-font);
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--pep-text-secondary);
    background: var(--pep-bg);
    border: 1.5px solid var(--pep-border);
    border-radius: var(--pep-radius-xs);
    outline: none;
    cursor: pointer;
    margin-top: 8px;
    transition: border-color var(--pep-transition);
    appearance: auto;
}
.pepcalc-select:focus {
    border-color: var(--pep-primary);
}

/* ---- Results Section ---- */
.pepcalc-results-section {
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 20px;
}
.pepcalc-results-card {
    background: var(--pep-card);
    border-radius: var(--pep-radius-sm);
    padding: 24px;
    border: 1px solid var(--pep-border);
    box-shadow: var(--pep-shadow);
}
.pepcalc-results-title {
    font-family: var(--pep-font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--pep-text);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}
.pepcalc-result-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.pepcalc-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 12px;
    border-radius: var(--pep-radius-xs);
}
.pepcalc-result-highlight {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    position: relative;
    overflow: hidden;
}
.pepcalc-result-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top right, rgba(15, 111, 236, 0.2), transparent 60%);
    pointer-events: none;
}
.pepcalc-result-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    position: relative;
}
.pepcalc-result-value {
    font-family: var(--pep-font-display);
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.1;
    position: relative;
}
.pepcalc-result-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    margin-top: 4px;
    position: relative;
}

/* ---- Result Details ---- */
.pepcalc-result-details {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.pepcalc-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--pep-border);
}
.pepcalc-detail:last-child {
    border-bottom: none;
}
.pepcalc-detail span {
    font-size: 13px;
    color: var(--pep-text-secondary);
}
.pepcalc-detail strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--pep-text);
    font-family: var(--pep-font-display);
}

/* ---- Warning ---- */
.pepcalc-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--pep-radius-xs);
    font-size: 13px;
    line-height: 1.5;
}
.pepcalc-warning svg {
    flex-shrink: 0;
    margin-top: 1px;
}
.pepcalc-warning.warning-yellow {
    background: var(--pep-warning-bg);
    color: #92400e;
    border: 1px solid #fde68a;
}
.pepcalc-warning.warning-yellow svg {
    color: var(--pep-warning);
}
.pepcalc-warning.warning-red {
    background: var(--pep-danger-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}
.pepcalc-warning.warning-red svg {
    color: var(--pep-danger);
}

/* ---- Syringe Visual ---- */
.pepcalc-syringe-visual {
    background: var(--pep-card);
    border-radius: var(--pep-radius-sm);
    padding: 24px;
    border: 1px solid var(--pep-border);
    box-shadow: var(--pep-shadow);
}
.pepcalc-syringe-label {
    font-family: var(--pep-font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--pep-text);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}
.pepcalc-syringe-container {
    display: flex;
    justify-content: center;
    padding: 20px 0 10px 0;
}
.pepcalc-syringe {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 280px;
    position: relative;
}

/* Plunger */
.pepcalc-syringe-plunger {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}
.pepcalc-syringe-plunger-handle {
    width: 80px;
    height: 10px;
    background: linear-gradient(180deg, #94a3b8, #64748b);
    border-radius: 4px 4px 0 0;
    border: 1px solid #94a3b8;
}
.pepcalc-syringe-plunger-rod {
    width: 12px;
    height: 20px;
    background: linear-gradient(90deg, #d1d5db, #e5e7eb, #d1d5db);
    border-left: 1px solid #c0c4ca;
    border-right: 1px solid #c0c4ca;
}

/* Barrel */
.pepcalc-syringe-barrel {
    width: 72px;
    min-height: 280px;
    background: linear-gradient(90deg, rgba(226,232,240,0.4), rgba(248,250,252,0.6), rgba(226,232,240,0.4));
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
.pepcalc-syringe-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg, rgba(15, 111, 236, 0.25), rgba(15, 111, 236, 0.45));
    transition: height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 0 0 2px 2px;
}
.pepcalc-syringe-ticks {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
.pepcalc-syringe-tick {
    position: absolute;
    right: 0;
    height: 1px;
    background: #94a3b8;
}
.pepcalc-syringe-tick.major {
    width: 24px;
}
.pepcalc-syringe-tick.minor {
    width: 12px;
}
.pepcalc-syringe-tick-label {
    position: absolute;
    right: 78px;
    font-size: 11px;
    font-weight: 500;
    color: var(--pep-text-muted);
    transform: translateY(-50%);
    white-space: nowrap;
    font-family: var(--pep-font-display);
}
.pepcalc-syringe-draw-line {
    position: absolute;
    left: -4px;
    right: -4px;
    height: 2px;
    background: var(--pep-primary);
    transition: bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    bottom: 0%;
    z-index: 5;
    display: flex;
    align-items: center;
}
.pepcalc-syringe-draw-line::before {
    content: '';
    position: absolute;
    left: -6px;
    top: -5px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid var(--pep-primary);
}
.pepcalc-syringe-draw-line::after {
    content: '';
    position: absolute;
    right: -6px;
    top: -5px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid var(--pep-primary);
}
#syringe-draw-label {
    position: absolute;
    left: calc(100% + 14px);
    background: var(--pep-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 5px;
    white-space: nowrap;
    font-family: var(--pep-font-display);
    box-shadow: 0 2px 8px rgba(15, 111, 236, 0.3);
}
#syringe-draw-label::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 5px solid var(--pep-primary);
}

/* Tip */
.pepcalc-syringe-tip {
    width: 8px;
    height: 30px;
    background: linear-gradient(90deg, #d1d5db, #e5e7eb, #d1d5db);
    border: 1px solid #c0c4ca;
    border-radius: 0 0 3px 3px;
    position: relative;
}
.pepcalc-syringe-tip::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 12px;
    background: linear-gradient(180deg, #94a3b8, transparent);
}

/* ---- Reference Card ---- */
.pepcalc-reference-card {
    background: var(--pep-card);
    border-radius: var(--pep-radius-sm);
    padding: 24px;
    border: 1px solid var(--pep-border);
    box-shadow: var(--pep-shadow);
}
.pepcalc-reference-title {
    font-family: var(--pep-font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--pep-text);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}
.pepcalc-reference-table {
    display: flex;
    flex-direction: column;
}
.pepcalc-ref-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--pep-border);
    font-size: 13px;
}
.pepcalc-ref-row:last-child {
    border-bottom: none;
}
.pepcalc-ref-row span:first-child {
    font-weight: 600;
    color: var(--pep-text);
}
.pepcalc-ref-row span {
    color: var(--pep-text-secondary);
}
.pepcalc-ref-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pep-text-muted) !important;
    font-weight: 600 !important;
    padding-bottom: 10px;
}
.pepcalc-ref-header span {
    color: var(--pep-text-muted) !important;
    font-weight: 600 !important;
}
.pepcalc-disclaimer-inline {
    font-size: 11px;
    color: var(--pep-text-muted);
    margin-top: 12px;
    font-style: italic;
}

/* ---- Converter ---- */
.pepcalc-converter-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.pepcalc-converter-card {
    background: var(--pep-card);
    border-radius: var(--pep-radius-sm);
    padding: 24px;
    border: 1px solid var(--pep-border);
}
.pepcalc-converter-title {
    font-family: var(--pep-font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--pep-text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.pepcalc-converter-title svg {
    color: var(--pep-primary);
}
.pepcalc-converter-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.pepcalc-converter-field {
    flex: 1;
}
.pepcalc-converter-arrow {
    flex-shrink: 0;
    color: var(--pep-text-muted);
    padding-top: 0;
}

/* ---- Disclaimer ---- */
.pepcalc-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 24px;
    background: var(--pep-card);
    border-top: 1px solid var(--pep-border);
    border-radius: 0 0 var(--pep-radius) var(--pep-radius);
    font-size: 12px;
    color: var(--pep-text-muted);
    line-height: 1.6;
}
.pepcalc-disclaimer svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--pep-text-muted);
}
.pepcalc-disclaimer strong {
    color: var(--pep-text-secondary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 860px) {
    .pepcalc-grid {
        grid-template-columns: 1fr;
    }
    .pepcalc-results-section {
        position: static;
    }
}

@media (max-width: 640px) {
    .pepcalc-header {
        padding: 20px;
    }
    .pepcalc-header-text h2 {
        font-size: 20px;
    }
    .pepcalc-tabs {
        padding: 0 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .pepcalc-tab {
        padding: 14px 14px;
        font-size: 13px;
    }
    .pepcalc-tab svg {
        display: none;
    }
    .pepcalc-tab-content {
        padding: 20px 16px;
    }
    .pepcalc-field {
        padding: 16px;
    }
    .pepcalc-btn-group {
        gap: 6px;
    }
    .pepcalc-option-btn {
        padding: 9px 12px;
        font-size: 12px;
    }
    .pepcalc-result-value {
        font-size: 26px;
    }
    .pepcalc-converter-row {
        flex-direction: column;
        gap: 10px;
    }
    .pepcalc-converter-arrow {
        transform: rotate(90deg);
    }
    .pepcalc-result-row {
        grid-template-columns: 1fr;
    }
    .pepcalc-syringe-barrel {
        min-height: 240px;
    }
    .pepcalc-ref-row {
        font-size: 12px;
    }
}

/* ---- Animations ---- */
@keyframes pepcalc-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.pepcalc-tab-content.active {
    animation: pepcalc-fadeIn 0.3s ease;
}

@keyframes pepcalc-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(15, 111, 236, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(15, 111, 236, 0); }
}
.pepcalc-result-highlight {
    animation: pepcalc-pulse 2.5s ease-in-out infinite;
}
