/* ==========================================================================
   Demo Page Styles
   ONLY using: golden-green (#8B9A46), dark-red (#8B2C2C), pale-yellow (#FFF8DC)
   ========================================================================== */

/* Demo Hero */
.demo-hero {
    padding: 6rem 2rem 3rem;
    background: linear-gradient(135deg, 
        rgba(139, 154, 70, 0.08) 0%, 
        rgba(139, 44, 44, 0.05) 100%);
    text-align: center;
}

.demo-hero h1 {
    color: var(--dark-red);
    margin-bottom: 1rem;
}

.demo-subtitle {
    color: var(--dark-red);
    opacity: 0.8;
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Demo Interface */
.demo-interface {
    padding: 4rem 2rem;
    background: var(--pale-yellow);
}

.demo-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

/* Control Panel */
.control-panel {
    background: rgba(255, 248, 220, 0.8);
    border: 2px solid var(--golden-green);
    border-radius: 20px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.control-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(139, 154, 70, 0.2);
}

.control-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.control-section h3 {
    color: var(--dark-red);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* CSV Upload */
.file-upload {
    position: relative;
    display: inline-block;
    cursor: pointer;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    left: -9999px;
}

.file-upload label {
    display: block;
    padding: 0.75rem;
    background: var(--golden-green);
    color: var(--pale-yellow);
    text-align: center;
    border-radius: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

.file-upload label:hover {
    background: var(--dark-red);
    transform: translateY(-2px);
}

.file-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(139, 154, 70, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--dark-red);
}

/* Algorithm Selection */
.algorithm-select {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.algorithm-option {
    padding: 0.75rem;
    background: var(--pale-yellow);
    border: 2px solid rgba(139, 154, 70, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--dark-red);
}

.algorithm-option:hover {
    border-color: var(--golden-green);
    background: rgba(139, 154, 70, 0.1);
}

.algorithm-option.selected {
    background: var(--golden-green);
    color: var(--pale-yellow);
    border-color: var(--golden-green);
}

/* Parameters */
.parameter-group {
    margin-bottom: 1rem;
}

.parameter-group label {
    display: block;
    color: var(--dark-red);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.parameter-group input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 5px;
    background: rgba(139, 154, 70, 0.2);
    outline: none;
}

.parameter-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--golden-green);
    cursor: pointer;
    border: 2px solid var(--pale-yellow);
}

.parameter-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--golden-green);
    cursor: pointer;
    border: 2px solid var(--pale-yellow);
}

.parameter-value {
    text-align: right;
    color: var(--golden-green);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Main Visualization Area */
.visualization-area {
    background: rgba(255, 248, 220, 0.5);
    border: 2px solid rgba(139, 154, 70, 0.2);
    border-radius: 20px;
    padding: 2rem;
    min-height: 600px;
}

/* Gantt Chart */
.gantt-container {
    background: var(--pale-yellow);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
}

.gantt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(139, 154, 70, 0.2);
}

.gantt-title {
    color: var(--dark-red);
    font-size: 1.25rem;
}

.gantt-controls {
    display: flex;
    gap: 0.5rem;
}

.gantt-control-btn {
    padding: 0.5rem 1rem;
    background: var(--pale-yellow);
    color: var(--dark-red);
    border: 1px solid var(--golden-green);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.gantt-control-btn:hover {
    background: var(--golden-green);
    color: var(--pale-yellow);
}

.gantt-chart {
    position: relative;
    min-height: 400px;
}

.gantt-timeline {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(139, 154, 70, 0.2);
}

.timeline-marker {
    color: var(--dark-red);
    font-size: 0.75rem;
    opacity: 0.7;
}

.gantt-rows {
    position: relative;
}

.gantt-row {
    display: flex;
    align-items: center;
    height: 45px;
    margin-bottom: 0.5rem;
    position: relative;
}

.gantt-label {
    width: 120px;
    color: var(--dark-red);
    font-size: 0.9rem;
    padding-right: 1rem;
}

.gantt-bars {
    flex: 1;
    position: relative;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 154, 70, 0.05) 50%, 
        transparent 100%);
}

.gantt-bar {
    position: absolute;
    height: 35px;
    background: linear-gradient(135deg, var(--golden-green), rgba(139, 154, 70, 0.8));
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    color: var(--pale-yellow);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    top: 5px;
}

.gantt-bar:hover {
    transform: scaleY(1.1);
    box-shadow: 0 4px 15px rgba(139, 44, 44, 0.2);
    z-index: 10;
}

.gantt-bar.critical {
    background: linear-gradient(135deg, var(--dark-red), rgba(139, 44, 44, 0.8));
}

/* Metrics Dashboard */
.metrics-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.metric-card {
    background: var(--pale-yellow);
    border: 2px solid rgba(139, 154, 70, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.metric-card:hover {
    border-color: var(--golden-green);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(139, 44, 44, 0.1);
}

.metric-label {
    color: var(--dark-red);
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.metric-value {
    color: var(--golden-green);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.metric-change {
    color: var(--dark-red);
    font-size: 0.85rem;
    opacity: 0.7;
}

.metric-change.positive {
    color: var(--golden-green);
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(139, 154, 70, 0.05);
    border-radius: 15px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-title {
    color: var(--dark-red);
    font-size: 1.25rem;
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
}

.export-btn {
    padding: 0.5rem 1rem;
    background: var(--golden-green);
    color: var(--pale-yellow);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.export-btn:hover {
    background: var(--dark-red);
    transform: translateY(-2px);
}

/* Action Buttons */
.demo-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-run {
    padding: 1rem 3rem;
    background: var(--golden-green);
    color: var(--pale-yellow);
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-run:hover {
    background: var(--dark-red);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 44, 44, 0.2);
}

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

.btn-reset {
    padding: 1rem 2rem;
    background: var(--pale-yellow);
    color: var(--dark-red);
    border: 2px solid var(--golden-green);
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reset:hover {
    background: rgba(139, 154, 70, 0.1);
    transform: translateY(-2px);
}

/* Loading State */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 248, 220, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    z-index: 100;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(139, 154, 70, 0.2);
    border-top-color: var(--golden-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .demo-container {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        position: static;
        max-width: 600px;
        margin: 0 auto 2rem;
    }
}

@media (max-width: 768px) {
    .metrics-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gantt-label {
        width: 80px;
        font-size: 0.8rem;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .demo-hero {
        padding: 4rem 1rem 2rem;
    }
    
    .demo-hero h1 {
        font-size: 2rem;
    }
    
    .metrics-dashboard {
        grid-template-columns: 1fr;
    }
    
    .demo-actions {
        flex-direction: column;
    }
    
    .btn-run,
    .btn-reset {
        width: 100%;
    }
}