/**
 * Merkle Tree Explorer CSS
 * Styling for tree visualization and proof generation
 */

/* Main Container */
.visualizer-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #00ffff;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
}

.tool-header h1 {
    color: #00ffff;
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.tool-header p {
    color: #00ff88;
    font-size: 1.1em;
}

/* Breadcrumb */
.breadcrumb {
    margin: 20px 0;
    padding: 10px;
    color: #00ff88;
    font-size: 0.9em;
    word-break: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    width: 100%;
}

.breadcrumb a {
    color: #00ffff;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #00ff88;
}

/* Instructions */
.instructions {
    background: rgba(0, 20, 40, 0.95);
    border-left: 3px solid #00ff88;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
}

.instructions h4 {
    color: #00ff88;
    margin-bottom: 10px;
}

.instructions ol {
    color: #ffffff;
    padding-left: 25px;
}

.instructions li {
    margin: 8px 0;
    line-height: 1.6;
}

/* Input Panel */
.tree-input-panel {
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
}

.tree-input-panel h3 {
    color: #00ffff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.input-group {
    margin: 15px 0;
    box-sizing: border-box;
}

.input-group label {
    display: block;
    color: #00ffff;
    margin-bottom: 8px;
    font-size: 0.9em;
    text-transform: uppercase;
}

#tree-input {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    box-sizing: border-box;
    resize: vertical;
}

#tree-input:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.input-hint {
    font-size: 0.8em;
    color: #00ff88;
    margin-top: 5px;
    opacity: 0.7;
}

/* Control Buttons */
.tree-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    box-sizing: border-box;
}

.tree-btn {
    padding: 10px 20px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #00ffff;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85em;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.tree-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: translateY(-2px);
}

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

.tree-btn.primary {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
    color: #00ff88;
}

.tree-btn.primary:hover {
    background: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.tree-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Statistics */
#tree-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0;
    box-sizing: border-box;
}

.stat-card {
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.stat-label {
    color: #00ffff;
    font-size: 0.85em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.stat-value {
    color: #00ff88;
    font-size: 1.5em;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* Tree Visualization */
#tree-visualization {
    background: rgba(0, 10, 20, 0.95);
    border: 2px solid #00ffff;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    min-height: 400px;
    box-sizing: border-box;
    width: 100%;
    overflow-x: auto;
}

#tree-visualization svg {
    display: block;
    margin: 0 auto;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #00ffff;
    font-size: 1.2em;
    opacity: 0.6;
}

/* Proof Details */
#proof-details {
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #9d4edd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
}

.proof-info h3 {
    color: #9d4edd;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.proof-section {
    margin: 15px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    box-sizing: border-box;
}

.proof-label {
    font-size: 0.9em;
    color: #9d4edd;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: bold;
}

.proof-value {
    color: #ffffff;
    word-break: break-word;
}

.proof-value.hash-display {
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
}

.proof-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.proof-step {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 2px solid #9d4edd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    flex-wrap: wrap;
}

.step-number {
    color: #9d4edd;
    font-weight: bold;
    min-width: 50px;
}

.step-side {
    color: #ffd700;
    font-weight: bold;
    padding: 2px 6px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid #ffd700;
    border-radius: 3px;
}

.step-hash {
    color: #00ffff;
    flex: 1;
}

/* Educational Content */
.how-it-works {
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
    overflow-x: auto;
}

.how-it-works h2 {
    color: #00ffff;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.how-it-works p {
    color: #ffffff;
    line-height: 1.8;
    margin: 10px 0;
    word-break: break-word;
}

.how-it-works ul,
.how-it-works ol {
    color: #ffffff;
    padding-left: 25px;
    margin: 10px 0;
}

.how-it-works li {
    margin: 8px 0;
}

/* Key Concepts */
.key-concepts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
    box-sizing: border-box;
}

.concept-card {
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 15px;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.concept-card h4 {
    color: #00ff88;
    margin-bottom: 8px;
}

.concept-card p {
    color: #ffffff;
    font-size: 0.9em;
    line-height: 1.6;
    word-break: break-word;
}

.concept-card code {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 3px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

/* Highlight Box */
.highlight-box {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid #ffd700;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
    box-sizing: border-box;
}

.highlight-box p {
    color: #ffd700;
    margin: 0;
}

/* Console Note */
.console-note {
    background: rgba(157, 78, 221, 0.2);
    border: 1px solid #9d4edd;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.console-note h4 {
    color: #9d4edd;
    margin-bottom: 10px;
}

.console-note code {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 3px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .visualizer-container {
        padding: 10px;
    }

    .tool-header h1 {
        font-size: 1.5em;
    }

    #tree-visualization {
        min-height: 300px;
        padding: 10px;
    }

    .tree-controls {
        flex-direction: column;
    }

    .tree-btn {
        width: 100%;
    }

    .proof-step {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .key-concepts {
        grid-template-columns: 1fr;
    }

    #tree-input {
        min-height: 100px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.2em;
    }

    .stat-value {
        font-size: 1.2em;
    }

    .concept-card h4 {
        font-size: 0.95em;
    }

    .concept-card p {
        font-size: 0.85em;
    }

    #tree-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* SVG Tree Styling */
svg {
    background: transparent;
}

svg circle {
    transition: all 0.3s ease;
}

svg circle:hover {
    filter: drop-shadow(0 0 5px currentColor);
}

svg text {
    user-select: none;
    pointer-events: none;
}