/* ==========================================================================
   UniLayer Solutions - Complete UI Styles
   Unified styles for btcwallet, btcscanner, btcmanager
   ========================================================================== */

/* Base Reset and Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

/* ==========================================================================
   WALLET LAYOUT STYLES
   ========================================================================== */

.unilayer-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    width: 100%;
    text-align: center;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header Styles */
.unilayer-logo {
    font-size: 48px;
    margin-bottom: 10px;
}

.unilayer-title {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
}

.unilayer-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

/* ==========================================================================
   SCANNER & MANAGER LAYOUT STYLES
   ========================================================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    color: #fff;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ==========================================================================
   TAB SYSTEM
   ========================================================================== */

.unilayer-tab-container, .tab-container {
    margin-bottom: 30px;
}

.unilayer-tab-container {
    display: flex;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 4px;
    flex-wrap: wrap;
}

.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}

.unilayer-tab, .tab {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
    font-size: 14px;
}

.tab {
    color: white;
}

.unilayer-tab.active, .tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.unilayer-tab:hover:not(.active), .tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

.unilayer-tab-content, .tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.unilayer-tab-content.active, .tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

.unilayer-form-group, .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.unilayer-label, .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-label {
    color: #fff;
}

.unilayer-input, .unilayer-textarea, .unilayer-select, .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.form-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.unilayer-input:focus, .unilayer-textarea:focus, .unilayer-select:focus, .form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.unilayer-input.error, .form-input.error {
    border-color: #dc3545;
}

.unilayer-input.success, .form-input.success {
    border-color: #28a745;
}

.bitcoin-address {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
}

/* ==========================================================================
   BUTTON STYLES
   ========================================================================== */

.unilayer-btn, .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin: 10px 5px;
    position: relative;
    overflow: hidden;
}

.btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    margin: 0 6px 6px 0;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.unilayer-btn:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.unilayer-btn:active, .btn:active {
    transform: translateY(0);
}

.unilayer-btn:disabled, .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.unilayer-btn.secondary, .btn.secondary {
    background: #6c757d;
}

.unilayer-btn.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.unilayer-btn.danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.unilayer-btn.outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.unilayer-btn.outline:hover {
    background: #667eea;
    color: white;
}

.btn.primary {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
}

.btn.setup {
    background: linear-gradient(45deg, #FFC107, #FF9800);
    color: #333;
    font-weight: bold;
}

/* Search Button */
.search-btn {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
    min-width: 120px;
}

.search-btn:hover {
    transform: translateY(-2px);
}

/* ==========================================================================
   CARDS AND PANELS
   ========================================================================== */

.unilayer-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    text-align: left;
    transition: all 0.3s ease;
}

.unilayer-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.unilayer-card.success {
    border-color: #28a745;
    background: #f8fff9;
}

.unilayer-card.warning {
    border-color: #ffc107;
    background: #fffdf5;
}

.unilayer-card.error {
    border-color: #dc3545;
    background: #fff5f5;
}

.unilayer-card.info {
    border-color: #17a2b8;
    background: #f0feff;
}

.unilayer-card-header {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Section Styles for Scanner/Manager */
.section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.section h2 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    color: white;
}

/* ==========================================================================
   GRID SYSTEM
   ========================================================================== */

.unilayer-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.unilayer-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
}

.unilayer-grid.cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.unilayer-grid.cols-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 8px;
    color: white;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 4px;
    color: white;
}

.stat-card .change {
    font-size: 0.8rem;
    opacity: 0.8;
    color: white;
}

/* Main Grid for Scanner/Manager */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* ==========================================================================
   WALLET MANAGEMENT STYLES
   ========================================================================== */

/* Wallet Grid */
.wallet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wallet-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.wallet-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
}

.wallet-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

.type-coordinator {
    background: #FF6B6B;
    color: white;
}

.type-pool {
    background: #4ECDC4;
    color: white;
}

.type-worker {
    background: #95E1D3;
    color: #333;
}

.type-generator {
    background: #F38BA8;
    color: white;
}

.wallet-balance {
    font-size: 1.8rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 12px;
}

.wallet-address {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 12px;
    word-break: break-all;
    color: rgba(255, 255, 255, 0.9);
}

