@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2.5rem 1rem;
    box-sizing: border-box;
}

.container {
    background-color: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 1600px;
    min-height: 600px;
}

@media (max-width: 1400px) {
    .container {
        grid-template-columns: 260px 1fr 320px;
        gap: 1rem;
    }
}

@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
        border-radius: 1rem;
    }
    
    body {
        padding: 1rem 0.5rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0.75rem;
        border-radius: 0.75rem;
    }
    
    body {
        padding: 0.5rem 0.25rem;
    }
}

.block-diagram-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    overflow: visible;
    padding: 10px;
    width: 100%;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 360px) {
    h2 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
}

.input-section {
    border-right: 2px solid #e2e8f0;
    padding-right: 1.5rem;
    min-width: 280px;
}

@media (max-width: 1200px) {
    .input-section {
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
        padding-right: 0;
        padding-bottom: 2rem;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #475569;
}

.input-group input, .input-group select {
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #334155;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

@media (max-width: 480px) {
    .input-group input, .input-group select {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .input-group label {
        font-size: 0.875rem;
    }
}

@media (max-width: 360px) {
    .input-group input, .input-group select {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }
    
    .input-group label {
        font-size: 0.8125rem;
    }
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.button-primary {
    background-color: #98CB3B;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 100%;
}

@media (max-width: 480px) {
    .button-primary {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 360px) {
    .button-primary {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
}

.button-primary:hover {
    background-color: #86b534;
    transform: translateY(-1px);
}

.button-primary:active {
    background-color: #74a02d;
    transform: translateY(0);
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: none;
    margin: 1rem auto;
}

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

.error-message {
    color: #ef4444;
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    display: none;
}

@media (max-width: 480px) {
    .error-message {
        padding: 0.625rem;
        font-size: 0.875rem;
        margin-top: 0.75rem;
    }
}

@media (max-width: 360px) {
    .error-message {
        padding: 0.5rem;
        font-size: 0.8125rem;
        margin-top: 0.5rem;
    }
}

.simulation-area {
    grid-column: 2;
    min-width: 0;
}

@media (max-width: 1200px) {
    .simulation-area {
        grid-column: 1;
    }
}

.ofdm-block {
    fill: #e0e7ff;
    stroke: #3b82f6;
    stroke-width: 2;
    transition: fill 0.3s ease, stroke 0.3s ease, transform 0.3s ease;
}

.ofdm-block-text {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    fill: #1e293b;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.ofdm-block.highlighted {
    fill: #93c5fd;
    stroke: #1d4ed8;
    stroke-width: 3;
    transform: scale(1.05);
}

.ofdm-block-text.highlighted {
    font-weight: 700;
}

.arrow {
    stroke: #64748b;
    stroke-width: 2;
    fill: none;
    marker-end: url(#arrowhead);
    transition: stroke 0.3s ease;
}

.arrowhead {
    fill: #64748b;
}

.arrow.highlighted {
    stroke: #1d4ed8;
}

.chart-container {
    margin-top: 1.5rem;
    width: 100%;
    overflow: hidden;
}

@media (max-width: 480px) {
    .chart-container {
        margin-top: 1rem;
    }
    
    .chart-container canvas {
        max-height: 280px !important;
        height: 280px !important;
    }
}

@media (max-width: 360px) {
    .chart-container {
        margin-top: 0.75rem;
    }
    
    .chart-container canvas {
        max-height: 240px !important;
        height: 240px !important;
    }
}

.chart-container canvas {
    max-width: 100% !important;
    max-height: 350px !important;
    height: 350px !important;
    width: 100% !important;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .chart-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .chart-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 360px) {
    .chart-title {
        font-size: 0.9375rem;
        margin-bottom: 0.5rem;
    }
}

/* Find the .nav-buttons style (around line 247) and replace with: */
.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.nav-buttons button {
    min-width: 120px;
    flex: 1 1 auto;
    max-width: 200px; /* Prevents buttons from getting too wide */
}

@media (max-width: 480px) {
    .nav-buttons {
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .nav-buttons button {
        min-width: 100px;
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 360px) {
    .nav-buttons {
        gap: 0.5rem;
        margin-top: 0.75rem;
        flex-direction: column;
    }
    
    .nav-buttons button {
        min-width: auto;
        width: 100%;
        max-width: none;
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

.output-area {
    grid-column: 3;
    border-left: 2px solid #e2e8f0;
    padding-left: 1.5rem;
    min-width: 350px;
}

@media (max-width: 1200px) {
    .output-area {
        grid-column: 1;
        border-left: none;
        border-top: 2px solid #e2e8f0;
        padding-left: 0;
        padding-top: 2rem;
    }
}

.simulation-info {
    background-color: #f1f5f9;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid #e2e8f0;
}

@media (max-width: 480px) {
    .simulation-info {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .simulation-info h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 360px) {
    .simulation-info {
        padding: 0.75rem;
        margin-top: 0.75rem;
    }
    
    .simulation-info h3 {
        font-size: 0.9375rem;
        margin-bottom: 0.5rem;
    }
}

.simulation-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.simulation-info p {
    font-family: 'monospace', sans-serif;
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
}

#ofdmBlockDiagram {
    max-width: 100%;
    height: auto;
    width: 500px;
    max-height: 280px;
}

@media (max-width: 768px) {
    #ofdmBlockDiagram {
        width: 100%;
        max-width: 450px;
    }
}

@media (max-width: 480px) {
    #ofdmBlockDiagram {
        max-width: 100%;
        max-height: 200px;
    }
    
    .block-diagram-container {
        padding: 5px;
        margin-bottom: 1rem;
    }
}

@media (max-width: 360px) {
    #ofdmBlockDiagram {
        max-height: 180px;
    }
    
    .block-diagram-container {
        padding: 0;
        margin-bottom: 0.75rem;
    }
}

.symbol-item {
    min-width: 45px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    border: 1.5px solid;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    position: relative;
}

.symbol-item.data {
    background: #dbeafe;
    border-color: var(--primary-blue);
    color: var(--text-primary);
}

.symbol-item.cp {
    background: #fed7d7;
    border-color: var(--error-red);
    color: var(--error-red);
    font-weight: 700;
}

.symbol-item.ellipsis {
    background: #f1f5f9;
    border-color: var(--secondary-gray);
    color: var(--text-secondary);
    border-style: dashed;
    min-width: 30px;
}

.symbol-separator {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 4px;
    font-weight: bold;
}

/* === Add this entire block to your main.css file === */
.symbol-display {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    align-items: center; /* Changed from flex-start to flex-end */
    margin-top: 12px;
    padding: 12px 12px;
    background-color: #f1f5f9;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Menlo', 'Monaco', monospace;
    min-height: 80px;
}

@media (max-width: 480px) {
    .symbol-display {
        padding: 8px 8px;
        gap: 2px;
        min-height: 70px;
        max-height: 300px;
    }
}

@media (max-width: 360px) {
    .symbol-display {
        padding: 6px 6px;
        gap: 2px;
        min-height: 60px;
        max-height: 250px;
    }
}

.symbol-item {
    min-width: 50px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border: 1.5px solid;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    position: relative;
    padding: 0 5px;
}

@media (max-width: 480px) {
    .symbol-item {
        min-width: 40px;
        height: 26px;
        font-size: 10px;
        padding: 0 4px;
    }
}

@media (max-width: 360px) {
    .symbol-item {
        min-width: 36px;
        height: 24px;
        font-size: 9px;
        padding: 0 3px;
    }
}

.symbol-item.data {
    background: #dbeafe;   /* Light blue */
    border-color: #60a5fa;  /* Blue border */
    color: #1e3a8a;       /* Dark blue text */
}

.symbol-item.cp {
    background: #fee2e2;   /* Light red */
    border-color: #fca5a5;  /* Red border */
    color: #991b1b;       /* Dark red text */
    font-weight: 700;
}

.symbol-item.ellipsis {
    background: #f1f5f9;
    border-color: #94a3b8; /* Gray border */
    color: #475569;      /* Gray text */
    border-style: dashed;
    min-width: 30px;
}

.symbol-separator {
    font-size: 16px;
    color: #64748b;
    margin: 0 4px;
    font-weight: bold;
}

@media (max-width: 768px) {
    #ofdmBlockDiagram {
        width: 100%;
        max-width: 450px;
    }
}

/* Instructions Section Styling */
.v-collapsible-instruction-container {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 0.1em;
    margin-bottom: 0.25rem;
}

@media (max-width: 480px) {
    .v-collapsible-instruction-container {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 360px) {
    .v-collapsible-instruction-container {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
}

.v-collapsible {
    cursor: pointer;
    font-weight: 600;
    color: #1e293b;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.v-collapsible:hover {
    color: #3b82f6;
}

.v-content {
    text-align: left;
    padding-left: 10%;
    padding-right: 10%;
}

.v-content ol {
    line-height: 1.6;
    color: #334155;
    list-style-type: decimal;
    list-style-position: outside;
    padding-left: 1.5rem;
    counter-reset: item;
}

.v-content ol li {
    margin-bottom: 0.5rem;
}

.v-content ol li strong {
    color: #1e293b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .v-content {
        padding-left: 5%;
        padding-right: 5%;
    }
    
    .v-collapsible {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .v-content {
        padding-left: 3%;
        padding-right: 3%;
    }
    
    .v-collapsible {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .v-content ol {
        font-size: 0.875rem;
        line-height: 1.6;
        padding-left: 1.25rem;
    }
    
    .v-content ol li {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 360px) {
    .v-content {
        padding-left: 2%;
        padding-right: 2%;
    }
    
    .v-collapsible {
        font-size: 0.9375rem;
        margin-bottom: 0.5rem;
    }
    
    .v-content ol {
        font-size: 0.8125rem;
        line-height: 1.5;
        padding-left: 1rem;
    }
    
    .v-content ol li {
        margin-bottom: 0.4rem;
    }
}

.tab-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

@media (max-width: 480px) {
    .tab-nav {
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
    }
    
    .tab-link {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 360px) {
    .tab-nav {
        margin-bottom: 1rem;
    }
    
    .tab-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        flex: 1;
        text-align: center;
    }
}

.tab-link {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-link:hover {
    color: #3b82f6;
}

.tab-link.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-content {
    display: none;
}

.main-content-grid {
    display: grid;
    grid-template-columns: 280px 1fr 350px;
    gap: 1.5rem;
    min-height: 600px;
}

@media (max-width: 1200px) {
    .main-content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .input-section {
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
        padding-right: 0;
        padding-bottom: 2rem;
    }
    
    .output-area {
        border-left: none;
        border-top: 2px solid #e2e8f0;
        padding-left: 0;
        padding-top: 2rem;
    }
}

@media (max-width: 480px) {
    .main-content-grid {
        gap: 1.5rem;
        min-height: auto;
    }
    
    .input-section {
        padding-bottom: 1.5rem;
    }
    
    .output-area {
        padding-top: 1.5rem;
    }
}

@media (max-width: 360px) {
    .main-content-grid {
        gap: 1rem;
    }
    
    .input-section {
        padding-bottom: 1rem;
        min-width: auto;
    }
    
    .output-area {
        padding-top: 1rem;
        min-width: auto;
    }
}

.symbol-item.with-bracket {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: auto;
    padding: 0; /* Increased bottom padding from 4px to 8px */
    border: none;
    background: transparent;
    position: relative;
    margin-bottom: 8px; /* Increased from 12px to 16px */
}

@media (max-width: 480px) {
    .symbol-item.with-bracket {
        margin-bottom: 6px;
    }
}

@media (max-width: 360px) {
    .symbol-item.with-bracket {
        margin-bottom: 5px;
    }
}

.symbol-bits-box {
    min-width: 50px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border: 1.5px solid;
    letter-spacing: 3px;
    padding: 0 8px;
}

@media (max-width: 480px) {
    .symbol-bits-box {
        min-width: 40px;
        height: 18px;
        font-size: 10px;
        letter-spacing: 2px;
        padding: 0 6px;
    }
}

@media (max-width: 360px) {
    .symbol-bits-box {
        min-width: 36px;
        height: 16px;
        font-size: 9px;
        letter-spacing: 1.5px;
        padding: 0 5px;
    }
}

.symbol-bracket-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2px; /* Slight spacing from box */
    min-height: 32px; /* Ensure space for bracket and label */
}

.symbol-bracket {
    font-size: 20px;
    line-height: 1;
    color: #64748b;
    font-weight: 400;
}

@media (max-width: 480px) {
    .symbol-bracket {
        font-size: 18px;
    }
}

@media (max-width: 360px) {
    .symbol-bracket {
        font-size: 16px;
    }
}

.symbol-label {
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
    color: #475569;
    white-space: nowrap; /* Prevent label from wrapping */
}

@media (max-width: 480px) {
    .symbol-label {
        font-size: 10px;
        margin-top: 1px;
    }
}

@media (max-width: 360px) {
    .symbol-label {
        font-size: 9px;
        margin-top: 1px;
    }
}
