/**
 * Theme & Layout Stylesheet for AyuCoin Blockchain Explorer
 * Premium Dark Cyberpunk Space Design System
 */

:root {
    --bg-dark: #070b19;
    --bg-card: rgba(18, 26, 52, 0.65);
    --bg-nav: rgba(13, 19, 43, 0.85);
    --primary-color: #00f2fe; /* Neon Cyan */
    --secondary-color: #9d4edd; /* Neon Violet */
    --accent-color: #ff007f; /* Neon Pink */
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(0, 242, 254, 0.15);
    --border-glow: rgba(0, 242, 254, 0.3);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'Space Grotesk', monospace;
    --transition-speed: 0.3s;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #ffffff;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--secondary-color);
}

/* Navbar */
.navbar {
    background-color: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--primary-color);
    box-shadow: 0 0 10px var(--border-glow);
    transition: transform 0.8s ease-in-out;
}

.logo-img:hover {
    transform: rotate(360deg);
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: #ffffff;
}

.logo-sub {
    font-size: 0.65rem;
    letter-spacing: 3px;
    color: var(--secondary-color);
    background: rgba(157, 78, 221, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 0.2rem;
    border: 1px solid rgba(157, 78, 221, 0.3);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all var(--transition-speed);
}

.nav-links a:hover, .nav-links a.active {
    color: #ffffff;
    background: rgba(0, 242, 254, 0.1);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* Search Form */
.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 2px;
    width: 100%;
    max-width: 400px;
    transition: all var(--transition-speed);
}

.search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px var(--border-glow);
}

.search-form input {
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 0.6rem 1.2rem;
    width: 100%;
    outline: none;
    font-family: var(--font-body);
}

.search-form button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: var(--bg-dark);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: transform var(--transition-speed);
}

.search-form button:hover {
    transform: scale(1.05);
}

/* Hero Section (3D Viz) */
.hero-viz {
    position: relative;
    height: 350px;
    width: 100%;
    background: radial-gradient(circle at center, #0f1c3f 0%, #070b19 100%);
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

#threejs-canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 60%, var(--bg-dark));
    z-index: 2;
    pointer-events: none;
}

.hero-text {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    text-align: center;
    width: 90%;
    pointer-events: none;
}

.hero-text h1 {
    font-size: 2.2rem;
    text-shadow: 0 0 15px rgba(0, 242, 254, 0.6);
    margin-bottom: 0.5rem;
}

.hero-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Layout Containers */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    width: 100%;
}

.main-content {
    flex: 1;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: all var(--transition-speed);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(0, 242, 254, 0.15);
}

.stat-icon {
    font-size: 2rem;
    background: rgba(0, 242, 254, 0.1);
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: #ffffff;
}

/* Dashboard Columns Layout */
.dashboard-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}

/* General Card Styles */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: border-color var(--transition-speed);
}

.card:hover {
    border-color: rgba(0, 242, 254, 0.3);
}

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

.card-header h2, .card-header h3 {
    font-size: 1.25rem;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem 1.5rem;
}

th {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(0, 242, 254, 0.03);
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-coinbase {
    background: rgba(157, 78, 221, 0.2);
    color: var(--secondary-color);
    border: 1px solid rgba(157, 78, 221, 0.4);
}

.badge-spent {
    background: rgba(239, 68, 110, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 110, 0.3);
}

.badge-unspent {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Detail View Cards */
.detail-card {
    margin-bottom: 2rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--text-muted);
}

.detail-val {
    word-break: break-all;
    text-align: right;
    font-weight: 400;
}

.highlight-val {
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Transctions Inputs & Outputs split columns */
.tx-io-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .tx-io-columns {
        grid-template-columns: 1fr;
    }
}

.io-card {
    height: 100%;
}

.io-list {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.io-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.io-address {
    font-weight: 400;
}

.io-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 500;
}

/* Code & Hash Text */
.text-hash {
    font-family: var(--font-mono);
    color: var(--primary-color);
    letter-spacing: 0.5px;
    word-break: break-all;
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

/* Buttons */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-dark);
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 242, 254, 0.3);
    color: var(--bg-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary-color);
}

.btn-link {
    font-weight: 500;
    border-bottom: 1px dashed rgba(0, 242, 254, 0.4);
}

.btn-link:hover {
    border-bottom-style: solid;
}

/* Alerts / Warning Box */
.warning-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-sub {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--success-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success-color);
    animation: flash 1.5s infinite;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 10px var(--primary-color); }
    100% { transform: scale(1); opacity: 0.8; }
}

@keyframes flash {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    .search-form {
        max-width: 100%;
    }

    .hero-viz {
        height: 250px;
    }
    
    .hero-text h1 {
        font-size: 1.6rem;
    }
    
    .hero-text p {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.75rem 1rem;
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .detail-val {
        text-align: left;
    }
}