.wallet-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wallet-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.wallet-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.wallet-btn.send {
    background: linear-gradient(45deg, #FF6B6B, #F38BA8);
}

/* Setup Section */
.setup-section {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.setup-title {
    color: #FFC107;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.setup-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==========================================================================
   ADDRESS DISPLAY
   ========================================================================== */

.unilayer-address {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    word-break: break-all;
    border: 1px solid #e9ecef;
    font-size: 14px;
    position: relative;
    margin: 8px 0;
}

.unilayer-address.bitcoin {
    border-left: 4px solid #f7931a;
}

.unilayer-address.ethereum {
    border-left: 4px solid #627eea;
}

/* ==========================================================================
   BALANCE DISPLAY
   ========================================================================== */

.unilayer-balance {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.unilayer-balance.btc {
    color: #f7931a;
}

.unilayer-balance.eth {
    color: #627eea;
}

.unilayer-balance.usd {
    color: #28a745;
}

/* ==========================================================================
   SEARCH SECTION
   ========================================================================== */

.search-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-align: center;
    color: white;
}

.search-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 300px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-size: 1rem;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-type {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-size: 1rem;
    min-width: 120px;
}

.search-results {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    display: none;
    color: white;
}

/* ==========================================================================
   NODE AND TRANSACTION LISTS
   ========================================================================== */

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Node List */
.node-list {
    max-height: 400px;
    overflow-y: auto;
}

.node-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 4px solid #4CAF50;
}

.node-item.offline {
    border-left-color: #f44336;
    opacity: 0.7;
}

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.node-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
}

.node-status {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

.status-online {
    background: #4CAF50;
    color: white;
}

.status-offline {
    background: #f44336;
    color: white;
}

.node-details {
    font-size: 0.8rem;
    opacity: 0.8;
    color: white;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.online {
    background: #4CAF50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.5);
}

.offline {
    background: #f44336;
    box-shadow: 0 0 6px rgba(244, 67, 54, 0.5);
}

/* Transaction List */
.transaction-list {
    max-height: 350px;
    overflow-y: auto;
}

.transaction-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 4px solid #2196F3;
}

.tx-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.tx-hash {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
    color: #64B5F6;
}

.tx-amount {
    font-weight: bold;
    color: #4CAF50;
    font-size: 0.9rem;
}

.tx-details {
    font-size: 0.7rem;
    opacity: 0.8;
    color: white;
}

/* Item Lists for Scanner */
.item-list {
    max-height: 500px;
    overflow-y: auto;
}

.item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.item.mempool {
    border-left: 4px solid #FFC107;
}

.item.confirmed {
    border-left: 4px solid #4CAF50;
}

.item.block {
    border-left: 4px solid #2196F3;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.item-title {
    font-weight: bold;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    color: white;
}

.item-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-mempool {
    background: #FFC107;
    color: #333;
}

.badge-confirmed {
    background: #4CAF50;
    color: white;
}

.badge-block {
    background: #2196F3;
    color: white;
}

.item-details {
    font-size: 0.8rem;
    opacity: 0.8;
    color: white;
}

.item-meta {
    margin-top: 8px;
    font-size: 0.7rem;
    opacity: 0.6;
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.page-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.page-btn.active {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   MODAL SYSTEM
   ========================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 30px;
    min-width: 400px;
    max-width: 90vw;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ==========================================================================
   NOTIFICATIONS
   ========================================================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.notification.error {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #333;
}

.notification.info {
    background: linear-gradient(135deg, #17a2b8 0%, #667eea 100%);
}

/* ==========================================================================
   COPY BUTTON
   ========================================================================== */

.unilayer-copy-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.unilayer-copy-btn:hover {
    background: #138496;
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */

.loading {
    text-align: center;
    padding: 20px;
    opacity: 0.7;
    font-size: 0.9rem;
    color: white;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .unilayer-container {
        padding: 20px;
        margin: 10px;
    }
    
    .unilayer-tab-container, .tabs {
        flex-direction: column;
    }
    
    .unilayer-tab, .tab {
        margin-bottom: 4px;
    }
    
    .unilayer-grid.cols-2,
    .unilayer-grid.cols-3,
    .unilayer-grid.cols-4 {
        grid-template-columns: 1fr;
    }
    
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .wallet-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .modal-content {
        min-width: auto;
        width: 90%;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-input, .search-type {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .unilayer-logo {
        font-size: 36px;
    }
    
    .unilayer-title {
        font-size: 24px;
    }
    
    .unilayer-btn, .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.unilayer-text-center { text-align: center; }
.unilayer-text-left { text-align: left; }
.unilayer-text-right { text-align: right; }

.unilayer-mt-1 { margin-top: 8px; }
.unilayer-mt-2 { margin-top: 16px; }
.unilayer-mt-3 { margin-top: 24px; }
.unilayer-mt-4 { margin-top: 32px; }

.unilayer-mb-1 { margin-bottom: 8px; }
.unilayer-mb-2 { margin-bottom: 16px; }
.unilayer-mb-3 { margin-bottom: 24px; }
.unilayer-mb-4 { margin-bottom: 32px; }

.unilayer-p-1 { padding: 8px; }
.unilayer-p-2 { padding: 16px; }
.unilayer-p-3 { padding: 24px; }
.unilayer-p-4 { padding: 32px; }

.unilayer-hidden { display: none !important; }
.unilayer-visible { display: block; }

.unilayer-flex { display: flex; }
.unilayer-flex-center { display: flex; align-items: center; justify-content: center; }
.unilayer-flex-between { display: flex; align-items: center; justify-content: space-between; }

.unilayer-rounded { border-radius: 8px; }
.unilayer-rounded-lg { border-radius: 12px; }
.unilayer-rounded-xl { border-radius: 16px; }

.unilayer-shadow { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.unilayer-shadow-lg { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); }