/* ==========================================================================
   خرید مستقیم سکه - استایل کامل
   ========================================================================== */

body.coin-purchase-loaded {
    position: relative;
}

/* Container اصلی */
.coin-main-container {
	background-color: #F8F8F8;
	border-radius: 24px;
    padding: 30px;
}

/* Header Section */
.coin-header-section {
    margin-bottom: 20px;
}

/*.coin-header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
}*/

.coin-main-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

/* پیام خطا */
.coin-error-message {
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    margin: 30px 0;
    color: white;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
}

.coin-error-message::before {
    content: '⚠️';
    font-size: 4rem;
    position: absolute;
    top: 20px;
    right: 30px;
    opacity: 0.2;
}

.coin-error-message h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.coin-error-message p {
    font-size: 1.2rem;
    line-height: 1.8;
    margin: 15px 0;
    position: relative;
    z-index: 1;
    opacity: 0.95;
}

/* Table Section */
.coin-table-section {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.coin-table-responsive {
    overflow-x: auto;
    padding: 10px 20px;
}

.coin-rates-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.coin-main-container table caption+thead tr:first-child td,.coin-main-container table caption+thead tr:first-child th,.coin-main-container table colgroup+thead tr:first-child td,.coin-main-container table colgroup+thead tr:first-child th,.coin-main-container table thead:first-child tr:first-child td,.coin-main-container table thead:first-child tr:first-child th {
    border-block-start: 0;
}

.coin-rates-table th {
    color: #B3B5B9;
    padding: 5px;
    text-align: center;
    font-weight: 400;
    font-size: 1.1rem;
    border: none;
    position: relative;
}



.coin-rates-table tbody tr {
    border-bottom: 1px solid #f1f3f5;
}
.coin-rates-table thead tr {
    border-bottom: 1px solid #f1f3f5;
}
.coin-rates-table tbody tr:last-child{
	border: 0 !important
}

.coin-rates-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}
.coin-main-container table{
	margin: 0 !important;
}

.coin-rates-table td {
    padding: 10px 5px 5px;
    text-align: center;
    font-size: 16px;
	border: 0 !important;
    vertical-align: middle;
	background-color: #fff !important;
}
.coin-action-section{
	margin-top:20px;
}
/* ستون قیمت‌ها */
.price-buy, .price-sell {
    font-weight: 600;
}

.price-buy {
    color: #5FD080;
}

.price-sell {
    color: #FE6165;
}

/* ستون عملیات */
.coin-action {
    min-width: 120px;
}

.coin-main-btn {
    background: #A63747 !important;
    color: white !important;
    border: none !important;
    padding: 12px !important;
	width:100% !important;
    border-radius: 24px !important;
    cursor: pointer;
}

.coin-main-btn:disabled {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: 0 5px 15px rgba(189, 195, 199, 0.3) !important;
}

