/* ============================================
   PITBULL COST OF OWNERSHIP CALCULATOR
   WordPress Plugin Stylesheet
   Version: 1.0.0
   Responsive: Mobile-first with sm, md, lg breakpoints
   ============================================ */

/* Viewport & Base */
.pbc-wrapper {
    --pbc-primary: #e85444;
    --pbc-primary-dark: #c83e30;
    --pbc-primary-light: #f2786d;
    --pbc-text: #1a1a2e;
    --pbc-text-secondary: #6b7280;
    --pbc-bg: #f8fafc;
    --pbc-card-bg: #ffffff;
    --pbc-border: #e5e7eb;
    --pbc-border-light: #f3f4f6;
    --pbc-blue: #3b82f6;
    --pbc-green: #10b981;
    --pbc-purple: #8b5cf6;
    --pbc-orange: #f59e0b;
    --pbc-pink: #ec4899;
    --pbc-teal: #14b8a6;
    --pbc-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --pbc-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
    --pbc-shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--pbc-text);
    background: var(--pbc-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
}

.pbc-wrapper *, .pbc-wrapper *::before, .pbc-wrapper *::after {
    box-sizing: border-box;
}

.pbc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Header */
.pbc-header {
    margin-bottom: 20px;
}

.pbc-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--pbc-text);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.pbc-subtitle {
    font-size: 14px;
    color: var(--pbc-text-secondary);
    margin: 0;
    max-width: 600px;
}

/* Grid Layout - Mobile First */
.pbc-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pbc-left-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pbc-right-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: static;
}

/* ===== TABLET (768px+) ===== */
@media (min-width: 768px) {
    .pbc-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .pbc-left-col {
        grid-column: 1 / 2;
    }

    .pbc-right-col {
        grid-column: 2 / 3;
    }

    .pbc-title {
        font-size: 28px;
    }

    .pbc-subtitle {
        font-size: 15px;
    }
}

/* ===== DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
    .pbc-grid {
        grid-template-columns: 1.35fr 0.65fr;
        gap: 24px;
    }

    .pbc-right-col {
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }

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

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

    .pbc-container {
        padding: 24px;
    }
}

/* Cards */
.pbc-card {
    background: var(--pbc-card-bg);
    border-radius: 16px;
    border: 1px solid var(--pbc-border);
    padding: 16px;
    box-shadow: var(--pbc-shadow-sm);
}

@media (min-width: 768px) {
    .pbc-card {
        padding: 20px;
    }
}

.pbc-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.pbc-card-header h2,
.pbc-card-header-plain h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

@media (min-width: 768px) {
    .pbc-card-header h2,
    .pbc-card-header-plain h2 {
        font-size: 17px;
    }
}

.pbc-card-header-plain {
    margin-bottom: 16px;
}

.pbc-card-desc {
    font-size: 13px;
    color: var(--pbc-text-secondary);
    margin: 4px 0 0 0;
}

.pbc-icon-dollar {
    width: 28px;
    height: 28px;
    background: var(--pbc-primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

/* Profile Card */
.pbc-profile-card {
    padding-bottom: 20px;
}

/* Field Groups */
.pbc-field-group {
    margin-bottom: 20px;
}

.pbc-field-group:last-child {
    margin-bottom: 0;
}

.pbc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--pbc-text);
    margin-bottom: 10px;
}

/* Dog Size Options */
.pbc-size-options,
.pbc-color-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (min-width: 480px) {
    .pbc-size-options,
    .pbc-color-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

.pbc-size-btn,
.pbc-color-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px 8px;
    border: 2px solid var(--pbc-border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 60px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.pbc-size-btn:hover,
.pbc-color-btn:hover {
    border-color: var(--pbc-primary-light);
    background: #fef2f2;
}

.pbc-size-btn--active,
.pbc-color-btn--active {
    border-color: var(--pbc-primary) !important;
    background: #fef2f2 !important;
    color: var(--pbc-primary-dark);
}

.pbc-size-label {
    font-weight: 700;
    font-size: 13px;
}

@media (min-width: 768px) {
    .pbc-size-label {
        font-size: 14px;
    }
}

.pbc-size-desc {
    font-size: 11px;
    color: var(--pbc-text-secondary);
}

@media (min-width: 768px) {
    .pbc-size-desc {
        font-size: 12px;
    }
}

.pbc-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--pbc-border);
    margin-bottom: 4px;
}

