/* ----------------------- */
/* استایل‌های پایه و گلوبال */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazir', system-ui, sans-serif;
    text-decoration: none;
}

body {
    background-color: #0a0a0a;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(76, 175, 80, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(33, 150, 243, 0.1) 0%, transparent 50%);
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* کانتینر اصلی – (توجه: در HTML به صورت کلاس container استفاده شده) */
.container {
    width: 100%;
    max-width: 1200px;
    /* در اینجا از Flex استفاده می‌کنیم تا بتوانیم بخش کارت‌ها (grid) و صفحه‌بندی را جدا کنیم */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ----------------------- */
/* گرید کارت‌ها (داخل کانتینر جدا با کلاس cards-container) */
.cards-container {
    width: 100%;
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ----------------------- */
/* استایل‌های کارت (عمومی) */
.card {
    background: rgba(20, 20, 20, 0.4);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 0 32px rgba(255, 255, 255, 0.05);
    position: relative;
    padding: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 0 32px rgba(255, 255, 255, 0.08);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    z-index: 1;
    pointer-events: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.location {
    display: flex;
    align-items: center;
    gap: 12px;
}

.location-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.location-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: bold;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

.status.active {
    color: #2ca560;
    border: 1px solid rgba(46, 139, 87, 0.3);
    background: rgba(47, 149, 91, 0.15);
    box-shadow: 0 2px 6px rgba(46, 139, 87, 0.2);
}

.status.inactive {
    color: #B22222;
    border: 1px solid rgba(178, 34, 34, 0.3);
    background: rgba(178, 34, 34, 0.15);
    box-shadow: 0 2px 6px rgba(178, 34, 34, 0.2);
}

/* ----------------------- */
/* استایل‌های بخش DNS */
.dns-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    font-weight: 500;
}

.dns-entry {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 12px;
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    direction: ltr;
    white-space: normal;
    word-wrap: break-word;
    word-break: break-all;
    gap: 10px;
}

.dns-entry>span {
    flex: 1;
}

.dns-entry:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.dns-entry.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
}

.copy-button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 8px;
    flex-shrink: 0;
}

.copy-button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.copy-button i {
    font-size: 1.2em;
}

/* ----------------------- */
/* استایل‌های کارت وایرگارد */
.wireguard-card select {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 12px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wireguard-card select:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.wireguard-card select:focus {
    outline: none;
    border-color: rgba(33, 150, 243, 0.5);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.download-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #0D47A1, #1565C0);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.download-btn:hover {
    background: linear-gradient(45deg, #1565C0, #1976D2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

/* ----------------------- */
/* استایل پیام Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(21, 101, 192, 0.9);
    padding: 12px 24px;
    border-radius: 12px;
    display: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ----------------------- */
/* استایل‌های صفحه‌بندی */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    direction: rtl;
}

.nav-button {
    width: 40px;
    height: 40px;
    background: rgba(30, 30, 30, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-button:not(:disabled):hover {
    background: rgba(50, 50, 50, 0.7);
    transform: translateY(-2px);
}

.pagination-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-number {
    min-width: 35px;
    height: 35px;
    padding: 0;
    background: rgba(30, 30, 30, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.page-number.active {
    background: linear-gradient(45deg, #0D47A1, #1565C0);
    border: none;
    transform: scale(1.1);
}

.page-number:not(.active):hover {
    background: rgba(50, 50, 50, 0.7);
    transform: translateY(-2px);
}

.page-dots {
    color: white;
    font-weight: bold;
    padding: 0 2px;
}

/* ----------------------- */
/* استایل‌های اختصاصی برای کارت IP Checker */
.ip-checker-card {
    margin-bottom: 20px;
    background: rgba(20, 20, 20, 0.4);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 20px;
    overflow: hidden;
}

.ip-input-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.ip-input {
    flex: 1;
    height: 45px;
    padding: 0 15px;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 14px;
    direction: ltr;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.check-btn {
    height: 45px;
    padding: 0 25px;
    background: linear-gradient(45deg, #0D47A1, #1565C0);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
}

.check-btn:hover {
    background: linear-gradient(45deg, #1565C0, #1976D2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.ip-result {
    background: rgba(30, 30, 30, 0.6);
    border-radius: 12px;
    padding: 15px;
    color: white;
    text-align: left;
    line-height: 1.6;
    word-break: break-word;
}

.ip-info {
    border-radius: 8px;
    padding: 15px;
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap;
    direction: rtl;
}

.info-label {
    font-weight: 500;
    min-width: 120px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    text-align: right;
    flex: 1;
}

.info-value {
    color: rgba(255, 255, 255, 0.8);
    flex: 2;
    text-align: left;
    word-break: break-word;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    padding: 15px;
}

.error-message {
    color: #ff4d4d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(220, 53, 69, 0.1);
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
}
