/* ============================================
   grade-selector.css - تمام استایل‌های اختصاصی
   ============================================ */

/* ==================== تنظیمات پایه ==================== */
.adv-settings {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(107, 219, 60, 0.2);
}

.adv-header {
    cursor: pointer;
    color: #6bdb3c;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
}

.adv-content {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.adv-content.show {
    display: block;
}

.conf-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.conf-group {
    flex: 1;
    min-width: 100px;
}

.conf-group label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
}

.conf-group input {
    width: 100%;
    padding: 0.4rem;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(107, 219, 60, 0.3);
    border-radius: 6px;
    color: white;
}

details summary {
    cursor: pointer;
    color: #6bdb3c;
    font-size: 0.8rem;
}

.breakdown-table {
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.breakdown-table th,
.breakdown-table td {
    padding: 0.4rem;
    text-align: right;
}

/* ==================== فرم و ردیف‌ها ==================== */
.property-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.8rem;
    border-radius: 10px;
}

.property-row > div {
    flex: 1;
    min-width: 120px;
}

.property-row select,
.property-row input {
    width: 100%;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(107, 219, 60, 0.3);
    border-radius: 8px;
    color: white;
}

.remove-row {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 5px;
}

.remove-row:hover {
    background: #cc0000;
}

.btn-secondary {
    background: rgba(107, 219, 60, 0.2);
    border: 1px solid #6bdb3c;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: #6bdb3c;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(107, 219, 60, 0.4);
}

