/**
 * Transaction Modal Styles
 * Glassmorphism design consistent with La Tanda dashboard
 * Version: 1.0.0
 */

/* ================================
   MODAL OVERLAY
   ================================ */

.transaction-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transaction-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.transaction-modal-overlay.hidden {
    display: none;
}

/* ================================
   MODAL CONTAINER
   ================================ */

.transaction-modal {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(24px);
    border: 2px solid rgba(0, 255, 255, 0.2);
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(0, 255, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transaction-modal-overlay.active .transaction-modal {
    transform: scale(1) translateY(0);
}

/* Custom scrollbar */
.transaction-modal::-webkit-scrollbar {
    width: 8px;
}

.transaction-modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.transaction-modal::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 10px;
}

.transaction-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}

/* ================================
   MODAL HEADER
   ================================ */

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 20px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.modal-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--tanda-cyan), #7FFFD8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.modal-title i {
    -webkit-text-fill-color: var(--tanda-cyan);
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
    transform: rotate(90deg);
}

/* ================================
   TABS
   ================================ */

.modal-tabs {
    display: flex;
    padding: 20px 24px 0 24px;
    gap: 12px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 255, 255, 0.3);
}

.tab-btn.active {
    background: rgba(0, 255, 255, 0.15);
    border-color: var(--tanda-cyan);
    color: var(--tanda-cyan);
}

.tab-btn i {
    font-size: 1.1rem;
}

/* ================================
   TAB CONTENT
   ================================ */

.tab-content {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   FORM ELEMENTS
   ================================ */

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.label-required {
    color: #ef4444;
    margin-left: 4px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Space Mono', monospace;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--tanda-cyan);
    box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

.form-input.valid {
    border-color: #10b981;
}

.form-input::placeholder {
    color: rgba(248, 250, 252, 0.3);
}

.input-action-btn {
    padding: 12px 16px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    color: var(--tanda-cyan);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.input-action-btn:hover {
    background: var(--tanda-cyan);
    color: #0f172a;
}

.input-error {
    display: block;
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 6px;
    min-height: 18px;
}

/* ================================
   TOKEN SELECTOR
   ================================ */

.token-selector {
    display: flex;
    gap: 12px;
}

.token-option {
    flex: 1;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.token-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 255, 255, 0.4);
}

.token-option.active {
    background: rgba(0, 255, 255, 0.15);
    border-color: var(--tanda-cyan);
}

.token-icon {
    font-size: 1.5rem;
}

.token-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.token-symbol {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.token-balance {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Space Mono', monospace;
}

/* ================================
   AMOUNT INFO
   ================================ */

.amount-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
}

.amount-usd {
    color: var(--text-secondary);
}

.amount-available {
    color: var(--text-secondary);
}

.amount-available span {
    color: var(--tanda-cyan);
    font-weight: 600;
}

/* ================================
   GAS ESTIMATE
   ================================ */

.gas-estimate {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.gas-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.gas-row.total {
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    margin-top: 8px;
    padding-top: 12px;
}

.gas-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gas-row.total .gas-label {
    font-weight: 700;
    color: var(--text-primary);
}

.gas-value {
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
}

.gas-loading {
    color: var(--text-secondary);
    font-style: italic;
}

.gas-amount {
    color: var(--tanda-cyan);
    font-weight: 600;
}

.gas-usd {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.gas-row.total .gas-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tanda-cyan);
}

/* ================================
   ACTION BUTTON
   ================================ */

.modal-action-btn {
    width: 100%;
    padding: 16px;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 12px;
    color: var(--tanda-cyan);
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: not-allowed;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.modal-action-btn.enabled {
    opacity: 1;
    cursor: pointer;
}

.modal-action-btn.enabled:hover {
    background: var(--tanda-cyan);
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 255, 255, 0.3);
}

.modal-action-btn:disabled {
    cursor: not-allowed;
}

/* ================================
   RECEIVE TAB
   ================================ */

.receive-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.qr-code-container {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.qr-code-placeholder {
    width: 200px;
    height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(0, 255, 255, 0.3);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-secondary);
}

.qr-code-placeholder i {
    font-size: 3rem;
    color: var(--tanda-cyan);
}

.qr-code-placeholder p {
    margin: 0;
    font-size: 0.9rem;
}

.address-display {
    margin-bottom: 8px;
}

.address-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
}

.address-text {
    flex: 1;
    font-family: 'Space Mono', monospace;
    color: var(--tanda-cyan);
    font-size: 1rem;
    word-break: break-all;
}

.copy-btn {
    padding: 10px 16px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    color: var(--tanda-cyan);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn:hover {
    background: var(--tanda-cyan);
    color: #0f172a;
}

.copy-btn.success {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
}

.receive-instructions {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
}

.instruction-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tanda-cyan);
    font-weight: 600;
    margin-bottom: 12px;
}

.instruction-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instruction-list li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 6px 0;
    padding-left: 24px;
    position: relative;
}

.instruction-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--tanda-cyan);
}

/* ================================
   TRANSACTION STATUS
   ================================ */

.transaction-status {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    z-index: 10;
}

.status-content {
    text-align: center;
    padding: 40px;
    max-width: 80%;
}

.status-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.status-icon i {
    color: var(--tanda-cyan);
}

.transaction-status.success .status-icon i {
    color: #10b981;
}

.transaction-status.error .status-icon i {
    color: #ef4444;
}

.status-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.status-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.status-progress {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--tanda-cyan), #7FFFD8);
    width: 0%;
    animation: progressAnimation 2s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 768px) {
    .transaction-modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 20px 16px 16px 16px;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-tabs {
        padding: 16px 16px 0 16px;
    }

    .tab-content {
        padding: 20px 16px;
    }

    .token-selector {
        flex-direction: column;
    }

    .qr-code-placeholder {
        width: 180px;
        height: 180px;
    }

    .address-box {
        flex-direction: column;
        align-items: stretch;
    }

    .copy-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-title {
        font-size: 1.1rem;
        gap: 8px;
    }

    .tab-btn {
        font-size: 0.85rem;
        padding: 10px 12px;
    }

    .form-input {
        font-size: 0.9rem;
    }

    .qr-code-placeholder {
        width: 160px;
        height: 160px;
    }
}
