/* /static/css/style.css
   Manifest + safe enhancements for landing
============================================================================= */

/* 1. Reset */
@import '_reset.css';

/* 2. Variables (Design Tokens) */
/* --- FROM _variables.css --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #4A90E2;
    --primary-darker: #357ABD;
    --primary-light-bg: rgba(74, 144, 226, 0.1);
    --success-color: #2ECC71;
    --success-bg: #E8F5E9;
    --danger-color: #E74C3C;
    --danger-bg: #FDECEA;

    /* === Colors: Light Theme UI Tokens === */
    --text-color: #34495E;
    --text-color-secondary: #7F8C8D;
    --heading-color: #2C3E50;
    --link-color: var(--primary-darker);
    --body-bg: #F8F9FA;
    --component-bg: #FFFFFF;
    --component-bg-alt: #F1F3F5;
    --border-color: #EAECEF;
    --focus-ring-color: rgba(74, 144, 226, 0.25);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 1rem;
    --line-height-base: 1.65;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 600;

    /* === Sizing, Spacing & Borders === */
    --border-radius: 0.6rem;
    --border-radius-lg: 0.8rem;
    --border: 1px solid var(--border-color);

    /* === Shadows & Transitions === */
    --card-shadow: 0 4px 15px rgba(44, 62, 80, 0.05);
    --card-hover-shadow: 0 7px 25px rgba(44, 62, 80, 0.08);
    --transition-duration: 0.3s;
    --transition-easing: cubic-bezier(0.65, 0, 0.35, 1);
}

/* 3. Base */
@import '_base.css';

/* 4. Components */
.card {
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    border-radius: var(--border-radius-lg);
    transition: box-shadow var(--transition-duration) var(--transition-easing),
        transform var(--transition-duration) var(--transition-easing),
        border-color var(--transition-duration) var(--transition-easing);
    background-color: var(--component-bg);
    overflow: hidden;
    position: relative;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
    border-color: rgba(74, 144, 226, 0.4);
}

.card-header {
    background-color: transparent;
    color: var(--heading-color);
    border-color: var(--border-color);
    padding: 1.25rem 1.5rem;
    border-bottom: var(--border);
}

/* ==== PRODUCT ANALYTICS TABLE STYLES ==== */
#product-analytics-table th,
#product-analytics-table td {
    padding: 1rem 1.4rem;
    vertical-align: middle;
}

#product-analytics-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #F8F9FA;
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#product-analytics-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    border-left: 3px solid transparent;
}

#product-analytics-table tbody tr:last-child {
    border-bottom: none;
}

#product-analytics-table tbody tr:hover {
    background-color: #F5F8FF;
    border-left-color: var(--primary-color);
}

.product-table-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.badge-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-trend .fas {
    font-size: 0.7em;
}

.badge-trend.positive {
    background-color: var(--success-bg);
    color: var(--success-color);
}

.badge-trend.negative {
    background-color: var(--danger-bg);
    color: var(--danger-color);
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 140px;
}

.progress-bar-track {
    flex-grow: 1;
    height: 8px;
    background-color: #F0F3F7;
    border-radius: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.4s ease;
}

.progress-bar-container span {
    font-weight: 500;
    font-size: 0.9rem;
    min-width: 45px;
    text-align: left;
}

#product-analytics-table td.text-end,
#product-analytics-table th.text-end {
    text-align: right;
}

.product-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.product-table-header__title {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-color-secondary);
}

.product-table-header__actions {
    display: inline-flex;
    gap: 0.3rem;
}

.header-btn {
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-color-secondary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.header-btn:hover {
    color: var(--heading-color);
    border-color: var(--heading-color);
}

.header-btn.is-active {
    background: var(--primary-light-bg);
    color: var(--primary-color);
    border-color: rgba(74, 144, 226, 0.35);
}

.product-filter-panel {
    position: absolute;
    width: 280px;
    background: #fff;
    border-radius: 0.8rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 18px 45px rgba(20, 28, 58, 0.18);
    padding: 1rem;
    z-index: 2000;
}

.product-filter-panel .form-control {
    border-radius: 0.55rem;
}

.filter-panel__range {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-panel__options {
    max-height: 220px;
    overflow-y: auto;
    margin-top: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    padding: 0.4rem 0.6rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
}

.filter-panel__footer {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ==== END OF PRODUCT TABLE STYLES ==== */


/* ==== OFFCANVAS: COLUMN SETTINGS STYLES ==== */
#columns-offcanvas .offcanvas-body {
    padding: 0;
}

#columns-offcanvas .form-control {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
}

#columns-offcanvas .form-control:focus {
    box-shadow: none;
    border-bottom-color: var(--primary-color);
}

#column-list {
    display: flex;
    flex-direction: column;
}

.column-list-item {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: grab;
    background-color: var(--component-bg);
}

.column-list-item:active {
    cursor: grabbing;
    background: #F5F8FF;
}

.column-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #CFD8DC;
    border-radius: 6px;
    margin-right: 1rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.column-checkbox:hover {
    border-color: var(--primary-color);
}

.column-checkbox:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.column-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.column-label {
    flex-grow: 1;
    margin-bottom: 0;
    font-weight: 500;
    user-select: none;
}

.pin-icon {
    font-size: 1.1rem;
    color: #B0BEC5;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.pin-icon:hover {
    color: var(--heading-color);
    transform: scale(1.1);
}

.pin-icon.active {
    color: var(--heading-color);
}

.column-list-item.is-disabled {
    color: var(--text-color-secondary);
    background-color: #F8F9FA;
    cursor: not-allowed;
}

.column-list-item.is-disabled .column-label {
    cursor: not-allowed;
}

.column-list-item.is-disabled .column-checkbox,
.column-list-item.is-disabled .pin-icon {
    cursor: not-allowed;
    opacity: 0.7;
}

.column-list-item.is-disabled .pin-icon.active {
    color: var(--primary-darker);
}

#columns-offcanvas .offcanvas-footer {
    background-color: #ffffff;
}

#columns-offcanvas .offcanvas-footer .btn {
    width: 100%;
    padding: 0.8rem;
    font-weight: 600;
}

/* ==== END OF OFFCANVAS STYLES ==== */


/* 5. Layout & Pages */
@import '_sidebar.css';
@import '_pages.css';
@import '_responsive.css';