/**
 * Tony Fintech Core - Frontend Refund Styles (Pro Max UI - v4.1)
 * Updated to support Disabled State
 */

/* =============================================
   CSS Variables
   ============================================= */
:root {
    --tony-primary: #1a365d;
    --tony-primary-light: #2c5282;
    --tony-gradient-1: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
    --tony-gradient-gold: linear-gradient(135deg, #d69e2e 0%, #b7791f 100%);
    --tony-gradient-danger: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    --tony-gradient-success: linear-gradient(135deg, #68d391 0%, #48bb78 100%);
    --tony-glass-bg: rgba(255, 255, 255, 0.95);
    --tony-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --tony-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --tony-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --tony-text: #2d3748;
    --tony-text-muted: #718096;
    --tony-border: #e2e8f0;
}

/* =============================================
   Container
   ============================================= */
.tony-refund-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px 0 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    color: var(--tony-text);
    line-height: 1.6;
}

/* Utility: Hidden class for form fields visibility toggle */
.tony-refund-container .hidden,
.tony-form-fields-wrapper.hidden {
    display: none !important;
}

/* =============================================
   Header
   ============================================= */
.tony-refund-header {
    margin-bottom: 30px !important;
    position: relative;
    padding-left: 15px;
    border-left: 4px solid var(--tony-primary-light);
}

.tony-refund-header h2 {
    margin: 0 0 5px 0 !important;
    font-size: 26px !important;
    font-weight: 800 !important;
    color: var(--tony-text) !important;
    letter-spacing: -0.5px;
    background: var(--tony-gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tony-refund-subtitle {
    margin: 0 !important;
    font-size: 15px !important;
    color: var(--tony-text-muted);
    font-weight: 500;
}

/* =============================================
   Empty State Banner (Active Notification)
   ============================================= */
.tony-empty-state-banner {
    display: flex !important;
    align-items: center !important;
    background: #ebf8ff !important;
    border: 1px solid #bee3f8 !important;
    padding: 20px !important;
    border-radius: 12px !important;
    margin-bottom: 25px !important;
    gap: 15px !important;
}

.banner-icon {
    width: 40px;
    height: 40px;
    background: #3182ce;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.banner-content {
    flex: 1;
}

.banner-content strong {
    display: block;
    color: #2c5282;
    margin-bottom: 4px;
}

.banner-content p {
    margin: 0 !important;
    font-size: 14px;
    color: #4a5568;
}

.banner-action {
    background: white;
    color: #3182ce;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid #bee3f8;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.banner-action:hover {
    background: #edf2f7;
    transform: translateY(-1px);
}

/* =============================================
   Status Cards
   ============================================= */
.tony-status-card {
    padding: 40px 30px !important;
    border-radius: 16px !important;
    text-align: center !important;
    margin-bottom: 30px !important;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--tony-shadow-lg) !important;
}

.status-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--tony-shadow-md);
}

.tony-status-icon {
    font-size: 36px !important;
}

.tony-status-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    margin-bottom: 10px !important;
    display: block !important;
}

/* Pending State */
.tony-status-pending {
    background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%) !important;
    border: 1px solid #bee3f8 !important;
}

.tony-status-pending .tony-status-icon {
    color: #3182ce;
}

.tony-status-pending .tony-status-title {
    color: #2c5282;
}

/* Completed State */
.tony-status-completed {
    background: linear-gradient(135deg, #f0fff4 0%, #dcffe4 100%) !important;
    border: 1px solid #9ae6b4 !important;
}

.tony-status-completed .tony-status-icon {
    color: #38a169;
}

.tony-status-completed .tony-status-title {
    color: #276749;
}

/* =============================================
   Wallet Summary Grid (2 cards side by side)
   ============================================= */
.tony-wallet-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .tony-wallet-summary-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.tony-wallet-summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: linear-gradient(135deg, #1A365D 0%, #2B4C7E 100%) !important;
    color: white !important;
    padding: 20px 24px !important;
    border-radius: 14px !important;
    margin-bottom: 0 !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 8px 20px -5px rgba(26, 54, 93, 0.35) !important;
}

.tony-wallet-summary.tony-wallet-bonus {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%) !important;
    box-shadow: 0 8px 20px -5px rgba(128, 90, 213, 0.35) !important;
}

.tony-wallet-summary::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.tony-wallet-label {
    font-size: 11px !important;
    opacity: 0.85 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    margin-bottom: 4px !important;
}

.tony-wallet-amount {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
}

@media (min-width: 769px) {
    .tony-wallet-amount {
        font-size: 28px !important;
    }
}

.wallet-icon-bg {
    font-size: 32px !important;
    opacity: 0.15 !important;
    transform: rotate(-10deg) !important;
}

/* =============================================
   Form Styles
   ============================================= */
.tony-refund-form-card {
    background: white !important;
    border-radius: 16px !important;
    padding: 40px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid var(--tony-border) !important;
    transition: opacity 0.3s ease;
}

/* Disabled State Overlay Effect */
.tony-refund-form-card.tony-form-disabled {
    opacity: 0.8;
    background: #fafbfc !important;
}

.tony-form-row {
    margin-bottom: 24px !important;
}

.tony-form-row label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: var(--tony-text) !important;
}

.tony-input,
.tony-select,
.tony-textarea {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    background: #fcfcfc !important;
    color: #2d3748 !important;
    box-sizing: border-box !important;
}

