/* Advanced Features Styles */

/* Security Panel */
.security-panel {
    display: none;
    margin-bottom: 24px;
    padding: 20px;
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.security-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.security-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #10b981;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #e5e5e5;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.security-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.security-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.security-item.active {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.security-item .security-icon {
    font-size: 24px;
    flex-shrink: 0;
}

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

.security-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #e5e5e5;
}

.security-info p {
    font-size: 12px;
    opacity: 0.7;
    margin: 0;
}

.security-status {
    font-size: 18px;
    font-weight: bold;
    color: #10b981;
    flex-shrink: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.security-status-btn {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #10b981;
    font-size: 12px;
    font-weight: 600;
}

.security-status-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    transform: scale(1.05);
}

.security-level {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Analytics Dashboard */
.analytics-dashboard {
    padding: 24px;
    margin-bottom: 24px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #ffffff, #e5e5e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-controls {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    color: #e5e5e5;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.dashboard-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-btn.active {
    background: linear-gradient(135deg, #ff9100, #e67e00);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 145, 0, 0.3);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.analytics-card {
    background: rgba(255, 255, 255, 0.04);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.analytics-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 145, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.analytics-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #e5e5e5;
}

.analytics-change {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.analytics-change.positive {
    color: #10b981;
}

.analytics-change.negative {
    color: #ef4444;
}

.yield-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yield-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 12px;
}

.yield-item span:last-child {
    color: #10b981;
    font-weight: 600;
}

.risk-meter {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
}

.risk-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--risk-level, 25%);
    background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.risk-factors {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.risk-factor {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.risk-factor.low {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.risk-factor.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.risk-factor.high {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.gas-prediction {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gas-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 12px;
}

.gas-time span:last-child {
    color: #ff9100;
    font-weight: 600;
}

/* Network Visualization */
.network-visualization {
    padding: 24px;
    margin-bottom: 24px;
}

.network-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.network-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #ffffff, #e5e5e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.network-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.network-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.network-stat span:first-child {
    font-size: 12px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.network-stat span:last-child {
    font-size: 16px;
    font-weight: 700;
}

.network-health.excellent {
    color: #10b981;
}

.network-health.good {
    color: #f59e0b;
}

.network-health.fair {
    color: #ef4444;
}

.network-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    min-height: 300px;
}

.network-map {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.network-node {
    position: absolute;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.network-node:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.network-node.main-node {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff9100, #e67e00);
    border-color: rgba(255, 145, 0, 0.5);
    box-shadow: 0 0 30px rgba(255, 145, 0, 0.4);
}

.node-info {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.network-node:hover .node-info {
    opacity: 1;
}

.network-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.connection-line {
    stroke: rgba(16, 185, 129, 0.6);
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    animation: networkPulse 3s ease-in-out infinite;
}

.network-activity {
    background: rgba(255, 255, 255, 0.04);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.network-activity h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #10b981;
}

.transaction-flow {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flow-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.flow-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(16, 185, 129, 0.3);
}

.flow-direction {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #e5e5e5;
}

.flow-amount {
    font-size: 16px;
    font-weight: 700;
    color: #ff9100;
    margin-bottom: 4px;
}

.flow-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
}

.flow-item:nth-child(odd) .flow-status {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.flow-item:nth-child(even) .flow-status {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* 3D Blockchain Visualization */
.blockchain-3d {
    padding: 24px;
    margin-bottom: 24px;
}

.blockchain-3d-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.blockchain-3d-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #ffffff, #e5e5e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blockchain-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    color: #e5e5e5;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 145, 0, 0.3);
    transform: translateY(-1px);
}

.blockchain-3d-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    min-height: 400px;
}

#blockchain-3d {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    perspective: 1000px;
    perspective-origin: 50% 50%;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.blockchain-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(calc(var(--layer) * -80px));
    transform-style: preserve-3d;
}

.block-3d {
    width: 80px;
    height: 80px;
    position: relative;
    transform-style: preserve-3d;
    cursor: pointer;
    transition: all 0.3s ease;
}

.block-3d:hover {
    transform: rotateY(45deg) rotateX(15deg) scale(1.1);
}

.block-3d.genesis-block {
    filter: hue-rotate(120deg);
}

.block-3d.current-block {
    filter: hue-rotate(60deg);
}

.block-face {
    position: absolute;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff9100, #e67e00);
    border: 2px solid rgba(255, 145, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 145, 0, 0.3);
}

.block-face.front {
    transform: translateZ(40px);
}

.block-face.back {
    transform: translateZ(-40px) rotateY(180deg);
}

.block-face.top {
    transform: rotateX(90deg) translateZ(40px);
}

.block-face.bottom {
    transform: rotateX(-90deg) translateZ(40px);
}

.block-face.left {
    transform: rotateY(-90deg) translateZ(40px);
}

.block-face.right {
    transform: rotateY(90deg) translateZ(40px);
}

.blockchain-connections-3d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.connection-3d {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #10b981, #059669);
    transform: translate(-50%, -50%) translateZ(calc(var(--start) * -80px + 20px));
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    animation: networkPulse 2s ease-in-out infinite;
}

.block-details {
    background: rgba(255, 255, 255, 0.04);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    height: fit-content;
}

.block-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ff9100;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

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

.detail-item span:first-child {
    opacity: 0.7;
    font-weight: 500;
}

.detail-item span:last-child {
    font-weight: 600;
    color: #e5e5e5;
}

/* Responsive Design for Advanced Features */
@media (max-width: 768px) {
    .network-container,
    .blockchain-3d-container {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header,
    .network-header,
    .blockchain-3d-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .dashboard-controls,
    .blockchain-controls {
        justify-content: center;
    }
    
    .network-stats {
        justify-content: center;
    }
    
    .security-features {
        grid-template-columns: 1fr;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .analytics-dashboard,
    .network-visualization,
    .blockchain-3d {
        padding: 16px;
    }
    
    .analytics-card,
    .network-activity,
    .block-details {
        padding: 16px;
    }
    
    .network-node {
        width: 32px;
        height: 32px;
    }
    
    .network-node.main-node {
        width: 48px;
        height: 48px;
    }
    
    .block-3d,
    .block-face {
        width: 60px;
        height: 60px;
    }
    
    .block-face.front {
        transform: translateZ(30px);
    }
    
    .block-face.back {
        transform: translateZ(-30px) rotateY(180deg);
    }
    
    .block-face.top {
        transform: rotateX(90deg) translateZ(30px);
    }
    
    .block-face.bottom {
        transform: rotateX(-90deg) translateZ(30px);
    }
    
    .block-face.left {
        transform: rotateY(-90deg) translateZ(30px);
    }
    
    .block-face.right {
        transform: rotateY(90deg) translateZ(30px);
    }
    
    .dashboard-controls,
    .blockchain-controls {
        flex-wrap: wrap;
    }
    
    .control-btn,
    .dashboard-btn {
        font-size: 11px;
        padding: 6px 10px;
    }
}