/* ========================================
   Custom Component Extensions for Bulma
   ========================================
   
   This file extends Bulma with project-specific customizations.
   Keep this minimal - prefer Bulma's built-in classes when possible.
*/

/* ========== Design System Variables ========== */
:root {
    /* Colors - softer, lighter palette */
    --color-primary: #7B9DFF;
    --color-primary-hover: #6A8EF5;
    --color-success: #34D399;
    --color-warning: #FBBF24;
    --color-danger: #F87171;
    
    /* Extended neutral colors - lighter tones */
    --color-bg-light: #FAFBFC;
    --color-border-light: #E8EBF0;
    --color-text-primary: #374151;
    --color-text-secondary: #6B7280;
    --color-text-tertiary: #9CA3AF;
    
    /* Spacing extensions (supplement Bulma's spacing) */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    
    /* Shadows - softer */
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-elevated: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ========== Alpine.js Utility ========== */
[x-cloak] {
    display: none !important;
}

/* ========== Card Enhancements ========== */
.box {
    box-shadow: var(--shadow-soft);
    border: 1px solid #EEF1F5;
    background: #FFFFFF;
}

/* Card with full-width grid span */
.box-full {
    grid-column: 1 / -1;
}

/* ========== Button Enhancements ========== */
.button.is-primary {
    background-color: var(--color-primary);
}

.button.is-primary:hover {
    background-color: var(--color-primary-hover);
}

/* Badge-style buttons */
.button.is-badge {
    border-radius: 20px;
    padding-left: 1rem;
    padding-right: 1rem;
    font-size: 0.875rem;
}

/* ========== Progress Bar Styling ========== */
.progress {
    height: 6px;
    border-radius: 10px;
}

.progress::-webkit-progress-bar {
    background-color: #F0F3F7;
}

.progress::-webkit-progress-value {
    background: linear-gradient(90deg, #7B9DFF, #A3BAFF);
    border-radius: 10px;
}

.progress::-moz-progress-bar {
    background: linear-gradient(90deg, #7B9DFF, #A3BAFF);
    border-radius: 10px;
}

/* ========== Tabs Enhancement ========== */
.tabs {
    background: #F5F7FA;
    padding: 4px;
    border-radius: 8px;
    border-bottom: none;
}

.tabs ul {
    border-bottom: none;
}

.tabs li a {
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    border-radius: 6px;
    transition: all 0.2s;
}

.tabs li.is-active a {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 6px rgba(123, 157, 255, 0.2);
}

/* Tab text responsive behavior */
.tab-text-short {
    display: none;
}

@media screen and (max-width: 768px) {
    .tab-text-full {
        display: none;
    }
    .tab-text-short {
        display: inline;
    }
}

/* ========== Input Enhancements ========== */
.input[readonly].is-family-monospace {
    background-color: var(--color-bg-light);
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    word-break: break-all;
}

.input[readonly]:not(.is-family-monospace) {
    background-color: var(--color-bg-light);
}

/* Ensure inputs in has-addons fields align with buttons */
.field.has-addons .control .input {
    height: 2.5em;
}

.field.has-addons .control .button {
    height: 2.5em;
}

/* ========== Info Display Components ========== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.info-label {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.info-value {
    font-weight: 500;
    font-size: 0.875rem;
}

/* ========== Stat Display ========== */
.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.stat-value {
    color: var(--color-primary);
    font-weight: 600;
}

/* ========== Invite/Rebate Components ========== */
.rebate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.rebate-user {
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rebate-user .icon {
    color: var(--color-primary);
    font-size: 0.375rem;
}

.rebate-amount {
    color: var(--color-success);
    font-weight: 600;
    white-space: nowrap;
}

/* ========== Chart Container ========== */
.chart-wrapper {
    height: 80px;
    position: relative;
}

/* ========== Dashboard Grid Layout ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media screen and (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ========== Modal Enhancements ========== */
.modal-card {
    max-width: 400px;
}

.modal .modal-background {
    backdrop-filter: blur(4px);
}

.qr-wrapper {
    display: inline-block;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ========== Utility Classes ========== */
.has-text-primary-custom {
    color: var(--color-primary) !important;
}

.has-text-muted {
    color: var(--color-text-secondary) !important;
}

.has-text-light {
    color: var(--color-text-tertiary) !important;
}

.has-border-light {
    border: 1px solid var(--color-border-light);
}

.has-background-light-custom {
    background-color: var(--color-bg-light) !important;
}

/* Monospace text for code/links */
.is-family-monospace {
    font-family: 'Courier New', monospace;
}

/* ========== Responsive Spacing ========== */
@media screen and (max-width: 768px) {
    .box {
        padding: 1rem;
    }
    
    .section {
        padding: 1.5rem 1rem;
    }
}