.tony-input:disabled,
.tony-select:disabled,
.tony-textarea:disabled {
    background-color: #f7fafc !important;
    color: #a0aec0 !important;
    cursor: not-allowed !important;
    border-color: #edf2f7 !important;
}

.tony-input:focus {
    border-color: #3182ce !important;
    outline: none !important;
}

.tony-input-group {
    position: relative !important;
}

.tony-input-suffix {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-weight: 600 !important;
    color: #a0aec0 !important;
}

.tony-submit-btn {
    width: 100% !important;
    background: var(--tony-gradient-1) !important;
    color: white !important;
    border: none !important;
    padding: 16px !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
}

.tony-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(26, 54, 93, 0.3) !important;
}

/* Animations */
@media (max-width: 768px) {
    .tony-refund-form-card {
        padding: 20px !important;
    }

    .tony-wallet-summary {
        padding: 20px !important;
    }

    .tony-wallet-amount {
        font-size: 24px !important;
    }
}

/* =============================================
   Tabs Navigation (Pro Max)
   ============================================= */
.tony-tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 12px;
}

.tony-tab-item {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tony-tab-item:hover {
    color: var(--tony-primary);
    background: rgba(255, 255, 255, 0.5);
}

.tony-tab-item.active {
    background: white;
    color: var(--tony-primary);
    border-color: #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tony-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tony-tab-content.active {
    display: block;
}

/* =============================================
   Percentage Options Grid
   ============================================= */
.tony-amount-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.tony-amount-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.tony-amount-option:hover {
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

.tony-amount-option.selected {
    border-color: #3182ce;
    background: #ebf8ff;
    color: #2b6cb0;
    box-shadow: 0 4px 6px rgba(49, 130, 206, 0.1);
}

.tony-amount-option .option-percent {
    display: block;
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 4px;
}

.tony-amount-option .option-label {
    font-size: 11px;
    color: #718096;
    text-transform: uppercase;
    font-weight: 600;
}

.tony-amount-option.selected .option-label {
    color: #4299e1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

@media (max-width: 768px) {
    .tony-amount-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================
   Other Bank Input (Hidden by Default)
   Must use .tony-form parent for specificity to override profile.css
   ============================================= */
.tony-form .tony-bank-other-input {
    display: none !important;
    margin-top: 10px !important;
}

.tony-form .tony-bank-other-input.is-visible {
    display: block !important;
}

/* =============================================
   2-Column Form Layout (Desktop/Tablet)
   ============================================= */
@media (min-width: 769px) {
    .tony-refund-form-card {
        padding: 30px !important;
    }

    .tony-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px 24px;
    }

    /* Full width items */
    .tony-tabs-nav,
    .tony-tab-content,
    .tony-form-actions,
    .tony-policy-row,
    .tony-bank-row,
    .tony-bank-other-row,
    .tony-shared-fields-top,
    .tony-shared-fields-bottom,
    #refund-message {
        grid-column: 1 / -1;
    }

    /* Info boxes span full width */
    .tony-info-box {
        grid-column: 1 / -1;
    }

    .tony-form-row {
        margin-bottom: 0 !important;
    }

    /* Reason textarea spans full width */
    .tony-form-row:has(#refund_reason) {
        grid-column: 1 / -1;
    }
}

/* =============================================
   Shared Fields Wrappers (Top: Phone + Course, Bottom: Bank + Reason)
   ============================================= */
.tony-shared-fields-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 769px) {
    .tony-shared-fields-top {
        grid-template-columns: 1fr 1fr;
        gap: 16px 24px;
    }

    .tony-shared-fields-top .tony-form-row {
        margin-bottom: 0 !important;
    }
}

.tony-shared-fields-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 769px) {
    .tony-shared-fields-bottom {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tony-shared-fields-bottom .tony-form-row {
        margin-bottom: 0 !important;
    }

    /* Reason textarea full width */
    .tony-shared-fields-bottom .tony-form-row:has(#refund_reason) {
        grid-column: 1 / -1;
    }
}

/* =============================================
   Bank Row - 3 Columns on Desktop
   ============================================= */
.tony-bank-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 769px) {
    .tony-bank-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
    }

    .tony-bank-row .tony-form-row {
        margin-bottom: 0 !important;
    }
}

.tony-bank-other-row {
    display: none;
}

.tony-bank-other-row.is-visible {
    display: block;
}

/* =============================================
   Policy Checkbox Styling
   ============================================= */
.tony-policy-row {
    margin-bottom: 16px !important;
}

.tony-checkbox-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    color: #4a5568 !important;
    line-height: 1.5 !important;
    padding: 12px 16px !important;
    background: #f7fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    transition: all 0.2s !important;
}

.tony-checkbox-label:hover {
    background: #edf2f7 !important;
    border-color: #cbd5e0 !important;
}

.tony-checkbox-label input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    accent-color: #3182ce !important;
    cursor: pointer !important;
}

.tony-checkbox-label .policy-text {
    flex: 1 !important;
}

/* =============================================
   Compact Form Actions
   ============================================= */
.tony-form-actions {
    display: flex !important;
    justify-content: center !important;
    padding-top: 8px !important;
}

.tony-submit-btn {
    max-width: 300px !important;
}

/* =============================================
   Compact Info Boxes
   ============================================= */
@media (min-width: 769px) {
    .tony-info-box {
        padding: 16px !important;
    }

    .tony-info-box p {
        margin-bottom: 6px !important;
    }
}