/*
 * CSS for Neginfoolad Price Importer Pro Plugin v35.1
 */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;700&display=swap');

/* General Container */
.npi-container-v25 {
    font-family: 'Vazirmatn', sans-serif;
    width: 100%;
    margin: 20px auto;
}

/* Card Styles - DARK THEME */
.npi-factory-card {
    border: 1px solid #444;
    border-radius: 8px;
    margin-bottom: 25px;
    background-color: #000000;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    color: #ffffff;
}

.npi-card-header {
    padding: 15px 20px;
    background-color: #1a1a1a;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.npi-header-title-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.npi-factory-logo {
    height: 40px;
    width: auto;
    border-radius: 5px;
    background-color: #fff;
    padding: 2px;
}

.npi-header-title-section h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.npi-header-actions {
    display: flex;
    gap: 10px;
}

.npi-action-btn {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Vazirmatn', sans-serif;
}
.npi-action-btn:hover {
    background-color: #444;
}
.npi-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.npi-card-subheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333333;
    padding: 10px 20px;
    border-bottom: 1px solid #444;
}

.npi-card-subheader h2 {
    font-size: 1rem;
    font-weight: 500;
    color: #f0f0f0;
    margin: 0;
}

.npi-date-info {
    font-size: 0.85rem;
    color: #cccccc;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- DESKTOP TABLE STYLES (DARK) --- */
.npi-desktop-table {
    display: block;
}
.npi-table-header {
    display: flex;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.85rem;
    padding: 0 10px;
    border-bottom: 2px solid #444;
    background-color: #333333;
}
.npi-table-body {
    max-height: 400px;
    overflow-y: auto;
}
.npi-table-row {
    display: flex;
    border-bottom: 1px solid #444;
}
.npi-table-row:nth-child(even) {
    background-color: #1a1a1a;
}
.npi-table-row:hover {
    background-color: #555555;
}
.npi-table-row:last-child {
    border-bottom: none;
}
.npi-table-cell {
    padding: 12px 10px;
    text-align: center;
    flex: 1 1 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #ffffff;
}

/* --- MOBILE ACCORDION STYLES (DARK) --- */
.npi-mobile-accordion {
    display: none;
}
.npi-mobile-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.85rem;
    border-bottom: 2px solid #444;
    background-color: #333333;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 2;
}
.npi-mobile-item {
    border-bottom: 1px solid #444;
}
.npi-mobile-item:nth-child(even) .npi-item-summary {
    background-color: #1a1a1a;
}
.npi-item-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
}
.npi-summary-cell {
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
    color: #ffffff;
}
.npi-summary-cell:first-child {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 10px;
}
.npi-mobile-chevron {
    color: #ccc;
    transition: transform 0.25s ease-in-out;
}
.npi-mobile-chevron.fa-chevron-down {
    transform: rotate(-90deg);
}
.npi-item-details {
    display: none;
    padding: 10px 20px;
    background-color: #1a1a1a;
}
.npi-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px dotted #555;
}
.npi-detail-row:last-child {
    border-bottom: none;
}
.npi-detail-row span {
    color: #ffffff;
}
.npi-detail-row span:first-child {
    font-weight: 500;
    color: #ccc;
}

/* --- SHARED STYLES (DARK) --- */
.npi-price {
    font-weight: 700;
    color: #4caf50;
}
.npi-fluctuation-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.npi-fluctuation-neutral span { color: #f0f0f0; }
.npi-fluctuation-up { color: #28a745; }
.npi-fluctuation-down { color: #dc3545; }
.npi-chart-btn {
    background: none; border: none; color: #ccc; cursor: pointer; padding: 0 5px; font-size: 1.1rem;
}
.npi-chart-btn:hover { color: #fff; }


/* == RESPONSIVE MEDIA QUERY == */
@media screen and (max-width: 768px) {
    .npi-desktop-table {
        display: none;
    }
    .npi-mobile-accordion {
        display: block;
    }
    .npi-list-container {
        max-height: 450px;
        overflow-y: auto;
    }
}


/* == MODAL STYLES (Shared) == */
.npi-modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); align-items: center; justify-content: center; }
.npi-modal-content { background-color: #fefefe; margin: auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 700px; border-radius: 8px; box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); }
.npi-modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px; }
.npi-modal-header h2 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.npi-close-btn { color: #aaa; float: left; font-size: 28px; font-weight: bold; cursor: pointer; }
.npi-close-btn:hover, .npi-close-btn:focus { color: black; text-decoration: none; }
.npi-chart-filters { margin-bottom: 15px; text-align: center; }
.npi-chart-filter-btn { padding: 8px 16px; border: 1px solid #ccc; background-color: #f8f9fa; cursor: pointer; margin: 0 5px; border-radius: 5px; font-family: 'Vazirmatn', sans-serif; }
.npi-chart-filter-btn.active { background-color: #007bff; color: white; border-color: #007bff; }
.npi-chart-container { position: relative; height: 400px; }
.npi-chart-loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 5px solid #f3f3f3; border-top: 5px solid #3498db; border-radius: 50%; width: 50px; height: 50px; animation: npi-spin 1s linear infinite; display: none; }
@keyframes npi-spin { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }

/* --- PRINT HEADER STYLES --- */
.npi-print-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #000;
    margin-bottom: 20px;
}
.npi-print-header-col {
    flex: 1;
}
.npi-print-header-center {
    text-align: center;
}
.npi-print-header-right {
    text-align: left;
    font-size: 0.9rem;
}
.npi-print-header-right div {
    margin-bottom: 5px;
}
.npi-print-logo {
    max-width: 150px;
    height: auto;
}
