/* 
 * ==========================================
 *  COMPONENTS
 *  - Header (Dynamic Island)
 *  - Inputs, Steppers, Sliders
 *  - Hero Cards, Boost Display
 *  - Mode Switch, Toggle
 *  - Result Cards
 *  - Profit Pills, Save Buttons
 *  - History Section
 *  - Bee / Japanese Note
 *  - Buttons & Badges
 *  - Animations & Keyframes
 *  - v0.7 & v0.8 Design Enhancements
 * ==========================================
 */

/* ==========================================
 *  DYNAMIC ISLAND HEADER
 * ========================================== */
.app-header {
    position: sticky;
    top: 1rem;
    z-index: 100;
    margin: 0 auto;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;

    background: rgba(28, 28, 30, 0.6);
    /* Darker island default for high contrast */
    backdrop-filter: blur(35px) saturate(180%);
    -webkit-backdrop-filter: blur(35px) saturate(180%);

    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    /* Capsule Shape */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);

    transition: width 0.3s ease;
    width: fit-content;
    min-width: 320px;
}

/* In light mode, make island lighter but still distinct */
[data-theme="light"] .app-header {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.brand-title {
    font-family: var(--font-display);
    /* Crackman */
    font-size: 1.25rem;
    color: var(--color-text-primary);
    letter-spacing: 1px;
    white-space: nowrap;
    text-shadow: none;
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Stats Widget - VISIBLE IN HEADER AGAIN */
.stats-widget {
    display: flex;
    align-items: center;
    background: rgba(120, 120, 128, 0.12);
    padding: 4px 16px;
    border-radius: 20px;
    gap: 12px;
}

.stat-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-text-secondary);
    margin-right: 4px;
}

.stat-value {
    font-weight: 700;
    color: var(--color-text-primary);
    font-variant-numeric: tabular-nums;
}

.stat-details {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    opacity: 0.8;
}

.btn-icon {
    background: rgba(120, 120, 128, 0.12);
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-icon:active {
    transform: scale(0.9);
}

.btn-icon:hover {
    background: rgba(120, 120, 128, 0.2);
}

/* iOS Toggle Switch - MICRO */
.theme-toggle-wrapper {
    position: relative;
    width: 28px;
    height: 18px;
    background: #E9E9EB;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s;
    padding: 2px;
    /* Inner padding */
}

.theme-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="dark"] .theme-toggle-wrapper {
    background: #39393D;
}

[data-theme="dark"] .theme-toggle-knob {
    transform: translateX(10px);
}

/* ==========================================
 *  INPUTS & STEPPERS
 * ========================================== */

/* iOS Inputs */
.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(118, 118, 128, 0.08);
    /* iOS Field Gray */
    padding: 0.25rem;
    padding-left: 0.75rem;
    border-radius: 12px;
}

/* The actual input field */
.form-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    padding: 0.5rem;
    text-align: right;
    outline: none;
    width: 100%;
    max-width: 100px;
    /* Constrained width */
    font-variant-numeric: tabular-nums;
    transition: box-shadow 0.3s ease;
}

.form-input:focus {
    box-shadow: 0 0 0 2px rgba(255, 149, 0, 0.5);
    /* Orange Glow */
}

/* Steppers inside input wrapper */
.step-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.step-btn:active {
    transform: scale(0.9);
}

.step-btn:hover {
    background: #FFFFFF;
    color: #000000;
}

/* Sliders */
.slider-wrapper {
    margin-top: 10px;
}

.form-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(120, 120, 128, 0.2);
    border-radius: 3px;
    outline: none;
}

.form-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.form-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Tax Buttons */
.tax-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.tax-btn.active {
    background: #007AFF;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================
 *  BOOST & HERO CARDS
 * ========================================== */

/* Boost Display Widget */
.boost-display {
    background: var(--color-accent);
    /* Vivid Orange */
    color: white;
    padding: 1rem;
    border-radius: 18px;
    text-align: center;
    margin-top: 1rem;
    box-shadow: 0 8px 20px rgba(255, 149, 0, 0.3);
}

.boost-label {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    font-weight: 700;
}

.boost-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 4px;
}

