/* CSS Variables */
:root {
    --primary-color: #f7931a;
    --secondary-color: #663399;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --text-color: #333;
    --bg-color: #ffffff;
    --hover-color: #f1f3f4;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Connection Status */
.connection-status {
    margin-bottom: 2rem;
}

.status-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.status-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    font-size: 1.2rem;
}

.status-indicator.connected {
    color: var(--success-color);
}

.status-indicator.disconnected {
    color: var(--danger-color);
}

.status-text {
    font-size: 1.1rem;
    font-weight: 500;
}

.connection-actions {
    display: flex;
    gap: 1rem;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #e88b0a;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #552288;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: var(--hover-color);
}

.modal-body {
    padding: 1.5rem;
}

/* Provider Grid */
.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.provider-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.provider-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--light-color);
}

.provider-btn.detected {
    border-color: var(--success-color);
}

.provider-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.provider-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-color);
}

.provider-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.provider-status {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.provider-status.detected {
    color: var(--success-color);
}

.provider-status.not-detected {
    color: var(--danger-color);
}

/* Wallet Info */
.wallet-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.wallet-details h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.wallet-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.wallet-provider {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.wallet-addresses {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.address-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--light-color);
    border-radius: 6px;
}

.address-item label {
    font-weight: 500;
    min-width: 120px;
    color: var(--text-color);
}

.address {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #666;
    word-break: break-all;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: var(--hover-color);
}

/* Tab Styles */
.tab-container {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.tab-nav {
    display: flex;
    background: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 120px;
    white-space: nowrap;
}

.tab-btn:hover {
    background-color: var(--hover-color);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

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

/* Balance Card */
.balance-card {
    background: var(--bg-color);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.balance-header h3 {
    margin: 0;
    color: var(--text-color);
}

.refresh-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background-color: var(--hover-color);
    transform: rotate(180deg);
}

.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.balance-item {
    padding: 1rem;
    background: var(--light-color);
    border-radius: 6px;
    text-align: center;
}

.balance-item.total {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.balance-item label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.balance-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.balance-unit {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Ordinals and Runes Grid */
.ordinals-grid,
.runes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.ordinal-item,
.rune-item {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.ordinal-item:hover,
.rune-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.ordinal-item h4,
.rune-item h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.ordinal-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1rem;
    background: var(--light-color);
}

.ordinal-info {
    text-align: left;
}

.ordinal-info p,
.rune-item p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-color);
}
}

.ordinal-item p,
.rune-item p {
    margin: 0.25rem 0;
    color: #666;
}

/* Transaction Section */
.transaction-section {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.transaction-header h3 {
    margin: 0;
    color: var(--text-color);
}

.transaction-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.transaction-controls select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
}

.transaction-table-container {
    overflow-x: auto;
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.transaction-table th,
.transaction-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.transaction-table th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--text-color);
}

.transaction-table tbody tr:hover {
    background: var(--hover-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pagination button:hover {
    background: var(--hover-color);
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

.no-data p {
    margin: 0;
    font-size: 1.1rem;
}

/* Error Container */
.error-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.error-message {
    background: var(--danger-color);
    color: white;
    padding: 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.error-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.error-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.loading-spinner i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem;
    border-radius: 6px;
    color: white;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.info {
    background: var(--info-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 2rem 0;
    text-align: center;
    color: #666;
    border-top: 1px solid var(--border-color);
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #666;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .status-card {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .connection-actions {
        justify-content: center;
    }
    
    .address-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .address-item label {
        min-width: auto;
    }
    
    .balance-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        min-width: 100px;
    }
    
    .transaction-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .transaction-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .provider-grid {
        grid-template-columns: 1fr;
    }
    
    .error-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .wallet-card {
        padding: 1rem;
    }
    
    .balance-item {
        padding: 0.75rem;
    }
    
    .balance-value {
        font-size: 1.2rem;
    }
    
    .transaction-table {
        font-size: 0.9rem;
    }
    
    .transaction-table th,
    .transaction-table td {
        padding: 0.5rem;
    }
}
