* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color:white;  /* Lighter green background */
    min-height: 100vh;
    color: #333;
}

.container-fluid {
    padding: 15px;
    max-width: 1600px;
    margin: 0 auto;
}

.main-header {
    text-align: center;
    color: black;
    margin-bottom: clamp(15px, 4vw, 30px);
    padding: 0 10px;
}

.main-header h1 {
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: clamp(5px, 2vw, 10px);
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.main-header p {
    font-size: clamp(0.9rem, 2.5vw, 1.3rem);
    opacity: 0.9;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.4;
}

.experiment-container {
   
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
    overflow: hidden;
    margin-bottom: 30px;
}

.tab-container {
    background: #f8f9fa;
    padding: 0;
    border-bottom: 1px solid black;
}

.nav-tabs {
    border: none;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-tabs .nav-link {
    background: transparent;
    border: none;
    color: #495057;
    font-weight: 700;
    padding: 15px 25px;
    margin: 0 5px;
    border-radius: 0;
    transition: all 0.3s ease;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    white-space: nowrap;
}

.nav-tabs .nav-link:hover {
    background: rgba(146, 204, 65, 0.1);  /* Light green hover */
    color: #98CB3B  /* Darker green text */
}

.nav-tabs .nav-link.active {
    background: white;
    color: blue;  /* Darker green text */
    border-radius: 15px 15px 0 0;
    border-top: 4px solid blue;  /* Darker green border */
    box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
}

.tab-content {
    padding: 20px;
}

.instructions-card {
    background: white;
    color: #333;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e8eadc;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

/* Collapsible Instructions Styles */
.v-collapsible-instruction-container {
    background: white;
    border-radius: 20px;
    padding: 0;
    margin-bottom: 30px;
    border: 1px solid black;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    overflow: hidden;
}

.v-instruction-container {
    color:black;
}

.v-collapsible {
    background: white;
    color: black;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
}

.v-collapsible::after {
    content: '\002B';  /* Plus sign */
    position: absolute;
    right: 20px;
    transition: all 0.3s ease;
}

.v-collapsible.active::after {
    content: '\2212';  /* Minus sign */
}

.v-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: white;
    padding: 0 10%;
}

.v-collapsible.active + .v-content {
    max-height: 500px;
    padding-top: 15px;
    padding-bottom: 15px;
}

/* ... existing css ... */

/* REPLACE the previous list styles with this block */

.v-content ol {
    counter-reset: item;
    list-style-type: none;
    margin-left: 0;
    padding-left: 0;
}

.v-content li {
    /* Use block display to preserve whitespace around bold tags */
    display: block; 
    position: relative;
    
    /* Reserve space on the left for the number so it doesn't overlap text */
    padding-left: 45px; 
    
    /* Keep formatting consistent */
    margin-bottom: 12px;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.6;
    transition: all 0.3s ease;
    
    /* Padding for the highlight background */
    padding-top: 8px;
    padding-bottom: 8px;
    padding-right: 8px;
    
    border-radius: 4px;
    border-left: 4px solid transparent;
}

.v-content li::before {
    content: counter(item) ".";
    counter-increment: item;
    
    /* Position the number inside the reserved padding area */
    position: absolute;
    left: 12px; 
    top: 8px; /* Aligns with the top padding of the list item */
    
    /* Styling */
    width: 25px; 
    font-weight: 700;
    color: #98CB3B;
}

.active-instruction {
    background-color: #f0f9ff; /* Light blue background */
    border-left: 4px solid #0d6efd !important; /* Blue accent border */
    color: #004085; /* Dark blue text */
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ... rest of css ... */
.instructions-card h3 {
    margin-bottom: 15px;
    font-weight: 700;
    color: #98CB3B  /* Darker green text */
  
}

.instructions-card ol, .instructions-card p {
    padding-left: 20px;
}

.instructions-card li {
    margin-bottom: 10px;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.6;
}

.control-panel, .visualization-area, .output-panel, .analysis-control-panel {
    background: white;  /* Very light green */
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
  
    height: 100%;
}

.input-group {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.input-group.horizontal {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 10px;
}

.input-group.horizontal label {
    margin-bottom: 0;
    flex-grow: 1;
    text-align: left;
}

.input-group.horizontal .form-select,
.input-group.horizontal .form-control{
    flex-grow: 0;
    width: 120px;
    text-align: center;
    border: none;
    box-shadow: none;
    padding: 8px;
    border-radius: 5px;
    background-color: #f8f9fa;
    border: 1px solid black;}

.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    padding: 12px 15px;
    
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus, .form-select:focus {
    border-color: #98CB3B;  /* Light green */
    box-shadow: 0 0 0 0rem rgba(140, 179, 105, 0.25);
}

.control-panel h4, .analysis-control-panel h4 {
    text-align: center;
    font-weight: 800;
    margin-bottom: clamp(10px, 4vw, 20px);
    color: blue;  /* Dark green */
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    line-height: 1.3;
}
.control-panel .btn, .analysis-control-panel .btn {
    font-size: 1rem;
    padding: 10px;
    width: auto;
   
}

.btn-primary, .btn-secondary, .btn-success {
    border-radius: 12px;
    padding: 12px 15px; /* Reduced horizontal padding */
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    font-size: clamp(14px, 2vw, 16px);
    width: 20%; /* Take only necessary width */
 
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #98CB3B, #98CB3B);  
    box-shadow: 0 8px 25px rgba(140, 179, 105, 0.3);
    color: white;
}

.btn-secondary {
    background: #98CB3B;  /* Lighter green */
    box-shadow: 0 8px 25px rgba(167, 201, 87, 0.2);
    color: #333;
}

.btn-success {
    background: linear-gradient(135deg, #98CB3B, #98CB3B);  /* Green gradient */
    box-shadow: 0 8px 25px rgba(106, 153, 78, 0.3);
    color: white;
}

.technique-selector {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

.technique-options {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.technique-option {
    flex: 1;
    position: relative;
    min-width: 80px;
}

.technique-option input[type="radio"] { display: none; }

.technique-option label {
    display: block;
    padding: 10px 8px;
    background: #f8f9fa;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    text-align: center;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: clamp(12px, 2vw, 14px);
}

.technique-option input[type="radio"]:checked + label {
    background: linear-gradient(135deg, #98CB3B, #98CB3B);  /* Light to dark green gradient */
    color: white;
    
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(140, 179, 105, 0.3);
}

.visualization-area {
    min-height: 350px;
    display: flex;
    align-items: center;
    padding: 10px;
    justify-content: flex-start;
    position: relative;
    overflow-x: auto;
}

.signal-flow {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    min-width: max-content;
}

.signal-block {
    background: white;
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
    text-align: center;
    min-width: 140px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.signal-block h4 {
    font-size: clamp(0.8rem, 2vw, 1rem);
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.signal-value {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    color: #666;
    word-break: break-all;
    line-height: 1.4;
    text-align: left;
    padding: 0 5px;
    flex-grow: 1;
}

.arrow {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: #98CB3B;  /* Light green */
    animation: pulse 2s infinite;
    align-self: center;
}

.noise-adder {
    align-self: center;
    text-align: center;
    color: #333;
    margin: 0 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.noise-arrow {
    font-size: 1.5rem;
    color: #98CB3B;  /* Light green */
    animation: bounce 1.5s infinite;
}

.noise-adder-circle {
    border: 2px solid #333;
    border-radius: 50%;
    width: 2em;
    height: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    line-height: 1;
    font-weight: bold;
}

.noise-adder-label {
    font-size: 0.8rem;
    color: #6c757d;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.results-panel {
    background: white; 
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.results-panel h4 {
    color: blue;  /* Dark green */
    margin-bottom: clamp(8px, 3vw, 15px);
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    text-align: center;
}

.metric-card {
    background: white;
    border-radius: 15px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.metric-label {
    font-weight: 700;
    color: #666;
    font-size: clamp(0.8rem, 1.8vw, 0.95rem);
    margin-bottom: 5px;
}

.metric-value {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 800;
    color: #333;
}

.chart-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
    position: relative;
    height: 500px;
    max-height: 500px;
}

.chart-container canvas {
    max-height: 400px !important;
}

.chart-container .loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-radius: 20px;
}

.chart-container h4 {
    color: blue;  /* Dark green */
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    text-align: center;
    margin-bottom: clamp(10px, 3vw, 20px);
    font-weight: 700;
}

.constellation-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin-top: 20px;
}

.constellation-plot {
    flex: 1 1 100%;
    min-width: 250px;
    margin-bottom: 15px;
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.constellation-plot h5 {
    text-align: center;
    margin-bottom: clamp(5px, 2vw, 10px);
    font-weight: 700;
    color: #333;
    font-size: clamp(0.8rem, 2vw, 1.1rem);
    line-height: 1.2;
    padding: 0 5px;
}

.constellation-plot canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 250px;
}

.loading {
    display: none;
    text-align: center;
    padding: 30px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-radius: 20px;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

#loadingIndicator p, #chartLoadingIndicator p {
    font-weight: 700;
    color: #333;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 1199px) {
    .tab-content {
        padding: 15px;
    }
    .control-panel, .visualization-area, .output-panel, .analysis-control-panel {
        margin-bottom: 15px;
    }
}

@media (max-width: 991px) {
    .control-panel, .visualization-area, .output-panel, .analysis-control-panel {
        margin-bottom: 20px;
    }
    .constellation-container {
        grid-template-columns: 1fr;
    }
    .input-group {
        margin-bottom: 10px;
    }
    .signal-flow {
        gap: 10px;
    }
    .signal-block {
        min-width: 120px;
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 10px;
    }
    .tab-content {
        padding: 10px;
    }
    .control-panel, .visualization-area, .output-panel, .analysis-control-panel {
        padding: 10px;
    }
    .instructions-card {
        padding: 15px;
    }
    .technique-options {
        gap: 5px;
    }
    .nav-tabs .nav-link {
        padding: 12px 15px;
        margin: 0 2px;
    }
}

@media (max-width: 576px) {
    .signal-flow {
        flex-direction: column;
        align-items: center;
    }
    .arrow {
        transform: rotate(90deg);  /* This makes the arrow point downward */
    }
    .noise-adder {
        transform: rotate(90deg);
        flex-direction: row-reverse;
        justify-content: center;
        align-items: center;
    }
    .noise-arrow {
        transform: rotate(90deg);
    }
    .noise-adder-circle {
        margin-left: 5px;
        margin-top: 0;
    }
    .noise-adder-label {
        display: none;
    }
    .signal-block {
        width: 100%;
        min-width: auto;
    }
    .technique-options {
        flex-direction: column;
    }
    .technique-option {
        min-width: auto;
    }
    
    /* Better support for very small screens */
    .constellation-plot {
        min-width: 100%;
        padding: 10px;
    }
    
    .constellation-plot h5 {
        font-size: 0.9rem;
    }

    /* Enhanced arrow selector with !important to ensure downward direction */
    .signal-flow .arrow,
    #signalFlow .arrow {
        transform: rotate(90deg) !important;
    }
    
    /* Also ensure any SVG arrows or icons are properly rotated */
    .signal-flow svg.arrow,
    #signalFlow svg.arrow {
        transform: rotate(90deg) !important;
    }

    .main-header {
        margin-bottom: 15px;
    }
    
    .main-header h1 {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
        padding: 0 5px;
        margin-bottom: 8px;
    }
    
    .main-header p {
        font-size: clamp(0.8rem, 2vw, 1rem);
        padding: 0 10px;
    }
    
    .v-collapsible {
        font-size: 0.95rem;
        padding: 12px 15px;
    }
    
    .control-panel h4, 
    .analysis-control-panel h4,
    .results-panel h4 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .technique-selector h5 {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .chart-container h4 {
        font-size: 1rem;
        margin-top: 5px;
    }
}

@media screen and (max-width: 400px) {
    /* Reinforce the arrow rotation for smaller screens */
    .arrow, #signalFlow .arrow {
        transform: rotate(90deg) !important;
    }
}

@media screen and (min-width: 576px) {
    .constellation-plot {
        flex: 1 1 45%;
    }
}

@media screen and (min-width: 992px) {
    .constellation-plot {
        flex: 1 1 30%;
    }
}


@media screen and (max-width: 320px) {
    .constellation-plot {
        padding: 8px;
    }
    
    .constellation-plot h5 {
        font-size: 0.8rem;
        margin-bottom: 5px;
    }
    
    .constellation-plot canvas {
        max-height: 200px;
    }
}