/* ArzPaya USDT Profit Calculator Plugin Styles */

.usdt-staking-calculator,
.staking-calculator[data-instance*="usdt"] {
    font-family: IRANSansX, IRANSansWeb, sans-serif;
    direction: rtl;
    text-align: right;
    margin-top: 20px;
}

.staking-calculator h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 15px;
    text-align: center;
}

.p-margin-top {
    margin-top: 20px;
    line-height: 1.6;
    color: #555;
    text-align: center;
}

.calculator-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-family: IRANSansX, IRANSansWeb, sans-serif;
    font-size: 14px;
}

/* Input Section - Similar to Trade Plugin */
.input-section {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px;
    background: transparent;
    transition: border-color 0.3s ease;
}

.input-section:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.amount-input-container {
    flex: 1;
}

.amount-input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    padding: 8px 16px;
    text-align: right;
    color: #374151;
    font-family: IRANSansX, IRANSansWeb, sans-serif;
    direction: ltr;
}

.amount-input::placeholder {
    color: #9ca3af;
    font-size: 12px;
}

/* Currency Selector - Similar to Trade Plugin */
.currency-selector {
    flex-shrink: 0;
    border-right: 1px solid #d1d5db;
    padding-right: 12px;
    margin-right: auto;
    position: relative;
}

.currency-display {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.currency-display:hover {
    background-color: #f3f4f6;
}

.currency-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.currency-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.currency-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-transform: uppercase;
}

.dropdown-arrow {
    font-size: 10px;
    color: #6b7280;
    transition: transform 0.2s ease;
    margin-right: 4px;
}

.currency-selector.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Currency Dropdown */
.currency-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: -10px;
    width: 150px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 4px;
}

.currency-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.currency-option:last-child {
    border-bottom: none;
}

.currency-option:hover {
    background-color: #f9fafb;
}

.currency-option:first-child {
    border-radius: 8px 8px 0 0;
}

.currency-option:last-child {
    border-radius: 0 0 8px 8px;
}

.currency-option .currency-icon {
    width: 20px;
    height: 20px;
}

.currency-text {
    font-size: 14px;
    color: #374151;
    font-weight: 400;
}

/* Months Select Styling - Similar to Currency Selector */
.select-wrapper {
    position: relative;
    border-radius: 8px;
}

.months-select {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    padding: 8px 40px 8px 16px;
    text-align: right;
    color: #374151;
    font-family: IRANSansX, IRANSansWeb, sans-serif;
    direction: rtl;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    border-radius: 8px;
}

.months-select::-ms-expand {
    display: none;
}

/* Custom dropdown arrow for select */
.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #6b7280;
    pointer-events: none;
    transition: transform 0.2s ease;
    z-index: 1;
}

.select-wrapper.open::after,
.select-wrapper:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
}

.months-select:focus {
    outline: none;
}

/* Style select options */
.months-select option {
    padding: 12px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-family: IRANSansX, IRANSansWeb, sans-serif;
}

.months-select option:hover {
    background-color: #f9fafb;
}

[id^="calculateBtn"] {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 20px;
    font-family: IRANSansX, IRANSansWeb, sans-serif;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

[id^="calculateBtn"]:hover:not(:disabled) {
    transform: translateY(-2px);
}

[id^="calculateBtn"]:disabled {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.5) 100%);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

[id^="resultContainer"] {
    display: block;
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #667eea;
    opacity: 1;
    transform: translateY(0);
    position: relative;
    min-height: 200px;
}

.calculator-error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 200px;
    color: #dc2626;
    font-size: 18px;
    font-weight: 500;
    font-family: IRANSansX, IRANSansWeb, sans-serif;
    text-align: center;
    direction: rtl;
}

[id^="resultContainer"] h3 {
    margin-top: 0;
    color: #667eea;
    font-size: 20px;
    text-align: center;
    margin-bottom: 8px;
}

.results-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    flex: 1;
    margin-bottom: 8px;
}

.result-item strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    font-family: IRANSansX, IRANSansWeb, sans-serif;
}

.result-item input[type="text"] {
    font-family: IRANSansX, IRANSansWeb, sans-serif;
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    direction: ltr;
    text-align: right;
    background: #f8f9fa;
    box-sizing: border-box;
}

