/**
 * Mining Simulator CSS
 * Tool-specific styling with mining animations and visualizations
 */

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

/* Mining Control Panel */
.mining-control-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%;
}

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

/* Breadcrumb Navigation */
.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;
    transition: color 0.3s ease;
}

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

.breadcrumb span {
    color: #00ff88;
}

/* Instructions Section */
.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;
}

/* How It Works Section */
.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;
}

.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;
}

/* Comparison Table - Responsive */
.how-it-works table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
}

.how-it-works table thead {
    display: block;
}

.how-it-works table tbody {
    display: block;
    max-height: 400px;
    overflow-y: auto;
}

.how-it-works table tr {
    display: block;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.how-it-works table th,
.how-it-works table td {
    display: block;
    padding: 8px;
    text-align: left;
}

@media (min-width: 768px) {
    .how-it-works table {
        display: table;
    }
    
    .how-it-works table thead {
        display: table-header-group;
    }
    
    .how-it-works table tbody {
        display: table-row-group;
        max-height: none;
    }
    
    .how-it-works table tr {
        display: table-row;
        margin-bottom: 0;
    }
    
    .how-it-works table th,
    .how-it-works table td {
        display: table-cell;
        padding: 12px;
    }
}

/* Difficulty Control */
.difficulty-control {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.difficulty-control label {
    display: block;
    color: #00ffff;
    margin-bottom: 10px;
    font-weight: bold;
}

#difficulty-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(0, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

#difficulty-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

#difficulty-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

#difficulty-slider::-moz-range-track {
    background: transparent;
    border: none;
}

.difficulty-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.difficulty-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

#difficulty-input {
    width: 60px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #00ffff;
    text-align: center;
    font-weight: bold;
}

#difficulty-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Difficulty Indicator Dots */
#difficulty-indicator {
    display: flex;
    gap: 8px;
    align-items: center;
}

.difficulty-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.difficulty-dot.active {
    background: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* Mining Status Display */
.mining-status {
    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%;
}

.mining-status h3 {
    color: #00ffff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* Live Metrics Grid */
.mining-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.metric-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    padding: 15px;
    text-align: center;
}

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

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

/* Hash Rate Display */
#hash-rate {
    color: #ffd700;
    font-weight: bold;
}

/* Energy Meter */
.energy-meter-container {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

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

.energy-meter-bar {
    position: relative;
    width: 100%;
    height: 25px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

#energy-meter {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff88, #ffd700, #ff3333);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    color: #ffffff;
    font-weight: bold;
}

/* Mining Animation */
@keyframes mining-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
}

.mining-active {
    animation: mining-pulse 1s ease-in-out infinite;
}

/* Mining Controls Buttons */
.mining-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.mining-btn {
    padding: 12px 24px;
    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.9em;
    transition: all 0.3s ease;
}

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

.mining-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.mining-btn.start:hover:not(:disabled) {
    background: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.mining-btn.stop {
    background: rgba(255, 51, 51, 0.2);
    border-color: #ff3333;
    color: #ff3333;
}

.mining-btn.stop:hover:not(:disabled) {
    background: rgba(255, 51, 51, 0.4);
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.5);
}

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

/* Mined Blocks Display */
#mined-blocks {
    margin: 20px 0;
}

.mined-block-card {
    background: rgba(0, 20, 40, 0.95);
    border: 2px solid #00ff88;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    animation: block-appear 0.5s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes block-appear {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mined-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

.block-number {
    font-size: 1.1em;
    font-weight: bold;
    color: #00ffff;
    font-family: 'Courier New', monospace;
}

.block-time {
    font-size: 0.9em;
    color: #ffd700;
    font-family: 'Courier New', monospace;
}

.block-data {
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.hash-label {
    font-size: 0.8em;
    color: #00ffff;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
}

.hash-value {
    color: #ffffff;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
}

.block-stats {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 0.9em;
}

.block-stats span {
    color: #00ffff;
}

.block-stats strong {
    color: #00ff88;
    font-weight: bold;
}

.block-hash {
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

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

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

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

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

/* 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;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mining-control-panel,
    .mining-status {
        padding: 15px;
    }

    .mining-metrics {
        grid-template-columns: 1fr;
    }

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

    .mining-btn {
        width: 100%;
    }

    .block-stats {
        flex-direction: column;
        gap: 8px;
    }

    #difficulty-slider {
        height: 6px;
    }

    #difficulty-slider::-webkit-slider-thumb {
        width: 18px;
        height: 18px;
    }

    .mined-block-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

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

    .metric-value {
        font-size: 1.3em;
    }

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

    .block-number {
        font-size: 0.9em;
    }

    .hash-value {
        font-size: 0.7em;
    }
}