/* Hero */
.hero-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    /* COMPACT PADDING */
    background: linear-gradient(180deg, var(--color-surface) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.hero-title {
    font-family: var(--font-main);
    /* APPLE FONT */
    color: var(--color-text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.hero-value-display {
    font-size: 3.5rem;
    /* SMALLER FONT */
    font-weight: 800;
    letter-spacing: -2px;
    color: var(--color-text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-input-custom {
    font-size: 3.5rem;
    /* SMALLER FONT */
    font-weight: 800;
    color: var(--color-accent);
    background: transparent;
    border: none;
    text-align: center;
    width: 220px;
    outline: none;
    font-family: inherit;
}

.hero-input-custom::placeholder {
    opacity: 0.3;
}

/* HERO KACHEL: HALVED AND CENTERED CSS */
.hero-card {
    width: 50% !important;
    /* Cut in half */
    flex-direction: column !important;
    /* Stack vertically */
    align-items: center !important;
    /* Center horizontally */
    justify-content: flex-start !important;
    /* Top-align so spacer can push controls down */
    gap: 1rem !important;
    /* Even spacing between elements */
    padding: 3rem !important;
}

@media (max-width: 900px) {
    .hero-card {
        width: 100% !important;
        /* Full width on mobile */
        margin-left: 0 !important;
    }
}

.hero-title {
    text-align: center !important;
    margin-bottom: 0 !important;
}

.hero-value-display {
    margin-bottom: 0 !important;
}

/* ==========================================
 *  MODE SWITCH & TOGGLE
 * ========================================== */

/* Hero Toggle */
.mode-switch-group {
    display: inline-flex;
    background: rgba(118, 118, 128, 0.12);
    padding: 2px;
    border-radius: 8px;
    gap: 2px;
    margin-top: 1.5rem;
    border: none;
    align-items: center;
}

.mode-label {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-width: 54px;
}

.mode-label.active {
    background: #FFFFFF;
    color: #000000;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .mode-switch-group {
    background: rgba(118, 118, 128, 0.24);
}

[data-theme="dark"] .mode-label.active {
    background: #636366;
    color: #FFFFFF;
}

.toggle-switch {
    display: none;
}

/* Hide old switch */

/* Mode switch tighter */
.mode-switch-group {
    margin-top: 0 !important;
}

/* ==========================================
 *  ACTION BUTTONS
 * ========================================== */

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    background: var(--color-text-primary);
    /* Invert */
    color: var(--color-bg);
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-action:hover {
    transform: scale(1.05);
    background: var(--color-accent);
    color: white;
}

.btn-action {
    margin-top: auto !important;
    /* Push it and mode switch down to the bottom */
}

/* Copy Mini */
.btn-copy-mini {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(120, 120, 128, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: var(--transition-base);
    z-index: 10;
}

.btn-copy-mini:hover {
    background: var(--color-accent);
    color: white;
}

/* ==========================================
 *  RESULT CARDS
 * ========================================== */

.card-back {
    color: var(--color-blue);
    border-bottom: none !important;
}

.card-lay {
    color: var(--color-accent);
    border-bottom: none !important;
}

.card-liability {
    color: var(--color-danger);
    border-bottom: none !important;
}

.result-label {
    margin-top: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--color-text-primary);
    text-shadow: none;
}

/* ==========================================
 *  PROFIT PILLS & SAVE BUTTONS
 * ========================================== */

.profit-pill {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    /* Ensure no shine */
}

/* CLEAR SHINE */
.profit-pill::before {
    display: none !important;
}

.profit-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.profit-amount {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: none !important;
}

.profit-pill.positive .profit-amount {
    color: var(--color-success) !important;
}

.profit-pill.negative .profit-amount {
    color: var(--color-danger) !important;
}

.btn-save {
    width: 100%;
    background: var(--color-success);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
    transition: transform 0.2s;
}

.profit-pill.negative .btn-save {
    background: var(--color-danger);
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.btn-save:hover {
    background: var(--color-success);
    transform: scale(1.02);
}

.profit-pill.negative .btn-save:hover {
    background: var(--color-danger);
}

/* ==========================================
 *  HISTORY SECTION
 * ========================================== */

.history-section {
    width: 100%;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.history-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-text-primary);
    margin-bottom: 0;
}

.history-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-secondary {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-secondary:hover {
    background: var(--color-border);
    color: var(--color-text-primary);
}

.btn-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid transparent;
}

.btn-danger:hover {
    background: var(--color-danger);
    color: white;
}

/* History Table Form */
.history-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--color-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.history-input-wrapper {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-input-wrapper label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.history-input-wrapper input {
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-primary);
    outline: none;
    font-family: var(--font-main);
}

/* Table */
.history-table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    margin-top: 0;
}

.history-table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    border-bottom: 2px solid var(--color-border);
    letter-spacing: 0;
    font-weight: 700;
}

.history-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-primary);
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}

.history-table tr:hover {
    background: var(--color-bg);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-back {
    background: rgba(0, 122, 255, 0.1);
    color: var(--color-blue);
}

.badge-lay {
    background: rgba(255, 149, 0, 0.1);
    color: var(--color-accent);
}

/* ==========================================
 *  BEE / JAPANESE NOTE
 * ========================================== */

/* Elements Preserved */
.bee-container,
.japanese-note {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    width: 100%;
    height: 100%;
    opacity: 0.8;
    /* Scaling it down slightly to fit the cleaner UI */
    transform: scale(0.9);
    transform-origin: center center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}

.bee-container {
    height: 120px;
    width: 120px;
    cursor: pointer;
}

.japanese-note .japanese-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* SASSY BEE ANIMATION */
.bee-container:hover {
    transform: scale(1.1) rotate(5deg);
}

.bee-face {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bee-container:hover .bee-face {
    opacity: 1;
}

.bee-normal-eye {
    transition: opacity 0.2s;
}

.bee-container:hover .bee-normal-eye {
    opacity: 0;
}

/* ==========================================
 *  ANIMATIONS & KEYFRAMES
 * ========================================== */

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== v0.7 DESIGN ENHANCEMENTS ===== */

/* 1. Pulsing Glow on Boost Quote */
@keyframes boostGlow {

    0%,
    100% {
        text-shadow: 0 0 12px rgba(255, 149, 0, 0.1), 0 0 24px rgba(255, 149, 0, 0.05);
    }

    50% {
        text-shadow: 0 0 18px rgba(255, 149, 0, 0.25), 0 0 36px rgba(255, 149, 0, 0.08);
    }
}

.boost-hero .hero-value-display {
    animation: boostGlow 4s ease-in-out infinite;
}

/* 2. Gradient Result Cards */
.card-back {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.08) 0%, var(--color-surface) 100%) !important;
    border-left: 3px solid rgba(52, 199, 89, 0.5) !important;
}

.card-lay {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08) 0%, var(--color-surface) 100%) !important;
    border-left: 3px solid rgba(0, 122, 255, 0.5) !important;
}