.btn-submit {
    background: linear-gradient(135deg, #6bdb3c, #4a9e2a);
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-submit:hover {
    transform: scale(1.02);
}

.btn-watch {
    background: rgba(107, 219, 60, 0.2);
    border: 1px solid #6bdb3c;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    color: #6bdb3c;
    cursor: pointer;
    font-size: 1rem;
}

.btn-watch:hover {
    background: rgba(107, 219, 60, 0.4);
}

/* ==================== تنظیمات جستجو ==================== */
.setting-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.setting-group {
    flex: 1;
    min-width: 150px;
}

.setting-group label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

.setting-group select,
.setting-group input {
    width: 100%;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(107, 219, 60, 0.3);
    border-radius: 8px;
    color: white;
}

.setting-group select:focus,
.setting-group input:focus {
    outline: none;
    border-color: #6bdb3c;
}

/* ==================== جدول نتایج ==================== */
.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 0.8rem;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-table th {
    color: #6bdb3c;
}

.score-high {
    color: #6bdb3c;
    font-weight: bold;
}

.score-medium {
    color: #ffc107;
    font-weight: bold;
}

.score-low {
    color: #ff6b6b;
    font-weight: bold;
}

/* ==================== کارت‌ها ==================== */
.form-card {
    background: rgba(20, 30, 45, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(107, 219, 60, 0.2);
}

.video-card {
    background: rgba(20, 30, 45, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(107, 219, 60, 0.2);
}

.video-title {
    color: #6bdb3c;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.video-description {
    color: rgba(255, 255, 255, 0.7);
    margin: 1rem 0;
}

/* ==================== تب‌ها ==================== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: #aaa;
    font-size: 1rem;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #6bdb3c;
}

.tab-btn.active {
    color: #000000 !important;
    background: #6bdb3c !important;
    border-radius: 8px;
    font-weight: bold;
}

.tabs-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==================== زیرابزارها ==================== */
.sub-tabs-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 2px;
    flex-wrap: wrap;
}

.sub-tab-btn {
    background: transparent;
    border: none;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    color: #aaa;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    position: relative;
}

.sub-tab-btn:hover {
    color: #6bdb3c;
    background: rgba(107, 219, 60, 0.08);
}

.sub-tab-btn.active {
    color: #1a1a2e !important;
    background: #6bdb3c !important;
    font-weight: bold;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(107, 219, 60, 0.3);
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* ==================== ابزارهای تکمیلی ==================== */
.tools-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(107, 219, 60, 0.3);
}

/* ==================== دکمه‌های اختصاصی ==================== */
.btn-reset {
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid #ff4444;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    color: #ff4444;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-reset:hover {
    background: rgba(255, 68, 68, 0.4);
}

.btn-datasheet {
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid #3498db;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    color: #3498db;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    white-space: nowrap;
}

.btn-datasheet:hover {
    background: rgba(52, 152, 219, 0.4);
}

.btn-datasheet-link {
    color: #6bdb3c;
    text-decoration: none;
    border: 1px solid rgba(107, 219, 60, 0.3);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-block;
    transition: all 0.2s;
}

.btn-datasheet-link:hover {
    background: rgba(107, 219, 60, 0.15);
    border-color: #6bdb3c;
    text-decoration: none;
    color: #6bdb3c;
}

/* ==================== Multi-Select Dropdown ==================== */
.multi-select-container {
    position: relative;
    width: 100%;
    margin-bottom: 5px;
}

.multi-select-btn {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(107, 219, 60, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.multi-select-btn:hover {
    border-color: #6bdb3c;
}

.multi-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(107, 219, 60, 0.3);
    border-radius: 8px;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.multi-select-dropdown.open {
    display: block;
}

.multi-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #e0e0e0;
}

.multi-select-item:hover {
    background: rgba(107, 219, 60, 0.1);
}

.multi-select-item input[type="checkbox"] {
    cursor: pointer;
    accent-color: #6bdb3c;
}

.multi-select-item label {
    cursor: pointer;
    flex: 1;
    color: #e0e0e0;
}

.multi-select-selected-count {
    font-size: 0.7rem;
    color: #6bdb3c;
    background: rgba(107, 219, 60, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
}

/* ============================================
   استایل‌های بخش مقایسه گرید (هماهنگ با استایل کلی)
   ============================================ */

/* ===== کانتینر اصلی ===== */
.compare-container {
    background: rgba(20, 30, 45, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(107, 219, 60, 0.2);
    margin-top: 20px;
}

/* ===== هدر شباهت ===== */
.compare-header {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid rgba(107, 219, 60, 0.1);
}

.compare-header h2 {
    margin: 0;
    font-size: 1rem;
    color: #aaa;
    font-weight: 400;
}

.compare-header .score {
    font-size: 3.2rem;
    font-weight: 700;
    margin: 6px 0 2px;
}

.compare-header .score.high {
    color: #6bdb3c;
}

.compare-header .score.medium {
    color: #ffc107;
}

.compare-header .score.low {
    color: #ff6b6b;
}

.compare-header .label {
    font-size: 0.8rem;
    color: #888;
}

/* ===== دو کارت گرید ===== */
.compare-grades {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.grade-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 18px 20px;
    border: 1px solid rgba(107, 219, 60, 0.15);
    transition: all 0.3s ease;
}

.grade-card:hover {
    border-color: rgba(107, 219, 60, 0.3);
}

.grade-card.grade-a {
    border-right: 3px solid #6bdb3c;
}

.grade-card.grade-b {
    border-right: 3px solid #ffc107;
}

.grade-card .grade-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.grade-card .grade-name.a {
    color: #6bdb3c;
}

.grade-card .grade-name.b {
    color: #ffc107;
}

.grade-card .grade-meta {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.8;
}

.grade-card .grade-meta .label {
    color: #888;
}

.grade-card .grade-meta .value {
    color: #e0e0e0;
}

.grade-card .datasheet-link {
    display: inline-block;
    margin-top: 6px;
    color: #6bdb3c;
    text-decoration: none;
    font-size: 0.8rem;
    border: 1px solid rgba(107, 219, 60, 0.25);
    padding: 4px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    background: rgba(107, 219, 60, 0.05);
}

.grade-card .datasheet-link:hover {
    background: rgba(107, 219, 60, 0.15);
}

/* ===== ویژگی‌های هر گرید ===== */
.grade-properties {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(107, 219, 60, 0.1);
}

.grade-properties .props-title {
    font-size: 0.7rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.grade-properties .prop-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.grade-properties .prop-item .prop-name {
    color: #888;
}

.grade-properties .prop-item .prop-value {
    color: #e0e0e0;
    font-weight: 500;
}

/* ===== توصیه ===== */
.compare-recommendation {
    text-align: center;
    padding: 12px 16px;
    background: rgba(107, 219, 60, 0.06);
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    border: 1px solid rgba(107, 219, 60, 0.08);
    color: #ccc;
}

.compare-recommendation strong {
    color: #6bdb3c;
}

/* ===== جدول تفاوت‌ها ===== */
.diff-details {
    margin-top: 12px;
}

.diff-details summary {
    cursor: pointer;
    color: #6bdb3c;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 0;
}

.diff-details summary:hover {
    color: #8ae85e;
}

.diff-table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.diff-table thead {
    background: rgba(107, 219, 60, 0.06);
}

.diff-table th {
    padding: 10px 14px;
    text-align: right;
    border-bottom: 2px solid rgba(107, 219, 60, 0.1);
    color: #aaa;
    font-weight: 600;
    font-size: 0.8rem;
}

.diff-table td {
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #ccc;
}

.diff-table tr:last-child td {
    border-bottom: none;
}

.diff-table .diff-highlight {
    color: #ff6b6b;
    font-weight: 700;
}

.diff-table .diff-medium {
    color: #ffc107;
    font-weight: 600;
}

.diff-table .grade-a-col {
    color: #6bdb3c;
    font-weight: 500;
}

.diff-table .grade-b-col {
    color: #ffc107;
    font-weight: 500;
}

.diff-table .prop-name-col {
    color: #888;
}

/* ===== واکنش‌گرایی ===== */
@media (max-width: 768px) {
    .compare-grades {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .compare-header .score {
        font-size: 2.6rem;
    }

    .grade-card {
        padding: 14px 16px;
    }

    .diff-table {
        font-size: 0.75rem;
    }

    .diff-table th,
    .diff-table td {
        padding: 6px 10px;
    }
}

/* ============================================
   یوتیلیتی‌ها
   ============================================ */
.text-success {
    color: #6bdb3c;
}

.text-center {
    text-align: center;
}

.text-danger {
    color: #ff6b6b;
}

.text-warning {
    color: #ffc107;
}

.text-muted {
    color: rgba(255, 255, 255, 0.5);
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}
