﻿/* ============================================ */
/* استایل‌های اصلی */
/* ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 12px;
    overflow-x: hidden;
    max-width: 100%;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    padding: 16px;
}

/* ============================================ */
/* مجموعه‌ها */
/* ============================================ */
.collections-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 100%;
    margin: 0 auto;
}

.collection-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef2f7;
    border-right: 4px solid #0b4f8a;
    transition: all 0.25s ease;
    cursor: pointer;
    user-select: none;
}

    .collection-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        border-color: #d0d9e8;
    }

    /* رنگ‌های متمایز برای هر مجموعه */
    .collection-card:nth-child(1) {
        border-right-color: #0b4f8a;
    }

    .collection-card:nth-child(2) {
        border-right-color: #e67e22;
    }

    .collection-card:nth-child(3) {
        border-right-color: #27ae60;
    }

    .collection-card:nth-child(4) {
        border-right-color: #8e44ad;
    }

    .collection-card:nth-child(5) {
        border-right-color: #e74c3c;
    }

    .collection-card:nth-child(6) {
        border-right-color: #2c3e50;
    }

    .collection-card:nth-child(7) {
        border-right-color: #16a085;
    }

    .collection-card:nth-child(8) {
        border-right-color: #2980b9;
    }

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collection-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a2b4a;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================ */
/* ✅ تعداد دامنه‌ها: بزرگ، مشکی، بدون رنگ آبی */
/* ============================================ */
.collection-badge {
    display: inline-block;
    background: #e9ecef !important;
    color: #2c3e50 !important;
    padding: 2px 14px !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border: 1px solid #d5d9e0 !important;
    white-space: nowrap;
}

.collection-description {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    padding-bottom: 2px;
}

.collection-toggle {
    color: #0b4f8a;
    font-size: 12px;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

    .collection-toggle .arrow {
        transition: transform 0.3s ease;
        display: inline-block;
        font-size: 12px;
        color: #888;
    }

        .collection-toggle .arrow.open {
            transform: rotate(180deg);
        }

/* ============================================ */
/* ✅ آیکون فولدر با انیمیشن */
/* ============================================ */
.collection-card .folder-icon {
    transition: all 0.3s ease;
    display: inline-block;
    font-size: 18px;
}

.collection-card.open .folder-icon {
    transform: scale(1.1);
}

/* ============================================ */
/* دامنه‌ها */
/* ============================================ */
.domains-container {
    margin-top: 8px;
    border-top: 1px solid #eef2f7;
    padding-top: 8px;
    display: none;
    background: #f7f9fc;
    border-radius: 0 0 8px 8px;
    margin: 8px -16px -12px -16px;
    padding: 8px 16px 12px 16px;
}

    .domains-container.open {
        display: block;
    }

.domain-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #eef2f7;
    margin-bottom: 4px;
    transition: all 0.15s;
    gap: 8px;
    flex-wrap: wrap;
}

    .domain-item:hover {
        background: #f5f8ff;
        border-color: #d0d9e8;
    }

.domain-info {
    flex: 1;
    min-width: 120px;
}

.domain-name {
    font-weight: 600;
    color: #1a2b4a;
    font-size: 13px;
}

.domain-contact {
    font-size: 11px;
    color: #aaa;
    margin-right: 6px;
}

.domain-url {
    font-size: 11px;
    color: #0b4f8a;
    direction: ltr;
    text-align: left;
    word-break: break-all;
    margin-top: 1px;
}

    .domain-url a {
        color: #0b4f8a;
        text-decoration: none;
    }

        .domain-url a:hover {
            text-decoration: underline;
        }

    .domain-url.email-link a {
        color: #6c757d;
        font-weight: 500;
    }

    .domain-url.email-link::before {
        content: "📧 ";
    }

