
/* Ensure Create Wallet modal displays as fixed overlay popup */
/* Override base .modal styles from improvements.css */
#createWalletModal,
#createWalletModal.modal,
div#createWalletModal.modal {
    display: none !important;
    position: fixed !important;
    z-index: 1000 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: auto !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(5px) !important;
}

/* When modal is shown via JavaScript */
#createWalletModal[style*="display: block"],
#createWalletModal[style*="display:block"],
#createWalletModal.modal[style*="display: block"],
#createWalletModal.modal[style*="display:block"],
div#createWalletModal.modal[style*="display: block"],
div#createWalletModal.modal[style*="display:block"] {
    display: block !important;
    position: fixed !important;
    z-index: 1000 !important;
}

/* Wallet Modal Styles */
/* Ensure wallet modal content is properly styled and centered - override base .modal-content */
#createWalletModal .modal-content,
#createWalletModal.modal .modal-content,
div#createWalletModal.modal .modal-content,
.modal#createWalletModal .modal-content.wallet-modal-compact,
#createWalletModal .modal-content.wallet-modal-compact,
.wallet-modal-compact {
    max-width: 200px !important;
    width: 200px !important;
    min-width: 200px !important;
    padding: 12px !important;
    margin: 10% auto !important;
    position: relative !important;
}

/* Ensure Add Funds modal displays as fixed overlay popup */
/* Override base .modal styles from improvements.css */
#addBalanceModal,
#addBalanceModal.modal,
div#addBalanceModal.modal {
    display: none !important;
    position: fixed !important;
    z-index: 1000 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: auto !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(5px) !important;
}

/* When modal is shown via JavaScript */
#addBalanceModal[style*="display: block"],
#addBalanceModal[style*="display:block"],
#addBalanceModal.modal[style*="display: block"],
#addBalanceModal.modal[style*="display:block"],
div#addBalanceModal.modal[style*="display: block"],
div#addBalanceModal.modal[style*="display:block"] {
    display: block !important;
    position: fixed !important;
    z-index: 1000 !important;
}

