/* ============================================================
   PayInsightHub – UAE Gratuity Calculator v2.0
   Author: Yasir Ali | payinsighthub.com
   
   All selectors are scoped under .pih-gc-wrap to prevent ANY
   conflicts with your WordPress theme or other plugins.
   ============================================================ */

/* ---------- Layout wrapper ---------- */
.pih-gc-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a2e;
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 960px;
}

.pih-gc-wrap *,
.pih-gc-wrap *::before,
.pih-gc-wrap *::after {
    box-sizing: inherit;
}

/* ---------- Two-column grid ---------- */
.pih-gc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 680px) {
    .pih-gc-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Panels ---------- */
.pih-gc-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.pih-gc-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f2f5;
}

.pih-gc-panel-icon {
    font-size: 20px;
    line-height: 1;
}

.pih-gc-panel-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a2e;
    letter-spacing: -0.01em;
}

/* ---------- Form fields ---------- */
.pih-gc-field {
    margin-bottom: 18px;
}

.pih-gc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

/* Scoped inputs — does NOT touch any global input or select */
.pih-gc-wrap .pih-gc-input,
.pih-gc-wrap .pih-gc-select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    color: #1a1a2e;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.pih-gc-wrap .pih-gc-input:focus,
.pih-gc-wrap .pih-gc-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background: #ffffff;
}

/* Salary input with AED prefix */
.pih-gc-input-wrap {
    position: relative;
}

.pih-gc-input-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    pointer-events: none;
    z-index: 1;
}

.pih-gc-wrap .pih-gc-input.pih-gc-has-prefix {
    padding-left: 52px;
}

/* Select arrow */
.pih-gc-wrap .pih-gc-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Hint text */
.pih-gc-hint {
    margin: 5px 0 0;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

/* ---------- Contract type toggle ---------- */
.pih-gc-toggle {
    display: flex;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.pih-gc-wrap .pih-gc-toggle-btn {
    flex: 1;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #6b7280;
    background: #f8fafc;
    border: none;
    border-right: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    outline: none;
}

.pih-gc-wrap .pih-gc-toggle-btn:last-child {
    border-right: none;
}

.pih-gc-wrap .pih-gc-toggle-btn.pih-gc-active {
    background: #6366f1;
    color: #ffffff;
    font-weight: 600;
}

.pih-gc-wrap .pih-gc-toggle-btn:hover:not(.pih-gc-active) {
    background: #f0f2f5;
}

/* ---------- Date row ---------- */
.pih-gc-date-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 400px) {
    .pih-gc-date-row {
        grid-template-columns: 1fr;
    }
}

/* ---------- Service badge ---------- */
.pih-gc-service-badge {
    margin: 4px 0 20px;
    padding: 11px 16px;
    background: #f0fdf4;
    border: 1.5px dashed #86efac;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #15803d;
    min-height: 42px;
}

/* ---------- Action buttons ---------- */
.pih-gc-actions {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.pih-gc-wrap .pih-gc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
}

.pih-gc-wrap .pih-gc-btn:hover {
    opacity: 0.88;
}

.pih-gc-wrap .pih-gc-btn:active {
    transform: scale(0.98);
}

.pih-gc-wrap .pih-gc-btn-primary {
    background: #6366f1;
    color: #ffffff;
}

.pih-gc-wrap .pih-gc-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
}

.pih-gc-wrap .pih-gc-btn-pdf {
    background: #1e293b;
    color: #ffffff;
    flex: 1;
}

.pih-gc-wrap .pih-gc-btn-wa {
    background: #25d366;
    color: #ffffff;
    flex: 1;
}

/* ---------- Total result box ---------- */
.pih-gc-total-box {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 20px;
}

.pih-gc-total-label {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pih-gc-total-amount {
    margin: 0 0 6px;
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1;
}

.pih-gc-total-sub {
    margin: 0;
    font-size: 12px;
    color: rgba(255,255,255,0.65);
}

/* ---------- Breakdown ---------- */
.pih-gc-breakdown {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.pih-gc-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.pih-gc-breakdown-row:last-child {
    border-bottom: none;
}

.pih-gc-breakdown-label {
    color: #6b7280;
}

.pih-gc-breakdown-value {
    font-weight: 600;
    color: #1a1a2e;
    text-align: right;
}

.pih-gc-breakdown-rule .pih-gc-breakdown-value {
    font-size: 12px;
    color: #6366f1;
    max-width: 55%;
    text-align: right;
    line-height: 1.3;
}

.pih-gc-breakdown-total {
    background: #f8fafc;
    font-weight: 700;
}

.pih-gc-breakdown-total .pih-gc-breakdown-label {
    font-weight: 700;
    color: #1a1a2e;
}

.pih-gc-breakdown-total .pih-gc-breakdown-value {
    color: #6366f1;
    font-size: 15px;
}

/* ---------- Export actions ---------- */
.pih-gc-export-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

/* ---------- Disclaimer ---------- */
.pih-gc-disclaimer {
    margin: 0;
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.5;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
}