.domain-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.domain-status {
    font-size: 10px;
    padding: 1px 10px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.status-active {
    background: #e6f4ea;
    color: #1e7e34;
}

.status-inactive {
    background: #fce8e6;
    color: #c62828;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.empty-domains {
    text-align: center;
    color: #bbb;
    font-size: 12px;
    padding: 6px 0;
}

/* ============================================ */
/* ✅ دکمه‌های اکشن - اصلاح شده */
/* ============================================ */
.btn-action {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    background: transparent;
    color: #555;
    border: 1px solid transparent;
    position: relative;
}

    .btn-action:hover {
        background: #e9ecef;
        transform: scale(1.02);
    }

    .btn-action:active {
        transform: scale(0.95);
    }

.btn-share-action {
    color: #1a73e8;
}

    .btn-share-action:hover {
        background: #e8f0fe;
        border-color: #d2e3fc;
    }

.btn-copy-action {
    color: #1e7e34;
}

    .btn-copy-action:hover {
        background: #e6f4ea;
        border-color: #ceead6;
    }

.btn-action[title]:hover::after {
    content: attr(title);
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    margin-top: 22px;
    z-index: 10;
}

/* ============================================ */
/* ✅ دسکتاپ: فقط آیکون، بدون نوشته فارسی */
/* ============================================ */
@media (min-width: 601px) {
    .btn-action .btn-icon {
        display: inline-flex;
    }

    .btn-action .btn-text {
        display: none !important;
    }

    .btn-action {
        padding: 4px 8px;
        font-size: 18px;
        background: transparent;
        border: none;
        min-width: 36px;
        min-height: 36px;
    }

        .btn-action:hover {
            background: #e9ecef;
            border-color: transparent;
        }
}

/* ============================================ */
/* ✅ موبایل: فقط نوشته فارسی، بدون آیکون */
/* ============================================ */
@media (max-width: 600px) {
    .btn-action .btn-icon {
        display: none !important;
    }

    .btn-action .btn-text {
        display: inline-flex !important;
    }

    .btn-action {
        padding: 6px 14px;
        font-size: 13px;
        background: #f1f3f4;
        border: 1px solid #ddd;
        border-radius: 6px;
        min-width: 70px;
        justify-content: center;
    }

    .btn-share-action {
        background: #e8f0fe;
        border-color: #d2e3fc;
    }

    .btn-copy-action {
        background: #e6f4ea;
        border-color: #ceead6;
    }

    .btn-action:hover {
        transform: none;
    }
}

/* ============================================ */
/* استایل نمایش ایمیل */
/* ============================================ */
.domain-url.email-link a {
    color: #6c757d;
    font-weight: 500;
    direction: ltr;
}

.domain-url.email-link::before {
    content: "📧 ";
    color: #6c757d;
}

/* ============================================ */
/* جلوگیری از انتخاب متن هنگام کلیک */
/* ============================================ */
.collection-card {
    user-select: none;
}

/* ============================================ */
/* خطاها */
/* ============================================ */
.error-message {
    background: #fce8e6;
    color: #c62828;
    padding: 10px 16px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-right: 4px solid #c62828;
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #888;
}

    .empty-state .icon {
        font-size: 40px;
        margin-bottom: 8px;
    }

    .empty-state h3 {
        font-size: 16px;
        color: #555;
        margin-bottom: 4px;
    }

    .empty-state p {
        font-size: 13px;
    }

/* ============================================ */
/* فوتر */
/* ============================================ */
.footer {
    text-align: center;
    padding: 12px 0 4px 0;
    color: #bbb;
    border-top: 1px solid #e9ecef;
    margin-top: 10px;
    font-size: 10px;
}

/* ============================================ */
/* Media Queries - ریسپانسیو */
/* ============================================ */

@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 10px;
        border-radius: 8px;
    }

    .collections-grid {
        gap: 8px;
    }

    .collection-card {
        padding: 10px 12px;
    }

    .collection-title {
        font-size: 14px;
    }

    .collection-badge {
        font-size: 12px !important;
        padding: 1px 10px !important;
    }

    .collection-description {
        font-size: 11px;
    }

    .domain-item {
        padding: 4px 8px;
        flex-direction: column;
        align-items: stretch;
    }

    .domain-actions {
        justify-content: flex-start;
        margin-top: 2px;
        flex-wrap: wrap;
    }

    .domain-name {
        font-size: 12px;
    }

    .domain-contact {
        font-size: 10px;
    }

    .domain-url {
        font-size: 10px;
    }

    .domain-status {
        font-size: 9px;
        padding: 1px 8px;
    }

    .domains-container {
        margin: 6px -10px -10px -10px;
        padding: 6px 10px 10px 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 4px;
    }

    .container {
        padding: 6px;
        border-radius: 6px;
    }

    .collection-card {
        padding: 8px 10px;
        border-radius: 6px;
    }

    .collection-title {
        font-size: 13px;
    }

    .collection-badge {
        font-size: 11px !important;
        padding: 1px 8px !important;
    }

    .domain-item {
        padding: 4px 6px;
    }

    .domains-container {
        margin: 4px -6px -8px -6px;
        padding: 4px 6px 8px 6px;
    }
}