/* Add Funds Modal Compact - Match wallet popup style exactly */
.add-funds-modal-compact {
    max-width: 280px !important;
    padding: 15px !important;
    background: linear-gradient(145deg, #1a202c, #2d3748) !important;
    border: 2px solid #48bb78 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

.add-funds-modal-compact h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    margin-top: 0;
    color: #48bb78;
    text-align: center;
}

.add-funds-modal-compact .close {
    color: #e2e8f0;
    font-size: 20px;
    right: 10px;
    top: 10px;
}

.add-funds-modal-compact .close:hover,
.add-funds-modal-compact .close:focus {
    color: #48bb78;
}

.add-funds-modal-compact .form-group-compact {
    margin-bottom: 12px;
}

.add-funds-modal-compact .form-group-compact label {
    display: block;
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.add-funds-modal-compact .form-group-compact input,
.add-funds-modal-compact .form-group-compact select {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.875rem;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 6px;
    color: #f7fafc;
    box-sizing: border-box;
}

.add-funds-modal-compact .form-group-compact input:focus,
.add-funds-modal-compact .form-group-compact select:focus {
    outline: none;
    border-color: #48bb78;
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.2);
}

.add-funds-modal-compact .form-group-compact small {
    display: block;
    margin-top: 4px;
    color: #cbd5e0;
}

.add-funds-modal-compact .form-actions-compact {
    margin-top: 15px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.add-funds-modal-compact .form-actions-compact .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
    flex: 1;
    max-width: 120px;
}

.wallet-modal-compact h2 {
    font-size: 1rem;
    margin-bottom: 8px;
    margin-top: 0;
}

.wallet-content-compact {
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wallet-balance-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: linear-gradient(145deg, #1a202c, #2d3748);
    border-radius: 6px;
    border: 2px solid #48bb78;
}

.wallet-balance-label {
    color: #a0aec0;
    font-size: 0.75rem;
    font-weight: 500;
}

.wallet-balance-value {
    font-size: 0.875rem;
    font-weight: bold;
    color: #48bb78;
}

.wallet-items-compact {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: linear-gradient(145deg, #2d3748, #1a202c);
    border-radius: 6px;
    border: 1px solid #4a5568;
}

.wallet-money-bag-compact {
    display: flex;
    justify-content: center;
    align-items: center;
}

.bill-drop-bucket-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wallet-money-bag-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.form-actions-compact {
    margin-top: 10px;
    text-align: center;
}

.form-actions-compact .btn {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* Add Funds Modal Compact Styles (similar to wallet popup) */
/* Very specific selectors to override base modal-content styles from improvements.css */
#addBalanceModal .modal-content,
#addBalanceModal.modal .modal-content,
div#addBalanceModal.modal .modal-content,
.modal#addBalanceModal .modal-content.add-funds-modal-compact,
#addBalanceModal .modal-content.add-funds-modal-compact,
.modal-content.add-funds-modal-compact {
    max-width: 280px !important;
    width: 280px !important;
    min-width: 280px !important;
    padding: 15px !important;
    margin: 10% auto !important;
    background: linear-gradient(145deg, #1a202c, #2d3748) !important;
    border: 2px solid #48bb78 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    position: relative !important;
    animation: modalFadeIn 0.3s ease-out !important;
}

/* Force override for any modal-content inside addBalanceModal - must override improvements.css */
#addBalanceModal > .modal-content,
#addBalanceModal.modal > .modal-content {
    max-width: 280px !important;
    width: 280px !important;
    min-width: 280px !important;
    padding: 15px !important;
    margin: 10% auto !important;
    background: linear-gradient(145deg, #1a202c, #2d3748) !important;
    border: 2px solid #48bb78 !important;
}

.add-funds-modal-compact h2 {
    font-size: 1rem !important;
    margin-bottom: 12px !important;
    margin-top: 0 !important;
    color: #48bb78 !important;
    text-align: center !important;
}

.add-funds-modal-compact .close {
    color: #a0aec0 !important;
    font-size: 20px !important;
    right: 10px !important;
    top: 10px !important;
    position: absolute !important;
    float: none !important;
}

.add-funds-modal-compact .close:hover,
.add-funds-modal-compact .close:focus {
    color: #48bb78 !important;
}

.add-funds-modal-compact .form-group-compact {
    margin-bottom: 12px;
}

.add-funds-modal-compact .form-group-compact label {
    display: block;
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.add-funds-modal-compact .form-group-compact input,
.add-funds-modal-compact .form-group-compact select {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.875rem;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 6px;
    color: #f7fafc;
    box-sizing: border-box;
}

.add-funds-modal-compact .form-group-compact input:focus,
.add-funds-modal-compact .form-group-compact select:focus {
    outline: none;
    border-color: #48bb78;
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.2);
}

.add-funds-modal-compact .form-group-compact small {
    display: block;
    margin-top: 4px;
    color: #cbd5e0;
}

.add-funds-modal-compact .form-actions-compact {
    margin-top: 15px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.add-funds-modal-compact .form-actions-compact .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
    flex: 1;
    max-width: 120px;
}

.add-funds-modal-compact #applePayButtonContainer {
    background: #2d3748;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #4a5568;
    margin: 10px 0;
}

.add-funds-modal-compact #applePayButtonContainer p {
    margin-top: 8px;
    font-size: 0.7rem;
}

.wallet-pouch {
    width: 40px;
    height: 50px;
    background: linear-gradient(135deg, #8b6914 0%, #d4af37 50%, #ffd700 100%);
    clip-path: polygon(
        30% 0%, 70% 0%, 95% 15%, 100% 40%, 100% 80%,
        85% 100%, 15% 100%, 0% 80%, 0% 40%, 5% 15%
    );
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: transform 0.2s, opacity 0.2s;
    user-select: none;
    border: 2px solid #8b6914;
    position: relative;
    overflow: visible;
}

.wallet-pouch::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 25%;
    right: 25%;
    height: 10px;
    background: linear-gradient(90deg, #6b5010 0%, #8b6914 50%, #6b5010 100%);
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.wallet-pouch .money-bag-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
    position: relative;
    z-index: 1;
    line-height: 1;
    display: block;
}

.wallet-pouch:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.wallet-pouch.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(0.95);
}

/* Bill Drop Bucket Styles */
.bill-drop-bucket-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.bill-drop-bucket {
    width: 150px;
    height: 180px;
    margin: 0 auto;
    position: relative;
}

.bill-drop-bucket-compact .bill-drop-bucket {
    width: 80px;
    height: 100px;
}

.bill-drop-bucket-compact .bill-bucket {
    height: 75px;
    border-width: 3px;
}

.bill-drop-bucket-compact .bill-bucket-handle {
    height: 8px;
    width: 70%;
}

.bill-drop-bucket-compact .bill-bucket-label {
    font-size: 0.65rem;
    margin-top: 4px;
}

.bill-drop-bucket-compact .bills-container {
    bottom: 10px;
    gap: 4px;
}

.bill-drop-bucket-compact .bucket-bill {
    width: 30px;
    height: 15px;
    font-size: 8px;
}

.bill-bucket {
    width: 100%;
    height: 140px;
    background: linear-gradient(180deg, #2c5282, #1a365d);
    border-radius: 0 0 30px 30px;
    border: 4px solid #3182ce;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.bill-bucket.drag-over {
    border-color: #48bb78;
    box-shadow: 0 0 25px rgba(72, 187, 120, 0.6);
    transform: scale(1.05);
}

.bill-bucket-handle {
    width: 80%;
    height: 15px;
    background: #3182ce;
    border-radius: 15px 15px 0 0;
    margin: 0 auto -5px auto;
}

.bill-bucket-label {
    text-align: center;
    margin-top: 10px;
    color: #a0aec0;
    font-size: 0.875rem;
}

.bill-drop-instructions {
    text-align: center;
    color: #a0aec0;
    font-size: 0.875rem;
    margin-top: 10px;
}

.bills-container {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 90%;
}

.bucket-bill {
    width: 40px;
    height: 20px;
    background: linear-gradient(145deg, #48bb78, #38a169);
    border: 2px solid #2f855a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