.coin-note {
    margin-top: 25px;
    color: #636e72;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* پاپ‌آپ (Modal) */
.coin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: coin-fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes coin-fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

.coin-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.coin-modal-content {
    position: relative;
    background: #ffffff;
    margin: 50px auto;
    width: 90%;
    max-width: 1100px;
    border-radius: 24px;
    animation: coin-slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes coin-slideIn {
    from {
        opacity: 0;
        transform: translateY(-60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.coin-modal-header {
    background: #A63747;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.coin-modal-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.coin-modal-close {
	background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    color: white !important;
    font-size: 25px !important;
    cursor: pointer !important;
    line-height: 38px;
    padding: 0 !important;
    width: 35px !important;
    font-weight: 300 !important;
    height: 35px !important;
    border-radius: 50% !important;
}


.coin-modal-body {
    padding: 35px;
    overflow-y: auto;
    flex-grow: 1;
}

/* فرم داخل پاپ‌آپ */
.coin-form {
    animation: coin-formFadeIn 0.6s ease 0.2s both;
}

@keyframes coin-formFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coin-form .form-row {
    margin-bottom: 30px;
}

.coin-form .form-row label {
    display: block;
    font-weight: 700;
    color: #2c3e50;
}

.coin-select, .coin-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
    background: white;
}

.coin-select option {
    padding: 15px;
    font-size: 1rem;
}

/* کنترل تعداد */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.qty-btn {
    background: #a53848 !important;
    border: none !important;
    color: white !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 1.5rem !important;
}

.coin-input {
    text-align: center;
    flex: 1;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid #4a69bd;
	height: 48px;
	-moz-font-feature-settings: "ss02", "ss03";
    -webkit-font-feature-settings: "ss02", "ss03";
    font-feature-settings: "ss02", "ss03";
}

.coin-form .form-row small {
    display: block;
    margin-top: 10px;
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* نمایش قیمت */
.price-display {
    background: #F8F8F8;
    padding: 30px;
    border-radius: 16px;
    margin: 35px 0;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 18px;
}

.price-item:last-child {
    margin-bottom: 0;
}

.price-item span {
    color: #2d3436;
    font-weight: 600;
}

.total-price {
    color: #A63747;
    font-size: 1.5rem;
    font-weight: 800;
}

.coin-submit:disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-text, .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: coin-spin 0.8s linear infinite;
}

@keyframes coin-spin {
    to { transform: rotate(360deg); }
}

/* پیام‌ها */
.coin-message {
    margin-top: 25px;
    text-align: center;
    animation: coin-messageSlide 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes coin-messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coin-error {
    background: #FE6165;
    color: white;
    border: none;
	border-radius: 16px;
	padding: 10px;
}

.coin-success {
    background: #5FD080;
    color: white;
    border: none;
	border-radius: 16px;
	padding: 10px;
}

.coin-warning {
    background: #fdcb6e;
    color: #2d3436;
    border: none;
	border-radius: 16px;
	padding: 10px;
}

/* انیمیشن‌های اضافی */
@keyframes coin-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.coin-loading {
    animation: coin-pulse 1.5s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .coin-main-container {
        max-width: 95%;
    }
}

@media (max-width: 992px) {
    .coin-main-title {
        font-size: 2.3rem;
    }
    
    .coin-date-time {
        font-size: 1.1rem;
        padding: 10px 25px;
    }
    
    .coin-table-section {
        border-radius: 15px;
    }
}

@media (max-width: 768px) {
    .coin-main-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .coin-header-section {
        padding: 25px 20px;
        margin-bottom: 30px;
        border-radius: 15px;
    }
    
    .coin-main-title {
        font-size: 1.8rem;
    }
    
    .coin-date-time {
        font-size: 1rem;
        padding: 8px 20px;
    }
    
    .coin-rates-table {
        min-width: 700px;
    }
    
    .coin-rates-table th,
    .coin-rates-table td {
        padding: 18px 10px;
        font-size: 0.95rem;
    }
    
    .price-buy, .price-sell {
        padding: 10px 15px;
        min-width: 120px;
        font-size: 1rem;
    }
    
    
    .coin-action-section {
        padding: 30px 20px;
    }
    
    .coin-main-btn {
        padding: 18px 40px;
        font-size: 1.2rem;
    }
    
    .coin-note {
        font-size: 1rem;
    }
    
    .coin-modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .coin-modal-header {
        padding: 20px;
    }
    
    .coin-modal-header h3 {
        font-size: 1.5rem;
    }
    
    .coin-modal-body {
        padding: 25px;
    }
    
    .coin-form .form-row label {
        font-size: 1rem;
    }
    
    .coin-select, .coin-input {
        padding: 14px 16px;
        font-size: 1rem;
    }
    
    .quantity-control {
        max-width: 180px;
    }
    
    .qty-btn {
        width: 40px;
        height: 40px;
    }
    
    .price-display {
        padding: 25px;
    }
    
    .price-item {
        font-size: 1.1rem;
    }
    
    .total-price {
        font-size: 1.5rem;
    }
    
    .coin-submit {
        padding: 20px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .coin-header-section {
        padding: 20px 15px;
    }
    
    .coin-main-title {
        font-size: 1.6rem;
    }
    
    .coin-error-message {
        padding: 25px 20px;
    }
    
    .coin-error-message h3 {
        font-size: 1.5rem;
    }
    
    .coin-error-message p {
        font-size: 1rem;
    }
    
    .coin-rates-table {
        min-width: 600px;
    }
    
    .coin-main-btn {
        padding: 16px 30px;
        font-size: 1.1rem;
        width: 100%;
        justify-content: center;
    }
    
    .coin-modal-header {
        padding: 18px;
    }
    
    .coin-modal-header h3 {
        font-size: 1.3rem;
    }
    
    .coin-modal-close {
        width: 38px;
        height: 38px;
        font-size: 1.8rem;
    }
    
    .coin-modal-body {
        padding: 20px;
    }
    
    .coin-form .form-row {
        margin-bottom: 25px;
    }
    
    .quantity-control {
        max-width: 100%;
    }
    
    .price-display {
        padding: 20px;
    }
    
    .coin-submit {
        padding: 18px;
        font-size: 1.1rem;
    }
}

/* Print Styles */
@media print {
    .coin-main-btn,
    .coin-modal,
    .coin-action-section {
        display: none !important;
    }
    
    .coin-main-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .coin-table-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .price-buy, .price-sell {
        box-shadow: none;
        border: 1px solid #ddd;
        color: #000;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .coin-header-section,
    .coin-error-message,
    .coin-rates-table thead,
    .price-buy,
    .price-sell,
    .coin-main-btn,
    .coin-modal-header,
    .coin-submit,
    .qty-btn {
        border: 2px solid #000;
    }
    
    .coin-modal-content {
        border: 3px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}



/* ==========================================================================
   استایل‌های جدید برای کارت‌های انتخابی سکه
   ========================================================================== */

/* استایل‌های عمومی فرم */
.form-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
}

.form-hint {
    display: block;
    margin-top: 8px;
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* گرید انتخاب سکه */
.coin-selection-grid {
    display: flex;
	flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .coin-selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .coin-selection-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* کارت‌های انتخاب سکه */
.coin-option-wrapper {
    position: relative;
	flex-grow: 1;
}

.coin-option-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.coin-option-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.coin-option-card:hover {
    border-color: #A63747;
    transform: translateY(-2px);
}

.coin-option-input:checked + .coin-option-card {
    border-color: #a53848;
    background: #a5384810;
}

/* آیکون سکه */
.coin-option-icon {
    font-size: 2.5rem;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f6e58d 0%, #ffbe76 100%);
    border-radius: 12px;
    flex-shrink: 0;
}

.coin-option-input:checked + .coin-option-card .coin-option-icon {
    background: linear-gradient(135deg, #A63747 0%, #2ecc71 100%);
    color: white;
}

/* محتوای کارت */
.coin-option-content {
    flex: 1;
    text-align: center;
	display: flex;
    flex-direction: column;
    align-items: center;
}

.coin-option-name {
    color: #2c3e50;
    margin-bottom: 8px;
}

.coin-option-input:checked + .coin-option-card .coin-option-name {
    color: #A63747;
}

.coin-option-price {
    color: #A63747;
    direction: ltr;
}

/* تیک انتخاب */
.coin-option-check {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.coin-option-check svg {
    width: 14px;
    height: 14px;
    color: #A63747;
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    transition: stroke-dashoffset 0.3s ease;
}

.coin-option-input:checked + .coin-option-card .coin-option-check {
    opacity: 1;
    border-color: #A63747;
    background: #A63747;
}

.coin-option-input:checked + .coin-option-card .coin-option-check svg {
    stroke-dashoffset: 0;
    color: white;
}

/* انیمیشن برای کارت انتخاب شده */
@keyframes coin-option-pulse {
    0% {
        box-shadow: 0 0 0 0 rgb(165 56 72 / 40%);
    }
    70% {
        box-shadow: 0 0 0 10px rgb(165 56 72 / 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgb(165 56 72 / 0);
    }
}

.coin-option-input:checked + .coin-option-card {
    animation: coin-option-pulse 0.6s ease;
}

/* کنترل تعداد */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coin-input {
    text-align: center;
    flex: 1;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid #4a69bd;
    padding: 12px;
    border-radius: 8px;
    background: white;
}

/* دکمه ارسال */
.form-submit {
    margin-top: 30px;
}

.coin-submit {
    width: 100% !important;
    padding: 20px !important;
    background: #A63747 !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
	border-radius: 16px !important;
}

.coin-submit:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}