/* ISF Blockchain Dashboard - Global Styles */

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-bg: #1a1d2e;
    --card-bg: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a8b2d1;
    --border-color: #2d3748;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo {
    font-size: 2rem;
}

.brand-name {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.status-indicator.offline {
    background: var(--danger-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Utilities to avoid inline styles */
.hidden { display: none !important; }
.clickable { cursor: pointer; }
.my-05 { margin: 0.5rem 0; }
.mono-small { font-size: 0.85rem; }
.status-online { color: var(--success-color); }
.status-offline { color: var(--danger-color); }

/* Floating animation for ISF Coin logo */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.logo-img {
    animation: float 3s ease-in-out infinite;
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* Header logo section */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 0;
}

.logo-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.coin-logo {
    display: inline-block;
}

.coin-image {
    animation: float 3s ease-in-out infinite;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    transform: translateY(-15px);
    opacity: 0;
    animation: slideIn 0.3s ease-out forwards;
}
.toast-success { background: var(--success-color); }
.toast-error { background: var(--danger-color); }
.toast-info { background: var(--info-color); }
.toast-hide { animation: slideOut 0.3s ease-out forwards; }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-15px); }
}

/* Hero Section */
.hero {
    background: var(--gradient-1);
    padding: 4rem 0;
    text-align: center;
    margin-top: 0;
    border-radius: 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Page Header */
.page-header {
    background: var(--card-bg);
    padding: 3rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Stats Section */
.stats-section {
    padding: 3rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    font-size: 3rem;
}

.stat-content h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Panels */
.panel {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    overflow: hidden;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.5rem;
}

.panel-body {
    padding: 1.5rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.8rem;
}

.view-all-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.view-all-btn:hover {
    color: var(--primary-dark);
}

/* Info Grids */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: rgba(102, 126, 234, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.info-card h4 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.info-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Tables */
.blocks-table-container {
    overflow-x: auto;
}

.blocks-table {
    width: 100%;
    border-collapse: collapse;
}

.blocks-table th,
.blocks-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.blocks-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.blocks-table td {
    font-size: 0.95rem;
}

.blocks-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.loading-cell {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem !important;
}

.monospace {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.help-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.action-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.action-card h3 {
    margin-bottom: 0.5rem;
}

.action-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    padding: 3rem 0;
}

.content-grid {
    display: grid;
    gap: 2rem;
}

.full-width {
    grid-column: 1 / -1;
}

/* Wallet Results */
.wallet-result,
.balance-result,
.transaction-result,
.mining-result,
.import-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    border-radius: 8px;
}

.hidden {
    display: none !important;
}

.success-message {
    text-align: center;
    margin-bottom: 1.5rem;
}

.success-message h3 {
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.warning-text {
    color: var(--warning-color);
    font-weight: 500;
}

.credential-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.credential-box.danger {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.credential-box label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.credential-value {
    font-family: 'Courier New', monospace;
    word-break: break-all;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.credential-value.small-text {
    font-size: 0.75rem;
}

.copy-btn {
    background: var(--primary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

/* Balance Display */
.balance-display {
    text-align: center;
    padding: 2rem;
    background: var(--gradient-1);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.balance-amount {
    font-size: 3rem;
    font-weight: bold;
}

.balance-details {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

/* Transaction Details */
.transaction-details,
.block-details {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--info-color);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.info-box ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* Mining Progress */
.mining-progress {
    text-align: center;
    padding: 3rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    margin-top: 2rem;
}

.progress-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Explorer Specific */
.explorer-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.search-section {
    padding: 2rem 0;
}

.search-panel {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.search-panel form {
    display: flex;
    gap: 1rem;
}

.search-panel input {
    flex: 1;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text-primary);
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .blocks-table {
        font-size: 0.85rem;
    }
    
    .blocks-table th,
    .blocks-table td {
        padding: 0.5rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