.result-value {
    font-family: IRANSansX, IRANSansWeb, sans-serif;
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    color: #3b82f6;
    direction: ltr;
    text-align: right;
    background: #e6f5ff;
    box-sizing: border-box;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}

.info-section {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
}

.info-section .result-item {
    margin-bottom: 0;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.info-section .result-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-section .result-item strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
    font-family: IRANSansX, IRANSansWeb, sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-align: right;
}

.info-content {
    font-family: IRANSansX, IRANSansWeb, sans-serif;
    font-size: 14px;
    color: #666;
    text-align: right;
    margin-top: 4px;
    direction: ltr;
    position: relative;
    min-height: 20px;
}

.number-highlight {
    color: #16a34a;
    font-weight: 600;
}

/* Skeleton Loading Styles */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-result-value {
    height: 40px;
    width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.skeleton-info-content {
    height: 20px;
    width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 4px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.skeleton-info-content.wide {
    width: 100%;
}

/* Dark theme skeleton styles */
[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2a3441 25%, #1a2332 50%, #2a3441 75%);
    background-size: 200% 100%;
}

/* Auto dark theme skeleton support */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .skeleton {
        background: linear-gradient(90deg, #2a3441 25%, #1a2332 50%, #2a3441 75%);
        background-size: 200% 100%;
    }
}

/* Responsive calculator styles */
@media (max-width: 900px) {
    .calculator-container {
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .calculator-container {
        padding: 16px;
        margin: 16px 0;
    }

    .input-group {
        margin-bottom: 16px;
    }

    .input-group label {
        font-size: 13px;
    }

    .amount-input {
        font-size: 14px;
        padding: 6px 12px;
    }

    .months-select {
        font-size: 14px;
        padding: 6px 36px 6px 12px;
    }

    .select-wrapper::after {
        font-size: 9px;
        right: 12px;
    }

    .currency-name {
        font-size: 13px;
    }

    .currency-icon {
        width: 20px;
        height: 20px;
    }

    [id^="calculateBtn"] {
        height: 36px;
        font-size: 14px;
        padding: 0 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    [id^="resultContainer"] h3 {
        font-size: 18px;
    }

    .result-item input[type="text"] {
        font-size: 16px;
        padding: 10px;
    }

    .result-value {
        font-size: 16px;
        padding: 8px;
        min-height: 36px;
    }

    .staking-calculator-results {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .results-row {
        gap: 15px !important;
    }
}

/* Dark Theme Support */
[data-theme="dark"] .staking-calculator h2 {
    color: var(--text-primary, #FFFFFF);
}

[data-theme="dark"] .p-margin-top {
    color: var(--text-body, #FFFFFF);
}

[data-theme="dark"] .calculator-container {
    background: var(--card-bg, #1a2332);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    box-shadow: var(--shadow-card, 0 4px 12px rgba(0, 0, 0, 0.25));
}

[data-theme="dark"] .input-group label {
    color: var(--text-primary, #FFFFFF);
}

[data-theme="dark"] .input-section {
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    background: var(--card-bg, #1a2332);
}

[data-theme="dark"] .input-section:focus-within {
    border-color: var(--accent-primary, #3D72FE);
    box-shadow: 0 0 0 1px var(--accent-primary, #3D72FE);
}

[data-theme="dark"] .amount-input {
    background: transparent;
    color: var(--text-body, #FFFFFF);
}

[data-theme="dark"] .amount-input::placeholder {
    color: var(--text-secondary, rgba(255, 255, 255, 0.85));
    font-size: 12px;
}

[data-theme="dark"] .currency-selector {
    border-right: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] .currency-display:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .currency-icon {
    background: var(--border-color, rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] .currency-name {
    color: var(--text-body, #FFFFFF);
}

[data-theme="dark"] .dropdown-arrow {
    color: var(--text-secondary, rgba(255, 255, 255, 0.85));
}

[data-theme="dark"] .currency-dropdown {
    background: var(--card-bg, #1a2332);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    box-shadow: var(--shadow-card, 0 4px 12px rgba(0, 0, 0, 0.25));
}

[data-theme="dark"] .currency-option {
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] .currency-option:hover {
    background-color: rgba(61, 114, 254, 0.1);
}

[data-theme="dark"] .currency-text {
    color: var(--text-body, #FFFFFF);
}

[data-theme="dark"] .months-select {
    background: transparent;
    color: var(--text-body, #FFFFFF);
}

[data-theme="dark"] .months-select option {
    background: var(--card-bg, #1a2332);
    color: var(--text-body, #FFFFFF);
}

[data-theme="dark"] .months-select option:hover {
    background-color: rgba(61, 114, 254, 0.1);
}

[data-theme="dark"] .select-wrapper::after {
    color: var(--text-secondary, rgba(255, 255, 255, 0.85));
}

[data-theme="dark"] [id^="resultContainer"] {
    background: var(--card-bg, #1a2332);
    border: 2px solid #667eea;
}

[data-theme="dark"] .calculator-error-message {
    color: #ef4444;
}

[data-theme="dark"] .result-item strong {
    color: var(--text-primary, #FFFFFF);
}

[data-theme="dark"] .result-item input[type="text"] {
    background: var(--input-bg, #2a3441);
    border: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
    color: #667eea;
}

[data-theme="dark"] .result-value {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

[data-theme="dark"] .info-section {
    color: var(--text-body, #FFFFFF);
}

[data-theme="dark"] .info-section .result-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .info-section .result-item:last-child {
    border-bottom: none;
}

[data-theme="dark"] .info-section .result-item strong {
    color: var(--text-primary, #FFFFFF);
}

[data-theme="dark"] .info-content {
    color: var(--text-body, #FFFFFF);
}

[data-theme="dark"] .number-highlight {
    color: #16a34a;
    font-weight: 600;
}

[data-theme="dark"] [id^="calculateBtn"]:disabled {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* Auto dark theme support based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .staking-calculator h2 {
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .p-margin-top {
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .calculator-container {
        background: #1a2332;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }
    
    :root:not([data-theme="light"]) .input-group label {
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .input-section {
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: #1a2332;
    }
    
    :root:not([data-theme="light"]) .input-section:focus-within {
        border-color: #3D72FE;
        box-shadow: 0 0 0 1px #3D72FE;
    }
    
    :root:not([data-theme="light"]) .amount-input {
        background: transparent;
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .amount-input::placeholder {
        color: rgba(255, 255, 255, 0.85);
        font-size: 12px;
    }
    
    :root:not([data-theme="light"]) .currency-selector {
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    :root:not([data-theme="light"]) .currency-display:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    :root:not([data-theme="light"]) .currency-icon {
        background: rgba(255, 255, 255, 0.1);
    }
    
    :root:not([data-theme="light"]) .currency-name {
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .dropdown-arrow {
        color: rgba(255, 255, 255, 0.85);
    }
    
    :root:not([data-theme="light"]) .currency-dropdown {
        background: #1a2332;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }
    
    :root:not([data-theme="light"]) .currency-option {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    :root:not([data-theme="light"]) .currency-option:hover {
        background-color: rgba(61, 114, 254, 0.1);
    }
    
    :root:not([data-theme="light"]) .currency-text {
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) [id^="resultContainer"] {
        background: #1a2332;
        border: 2px solid #667eea;
    }
    
    :root:not([data-theme="light"]) .calculator-error-message {
        color: #ef4444;
    }
    
    :root:not([data-theme="light"]) .result-item strong {
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .result-item input[type="text"] {
        background: #2a3441;
        border: 2px solid rgba(255, 255, 255, 0.1);
        color: #667eea;
    }
    
    :root:not([data-theme="light"]) .result-value {
        background: rgba(59, 130, 246, 0.15);
        color: #60a5fa;
    }
    
    :root:not([data-theme="light"]) .info-section {
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .info-section .result-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    :root:not([data-theme="light"]) .info-section .result-item:last-child {
        border-bottom: none;
    }
    
    :root:not([data-theme="light"]) .info-section .result-item strong {
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .info-content {
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .number-highlight {
        color: #16a34a;
        font-weight: 600;
    }
    
    :root:not([data-theme="light"]) [id^="calculateBtn"]:disabled {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
        cursor: not-allowed;
        opacity: 0.6;
        transform: none;
    }
    
    :root:not([data-theme="light"]) .months-select {
        background: transparent;
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .months-select option {
        background: #1a2332;
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .months-select option:hover {
        background-color: rgba(61, 114, 254, 0.1);
    }
    
    :root:not([data-theme="light"]) .select-wrapper::after {
        color: rgba(255, 255, 255, 0.85);
    }
}

