/**
 * Public styles for TAV Customer Discount Codes
 */

/* فونت فارسی */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir.eot');
    src: url('../fonts/Vazir.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Vazir.woff2') format('woff2'),
         url('../fonts/Vazir.woff') format('woff'),
         url('../fonts/Vazir.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* استایل کلی */
.tav-discount-codes-container {
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    direction: inherit;
    text-align: inherit;
    padding: 25px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.tav-discount-codes-container h2 {
    color: #2271b1;
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f1;
    display: flex;
    align-items: center;
}

.tav-discount-codes-container h2:before {
    margin-left: 10px;
}

.tav-discount-description {
    margin-bottom: 25px;
    color: #333;
    line-height: 1.6;
}

.tav-discount-restriction {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-right: 4px solid #2271b1;
    margin-top: 15px;
    font-size: 14px;
    color: #555;
}

/* دکمه دریافت کد */
.tav-create-discount-code {
    margin: 25px 0;
}

.tav-create-discount-code .button {
    background-color: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.tav-create-discount-code .button:hover {
    background-color: #135e96;
}

.tav-create-discount-code .button:before {
    margin-left: 8px;
}

/* اسپینر */
.tav-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: tav-spin 1s linear infinite;
}

@keyframes tav-spin {
    to {
        transform: rotate(360deg);
    }
}

/* نمایش کد تخفیف */
.tav-discount-code-result {
    margin: 25px 0;
}

.tav-discount-code-box {
    background-color: #f0f7fc;
    border: 1px solid #c5d9ed;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
}

.tav-discount-code-box h3 {
    color: #2271b1;
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tav-discount-code-box h3:before {
    margin-left: 8px;
}

.tav-code-display {
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tav-code-display span {
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-family: monospace;
    font-size: 16px;
    color: #2271b1;
    margin-left: 10px;
    font-weight: bold;
    letter-spacing: 1px;
}

.tav-code-display .button {
    background-color: #f6f7f7;
    color: #2c3338;
    border: 1px solid #ddd;
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.tav-code-display .button:hover {
    background-color: #e5e5e5;
}

.tav-code-display .button:before {
    margin-left: 8px;
}

.tav-expiry-date, .tav-user-restriction {
    color: #666;
    font-size: 14px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tav-expiry-date:before, .tav-user-restriction:before {
    margin-left: 8px;
}

/* پیام خطا */
.tav-error-message {
    background-color: #f9e2e2;
    color: #dc3232;
    padding: 15px;
    border-radius: 4px;
    border-right: 4px solid #dc3232;
    margin: 15px 0;
    font-weight: 600;
}

/* لیست کدهای تخفیف */
.tav-discount-codes-list-title {
    color: #2271b1;
    font-size: 20px;
    margin: 30px 0 15px;
    display: flex;
    align-items: center;
}

.tav-discount-codes-list-title:before {
    margin-left: 8px;
}

.tav-no-codes {
    color: #666;
    font-style: italic;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.tav-no-codes:before {
    margin-left: 8px;
}

/* جدول کدهای تخفیف */
.tav-discount-codes-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.tav-discount-codes-table th {
    background-color: #f8f9fa;
    color: #23282d;
    text-align: inherit;
    padding: 12px 15px;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.tav-discount-codes-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.tav-discount-codes-table tr:hover {
    background-color: #f9f9f9;
}

.tav-discount-codes-table code {
    background-color: #f6f7f7;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: #2271b1;
}

/* وضعیت کدهای تخفیف */
.tav-status-active {
    color: #46b450;
    font-weight: 600;
    background-color: rgba(70, 180, 80, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
}

.tav-status-expired {
    color: #dc3232;
    font-weight: 600;
    background-color: rgba(220, 50, 50, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
}

/* پیام محدودیت */
.tav-limit-reached-message {
    background-color: #fcf8e3;
    color: #8a6d3b;
    padding: 15px;
    border-radius: 4px;
    border-right: 4px solid #f0ad4e;
    margin: 15px 0;
}

.tav-limit-reached-message p {
    margin: 0;
    display: flex;
    align-items: center;
}

.tav-limit-reached-message p:before {
    margin-left: 8px;
}

/* پاسخگویی */
@media screen and (max-width: 768px) {
    .tav-discount-codes-table {
        display: block;
        overflow-x: auto;
    }
    
    .tav-code-display {
        flex-direction: column;
    }
    
    .tav-code-display span {
        margin: 0 0 10px 0;
        width: 100%;
    }
}

/* RTL support */
html[dir="rtl"] .tav-discount-codes-table th,
html[dir="rtl"] .tav-discount-codes-table td {
    text-align: right;
}

html[dir="rtl"] #tav-code-value {
    margin-right: 0;
    margin-left: 15px;
} 