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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden; /* Prevent body scrolling */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1400px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    padding: 15px 0;
    color: white;
    flex-shrink: 0;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

.calculator-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0; /* Important for flexbox shrinking */
}

.main-content {
    display: flex;
    flex-grow: 1;
    min-height: 0;
}

.input-section {
    background: #f8fafc;
    padding: 20px;
    border-right: 1px solid #e2e8f0;
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
}

.frequency-input {
    margin-bottom: 20px;
}

.frequency-input label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.frequency-input input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.frequency-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.antenna-selector {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.antenna-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    color: #374151;
}

.antenna-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.antenna-btn {
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.antenna-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.antenna-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.results-section {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto; /* Allow vertical scrolling within this section */
    min-height: 0;
}

.antenna-results {
    display: none;
}

.antenna-results.active {
    display: block;
}

.antenna-results h3 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: 600;
}

.antenna-illustration {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

svg.antenna-svg {
    width: 100%;
    height: auto;
    max-width: 280px;
    max-height: 200px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.result-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.result-item .label {
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.result-item .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.info-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.info-card h4 {
    color: #1f2937;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1rem;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #6b7280;
    font-size: 0.8rem;
    position: relative;
    padding-left: 15px;
}

.info-card li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.info-card li:last-child {
    border-bottom: none;
}

/* Fallback for non-desktop devices */
@media (max-width: 1023px) {
    body {
        height: auto;
        overflow-y: auto;
        padding: 0;
    }
    .container {
        height: auto;
        flex-direction: column;
    }
    .calculator-container {
        flex-direction: column;
    }
    .main-content {
        flex-direction: column;
    }
    .input-section {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    .results-section {
        overflow-y: visible;
    }
    .info-section {
        grid-template-columns: 1fr;
    }
}