.card-liability {
    background: linear-gradient(135deg, rgba(255, 69, 58, 0.08) 0%, var(--color-surface) 100%) !important;
    border-left: 3px solid rgba(255, 69, 58, 0.5) !important;
}

[data-theme="dark"] .card-back {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.12) 0%, var(--color-surface) 100%) !important;
}

[data-theme="dark"] .card-lay {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.12) 0%, var(--color-surface) 100%) !important;
}

[data-theme="dark"] .card-liability {
    background: linear-gradient(135deg, rgba(255, 69, 58, 0.12) 0%, var(--color-surface) 100%) !important;
}

/* 3. Focused Input Panel Glow */
.panel:focus-within {
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3), 0 8px 32px rgba(0, 0, 0, 0.08) !important;
    transition: box-shadow 0.3s ease;
}

/* 4. Smooth Dark/Light Mode Transition */
*,
*::before,
*::after {
    transition: background-color 0.5s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Exclude elements that shouldn't transition (animations, transforms) */
.toggle-knob,
.ratio-bar-segment,
.animate-pulse {
    transition: none !important;
}

/* 5. Enhanced Bee Hover */
.bee-container {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.bee-container:hover {
    transform: scale(1.15) rotate(-8deg);
}

.bee-container:active {
    transform: scale(0.9) rotate(12deg);
}

.japanese-note:hover .bee-face {
    opacity: 1;
}

.japanese-note .bee-normal-eye {
    transition: opacity 0.3s;
}

.japanese-note:hover .bee-normal-eye {
    opacity: 0;
}

/* 6. Profit Pill Enhancements */
.profit-pill {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    position: relative;
    overflow: hidden;
}

.profit-pill.positive {
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.2) !important;
}

.profit-pill.negative {
    box-shadow: 0 4px 16px rgba(255, 69, 58, 0.2) !important;
}

/* 7. Enhanced Hero Card Hover */
.hero-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.hero-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12) !important;
}

/* 8. Result Card Hover */
.result-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.result-card:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

/* 9. Button hover micro-animation */
.btn-action:hover,
.step-btn:hover {
    transform: scale(1.1) !important;
}

.btn-action:active,
.step-btn:active {
    transform: scale(0.95) !important;
}

/* 10. Copy button success pulse */
@keyframes copySuccess {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(52, 199, 89, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
    }
}

.copy-success-pulse {
    animation: copySuccess 0.6s ease-out;
}

/* 11. Panel subtle border animation */
.panel {
    transition: box-shadow 0.3s ease, border-color 0.3s ease !important;
}

.panel:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}

/* 12. Smooth Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 128, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 128, 0.5);
}

/* 13. Mode Switch enhanced transition */
.mode-switch-group {
    transition: all 0.3s ease !important;
}

