/* Manage Account Page Specific Styles */

/* Search Section */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

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

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: #667eea;
    font-size: 1.1rem;
    z-index: 1;
}

.vote-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    transition: all 0.2s ease;
    background: white;
}

.vote-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.vote-input::placeholder {
    color: #a0aec0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.use-wallet-btn {
    position: absolute;
    right: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.use-wallet-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.results-section h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.tab-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.stake-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Info Cards */
.info-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.info-header i {
    color: #667eea;
    font-size: 1.2rem;
}

.info-header h3 {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.info-content {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.info-content .address {
    font-family: 'Courier New', monospace;
    background: rgba(102, 126, 234, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    word-break: break-all;
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 500;
}

.info-content .number {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2e7d32;
}

.info-content .balance {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2e7d32;
}

/* Special layout for balance card - horizontal layout */
.balance-card .info-content {
    flex-direction: row !important;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    width: 100%;
    display: flex;
}

/* Ensure balance text takes flexible width in balance card */
.balance-card .balance {
    flex: 1;
    margin-right: 0;
    text-align: left;
    min-width: 0; /* Allow shrinking */
}

/* Fixed width for withdraw button */
.balance-card .withdraw-btn {
    flex: 0 0 auto;
    width: 100px; /* Fixed width */
    margin-left: 0;
    white-space: nowrap;
    text-align: center;
}

/* Fixed width for delegate button in balance card */
.balance-card .delegate-stake-btn {
    flex: 0 0 auto;
    width: 100px; /* Fixed width */
    margin-left: 0;
    white-space: nowrap;
    text-align: center;
}

/* Withdraw Button */
.withdraw-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.withdraw-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.withdraw-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Withdraw Stake Button */
.withdraw-stake-btn {
    flex: 0 0 auto;
    width: 100px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.withdraw-stake-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.withdraw-stake-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.withdraw-stake-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Delegate Stake Button */
.delegate-stake-btn {
    flex: 0 0 auto;
    width: 100px;
    height: 32px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.delegate-stake-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.delegate-stake-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.delegate-stake-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Deactivate Stake Button */
.deactivate-stake-btn {
    flex: 0 0 auto;
    width: 100px;
    height: 32px;
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.2);
}

.deactivate-stake-btn:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

.deactivate-stake-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.2);
}

.deactivate-stake-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Update Authority Buttons */
.update-authority-btn, .update-stake-authority-btn, .update-stake-withdraw-authority-btn {
    flex: 0 0 auto;
    width: 100px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.update-authority-btn:hover, .update-stake-authority-btn:hover, .update-stake-withdraw-authority-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.update-authority-btn:active, .update-stake-authority-btn:active, .update-stake-withdraw-authority-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

/* Authority Match Indicators */
.authority-match-indicator {
    margin-top: 12px;
}

.match-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.match-success {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.match-warning {
    background: rgba(255, 152, 0, 0.1);
    color: #ef6c00;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

/* Address Container */
.address-container {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

/* Stake Summary Card */
.stake-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stake-summary-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
}

.stake-rank-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
}

.user-authority-badge {
    background: rgba(76, 175, 80, 0.9);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stake Tab Enhancements */
.tab-btn .stake-rank {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: 4px;
}

.tab-btn .stake-amount {
    font-weight: 600;
    color: #2e7d32;
}

.tab-btn.active .stake-rank {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.tab-btn.active .stake-amount {
    color: rgba(255, 255, 255, 0.9);
}

/* Authority Indicators */
.authority-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.authority-indicator i {
    font-size: 12px;
    color: #2e7d32;
}

.tab-btn.active .authority-indicator i {
    color: rgba(255, 255, 255, 0.8);
}

/* Status Indicators */
.status-indicator {
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.status-indicator.deactivating {
    background: rgba(255, 152, 0, 0.2);
    color: #ef6c00;
}

.status-indicator.inactive {
    background: rgba(158, 158, 158, 0.2);
    color: #757575;
}

.tab-btn.active .status-indicator.deactivating {
    background: rgba(255, 152, 0, 0.3);
    color: #fff3e0;
}

.tab-btn.active .status-indicator.inactive {
    background: rgba(158, 158, 158, 0.3);
    color: #f5f5f5;
}

/* Status Description */
.status-description {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #555;
    border-left: 3px solid #667eea;
}

/* Stake Cards with Status Colors */
.active-stake-card .info-header i {
    color: #4caf50;
}

.deactivating-stake-card .info-header i {
    color: #ff9800;
}

.inactive-stake-card .info-header i {
    color: #9e9e9e;
}

/* Account List for Modals */
.account-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.account-item:last-child {
    border-bottom: none;
}

.account-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.account-info {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.active-badge {
    background: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.select-account-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-account-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.current-indicator {
    color: #2e7d32;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Max Button for Withdraw Modal */
.max-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.max-btn:hover {
    background: #5a67d8;
}

/* Authority tab highlighting */
.tab-btn.authority-tab {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(76, 175, 80, 0.05) 100%);
    border: 2px solid rgba(76, 175, 80, 0.3);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.tab-btn.authority-tab:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(76, 175, 80, 0.1) 100%);
    border-color: rgba(76, 175, 80, 0.4);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
    transform: translateY(-1px);
}

.tab-btn.authority-tab.active {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.9) 0%, rgba(69, 160, 73, 0.9) 100%);
    border-color: #4CAF50;
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.tab-btn.authority-tab.active .authority-indicator i {
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive Design for Manage Account */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-navigation {
        flex-direction: column;
    }
    
    .stake-tabs {
        flex-direction: column;
        width: 100%;
    }
    
    .tab-btn {
        justify-content: center;
        width: 100%;
    }
    
    .balance-card .info-content {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .balance-card .balance {
        text-align: center;
    }
    
    .balance-card .withdraw-btn,
    .balance-card .delegate-stake-btn {
        width: 100%;
    }
    
    .address-container {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .update-authority-btn,
    .update-stake-authority-btn,
    .update-stake-withdraw-authority-btn {
        width: 100%;
    }
}