.pbc-swatch-black { background: #1a1a2e; }
.pbc-swatch-brindle { background: repeating-linear-gradient(45deg, #3d2c1d, #3d2c1d 4px, #8b6914 4px, #8b6914 8px); }
.pbc-swatch-blue { background: #7b9bb3; }
.pbc-swatch-white { background: #f8f8f8; border-color: #ddd; }

.pbc-color-btn span:last-child {
    font-size: 10px;
    text-align: center;
}

@media (min-width: 768px) {
    .pbc-color-btn span:last-child {
        font-size: 12px;
    }
}

/* Years Input */
.pbc-years-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pbc-years-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pbc-lifespan-note {
    font-size: 11px;
    color: var(--pbc-text-secondary);
    font-weight: 400;
}

@media (min-width: 768px) {
    .pbc-years-row {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
    }
    .pbc-years-input-wrap {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .pbc-years-label {
        flex: 1;
    }
}

.pbc-input {
    width: 70px;
    height: 44px;
    min-height: 44px;
    border: 2px solid var(--pbc-border);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--pbc-text);
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.pbc-input:focus {
    border-color: var(--pbc-primary);
}

.pbc-years-unit {
    font-size: 13px;
    color: var(--pbc-text-secondary);
}

.pbc-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--pbc-border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    min-height: 44px;
}

.pbc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--pbc-primary);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.pbc-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--pbc-primary);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

@media (min-width: 768px) {
    .pbc-slider {
        flex: 1;
        min-width: 120px;
        min-height: 6px;
    }
}

.pbc-optional {
    font-weight: 400;
    color: var(--pbc-text-secondary);
    font-size: 11px;
}

/* Category Sections */
.pbc-category {
    border: 1px solid var(--pbc-border-light);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
    background: white;
}

.pbc-category:last-child {
    margin-bottom: 0;
}

.pbc-category-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: white;
    transition: background 0.2s;
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.pbc-category-header:hover {
    background: #fafafa;
}

.pbc-category-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.pbc-category-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.pbc-icon-blue { background: #e0f2fe; }
.pbc-icon-green { background: #d1fae5; }
.pbc-icon-purple { background: #ede9fe; }
.pbc-icon-orange { background: #fef3c7; }
.pbc-icon-pink { background: #fce7f3; }
.pbc-icon-teal { background: #ccfbf1; }

.pbc-category-title-info {
    min-width: 0;
    flex: 1;
}

.pbc-category-title-info h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--pbc-text);
}

@media (min-width: 768px) {
    .pbc-category-title-info h3 {
        font-size: 15px;
    }
}

.pbc-category-count {
    font-size: 12px;
    color: var(--pbc-text-secondary);
}

.pbc-pitbull-note {
    font-size: 11px;
    color: var(--pbc-primary);
    display: block;
    margin-top: 2px;
}

.pbc-chevron {
    font-size: 10px;
    color: var(--pbc-text-secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.pbc-category-header--collapsed .pbc-chevron {
    transform: rotate(-90deg);
}

.pbc-category-body {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 1;
}

.pbc-category-body:not(.pbc-category-body--open) {
    max-height: 0;
    opacity: 0;
}

/* Item Rows */
.pbc-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid var(--pbc-border-light);
    flex-wrap: wrap;
    min-height: 52px;
}

@media (min-width: 768px) {
    .pbc-item-row {
        padding: 12px 16px;
        flex-wrap: nowrap;
        min-height: 56px;
    }
}

.pbc-item-row--disabled {
    opacity: 0.5;
}

.pbc-item-row--disabled .pbc-item-name,
.pbc-item-row--disabled .pbc-dollar {
    color: #9ca3af;
}

/* Toggle Switch */
.pbc-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
    cursor: pointer;
}

.pbc-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.pbc-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    border-radius: 28px;
    transition: background-color 0.25s ease;
}

.pbc-toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.pbc-toggle-switch input:checked + .pbc-toggle-slider {
    background-color: var(--pbc-primary);
}

.pbc-toggle-switch input:checked + .pbc-toggle-slider::before {
    transform: translateX(20px);
}

.pbc-toggle-switch input:focus + .pbc-toggle-slider {
    box-shadow: 0 0 0 3px rgba(232, 84, 68, 0.2);
}

.pbc-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--pbc-text);
    flex: 1;
    min-width: 90px;
}

@media (min-width: 768px) {
    .pbc-item-name {
        font-size: 14px;
        min-width: 140px;
    }
}

.pbc-badge {
    display: inline-block;
    background: #fef2f2;
    color: var(--pbc-primary);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .pbc-badge {
        font-size: 10px;
    }
}

.pbc-item-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin-left: 58px;
}

@media (min-width: 480px) {
    .pbc-item-inputs {
        width: auto;
        margin-left: 0;
    }
}

.pbc-dollar {
    font-size: 14px;
    color: var(--pbc-text-secondary);
    font-weight: 500;
}

.pbc-cost-input {
    width: 60px;
    height: 40px;
    min-height: 40px;
    border: 2px solid var(--pbc-border);
    border-radius: 8px;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

@media (min-width: 768px) {
    .pbc-cost-input {
        width: 68px;
        height: 44px;
        font-size: 15px;
    }
}

.pbc-cost-input:focus {
    border-color: var(--pbc-primary);
}

.pbc-period-select {
    height: 40px;
    min-height: 40px;
    border: 2px solid var(--pbc-border);
    border-radius: 8px;
    padding: 0 8px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    outline: none;
    color: var(--pbc-text);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

@media (min-width: 768px) {
    .pbc-period-select {
        height: 44px;
        font-size: 14px;
    }
}

.pbc-period-select:focus {
    border-color: var(--pbc-primary);
}

/* ======== RIGHT COLUMN: SUMMARY ======== */

.pbc-summary-card {
    background: var(--pbc-primary);
    border-radius: 16px;
    padding: 20px;
    color: white;
    box-shadow: var(--pbc-shadow-lg);
}

.pbc-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.pbc-summary-header h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

@media (min-width: 768px) {
    .pbc-summary-header h2 {
        font-size: 17px;
    }
}

.pbc-summary-icon {
    font-size: 16px;
}

.pbc-summary-boxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pbc-summary-box {
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pbc-summary-label {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pbc-summary-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
}

@media (min-width: 768px) {
    .pbc-summary-value {
        font-size: 28px;
    }
}

.pbc-summary-box--total {
    background: rgba(255,255,255,0.28);
}

.pbc-calendar-icon {
    font-size: 14px;
}

/* Breakdown */
.pbc-breakdown-card {
    padding: 16px;
}

@media (min-width: 768px) {
    .pbc-breakdown-card {
        padding: 20px;
    }
}

.pbc-breakdown-icon {
    font-size: 16px;
    margin-right: 6px;
}

.pbc-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pbc-breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pbc-breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

@media (min-width: 768px) {
    .pbc-breakdown-header {
        font-size: 14px;
    }
}

.pbc-breakdown-name {
    font-weight: 500;
    color: var(--pbc-text);
}

.pbc-breakdown-amount {
    font-weight: 600;
    color: var(--pbc-text);
}

.pbc-breakdown-bar-bg {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--pbc-border-light);
    overflow: hidden;
}

.pbc-breakdown-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pbc-bar-food { background: var(--pbc-blue); }
.pbc-bar-healthcare { background: var(--pbc-green); }
.pbc-bar-grooming { background: var(--pbc-purple); }
.pbc-bar-supplies { background: var(--pbc-orange); }
.pbc-bar-services { background: var(--pbc-pink); }
.pbc-bar-other { background: var(--pbc-teal); }

/* Top Expenses */
.pbc-top-card {
    padding: 16px;
}

@media (min-width: 768px) {
    .pbc-top-card {
        padding: 20px;
    }
}

.pbc-top-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

@media (min-width: 768px) {
    .pbc-top-title {
        font-size: 15px;
    }
}

.pbc-top-list {
    display: flex;
    flex-direction: column;
}

.pbc-top-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--pbc-border-light);
    font-size: 13px;
}

@media (min-width: 768px) {
    .pbc-top-item {
        font-size: 14px;
    }
}

.pbc-top-item:last-child {
    border-bottom: none;
}

.pbc-top-name {
    color: var(--pbc-text);
}

.pbc-top-value {
    font-weight: 600;
    color: var(--pbc-text);
}

/* Disclaimer */
.pbc-disclaimer {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.pbc-info-icon {
    width: 20px;
    height: 20px;
    background: var(--pbc-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 20px;
}

.pbc-disclaimer p {
    font-size: 12px;
    color: #3b82f6;
    margin: 0;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .pbc-disclaimer p {
        font-size: 13px;
    }
}

/* Pitbull Tip Card */
.pbc-tip-card {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.pbc-tip-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.pbc-tip-content {
    font-size: 13px;
    line-height: 1.5;
    color: #92400e;
}

@media (min-width: 768px) {
    .pbc-tip-content {
        font-size: 14px;
    }
}

/* Action Buttons */
.pbc-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 480px) {
    .pbc-actions {
        flex-direction: row;
        gap: 10px;
    }
}

.pbc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    min-height: 48px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    padding: 0 18px;
    width: 100%;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.pbc-btn:hover {
    transform: translateY(-1px);
}

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

.pbc-btn-primary {
    background: var(--pbc-primary);
    color: white;
}

.pbc-btn-primary:hover {
    background: var(--pbc-primary-dark);
    box-shadow: 0 4px 12px rgba(232,84,68,0.25);
}

.pbc-btn-secondary {
    background: white;
    color: var(--pbc-text);
    border-color: var(--pbc-border);
}

.pbc-btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Credit */
.pbc-credit {
    text-align: center;
    font-size: 12px;
    color: var(--pbc-text-secondary);
    margin-top: 24px;
    padding: 12px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .pbc-wrapper {
        background: white !important;
    }
    .pbc-summary-card {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .pbc-actions, .pbc-tip-card {
        display: none !important;
    }
    .pbc-right-col {
        position: static !important;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pbc-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.pbc-wrapper {
    animation: pbc-fade-in 0.35s ease-out;
}