.mode-label {
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 14. History section polish */
.history-table-container {
    border-radius: 12px !important;
    overflow: hidden;
}

/* 15. Dark Mode Copy Button Visibility */
[data-theme="dark"] .copy-icon-btn {
    color: rgba(255, 255, 255, 0.7) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px;
    padding: 4px;
}

[data-theme="dark"] .copy-icon-btn:hover {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .copy-icon-btn svg {
    stroke: currentColor !important;
}

[data-theme="dark"] .btn-copy-mini {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

[data-theme="dark"] .btn-copy-mini:hover {
    background: var(--color-accent) !important;
    color: white !important;
}

/* Hero card copy button in dark mode */
[data-theme="dark"] .btn-action#mainCopyBtn {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .btn-action#mainCopyBtn:hover {
    background: var(--color-accent) !important;
    color: white !important;
    border-color: transparent;
}

/* Sidebar panel copy buttons */
[data-theme="dark"] .panel-title .copy-icon-btn,
[data-theme="dark"] .panel .copy-icon-btn {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* ===== v0.8 DESIGN CONSISTENCY OVERHAUL ===== */

/* 1. UNIFIED COLOR SYSTEM - One color per card, everywhere */
/* Remove old gradient left-borders from v0.7 */
.card-back {
    background: var(--color-surface) !important;
    border-left: none !important;
    color: var(--color-blue) !important;
}

.card-lay {
    background: var(--color-surface) !important;
    border-left: none !important;
    color: var(--color-accent) !important;
}

.card-liability {
    background: var(--color-surface) !important;
    border-left: none !important;
    color: var(--color-danger) !important;
}

[data-theme="dark"] .card-back,
[data-theme="dark"] .card-lay,
[data-theme="dark"] .card-liability {
    background: var(--color-surface) !important;
}

/* 5. COLORED DOT INDICATORS instead of thick top bars */
.result-card::before {
    content: '' !important;
    position: absolute !important;
    top: 16px !important;
    left: 16px !important;
    right: auto !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: currentColor !important;
    opacity: 1 !important;
}

.result-label {
    margin-top: 0 !important;
    padding-left: 16px !important;
}

/* 2. UNIFIED PROFIT PILLS */
.profit-pill.positive,
.profit-pill.negative {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06) !important;
}

.profit-pill.positive {
    border-top: 3px solid var(--color-success);
}

.profit-pill.negative {
    border-top: 3px solid var(--color-danger);
}

[data-theme="dark"] .profit-pill.positive,
[data-theme="dark"] .profit-pill.negative {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
}

/* 3. SIDEBAR COLOR ACCENTS */
.panel {
    border-left: 3px solid transparent !important;
}

.sidebar .panel:nth-child(1) {
    /* Bwin Settings - orange accent */
    border-left-color: var(--color-accent) !important;
}

.sidebar .panel:nth-child(2) {
    /* Exchange Back - blue */
    border-left-color: var(--color-blue) !important;
}

.sidebar .panel:nth-child(3) {
    /* Exchange Lay - orange */
    border-left-color: var(--color-accent) !important;
}

/* 4. GLASSMORPHISM HERO CARDS */
.hero-card {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(40px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

[data-theme="dark"] .hero-card {
    background: rgba(44, 44, 46, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* 6. TABULAR NUMS on all numbers */
.result-value,
.profit-amount,
.hero-value-display,
.hero-input-custom,
.form-input,
.stat-value,
.boost-value,
.history-table td {
    font-variant-numeric: tabular-nums !important;
}

/* 7. WETTHISTORIE POLISH */
.history-table tbody tr {
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.history-table tbody tr:nth-child(even) {
    background: rgba(118, 118, 128, 0.04);
}

[data-theme="dark"] .history-table tbody tr:nth-child(even) {
    background: rgba(118, 118, 128, 0.08);
}

.history-table tbody tr:hover {
    background: rgba(0, 122, 255, 0.06) !important;
}

.history-table td {
    padding: 0.85rem 1rem !important;
    font-size: 0.9rem;
}

.history-table th {
    font-size: 0.7rem !important;
    letter-spacing: 0.5px !important;
}

.history-form {
    border: 1px solid var(--color-border) !important;
    border-radius: 14px !important;
}

/* 8. POP EFFECT for profit numbers */
@keyframes numberPop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

.profit-amount.pop-animate {
    animation: numberPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 9. SAVE BUTTON SUCCESS STATE */
@keyframes saveSuccess {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(0.96);
        background: #28a745;
    }

    60% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.btn-save.save-success {
    animation: saveSuccess 0.5s ease;
}

/* BONUS: Cleaner card shadows in light mode */
.result-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

[data-theme="dark"] .result-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}