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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.header-text {
    flex: 1;
    min-width: 250px;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 1.1em;
}

.related-calc-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(102, 126, 234, 0.2);
    border: 2px solid rgba(102, 126, 234, 0.4);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.related-calc-link:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.related-calc-icon {
    font-size: 1.3em;
}

.related-calc-text {
    font-size: 1.1em;
    font-weight: 600;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-text {
        text-align: center;
    }
    
    .related-calc-link {
        width: 100%;
        justify-content: center;
    }
}

.content {
    padding: 30px;
}

.input-section {
    background: #f7fafc;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #e2e8f0;
}

.input-section h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

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

.crystal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.crystal-item {
    background: white;
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.crystal-item button {
    background: #fc8181;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.crystal-item button:hover {
    background: #e53e3e;
    transform: scale(1.1);
}

.add-crystal-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
}

.add-crystal-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s;
    margin-top: 20px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.5);
}

.results-section {
    background: #f7fafc;
    border-radius: 10px;
    padding: 25px;
    margin-top: 25px;
    border: 2px solid #e2e8f0;
}

.results-section h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 3px solid #48bb78;
    padding-bottom: 10px;
}

.result-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 5px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.result-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.result-card.best {
    border-left-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
}

.result-card h3 {
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.result-card h3 .config-title {
    flex-shrink: 0;
}

.result-card h3 .copy-link-btn {
    margin-left: auto;
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s;
    white-space: nowrap;
}

.result-card h3 .copy-link-btn:hover {
    background: #5568d3;
}

@media (max-width: 768px) {
    .result-card h3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .result-card h3 .copy-link-btn {
        margin-left: 0;
        width: 100%;
    }
    
    .param-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

.examples-section {
    background: #f7fafc;
    border-radius: 10px;
    padding: 30px;
    margin-top: 25px;
    border: 2px solid #e2e8f0;
}

.examples-section h2 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.5em;
    text-align: center;
}

.examples-description {
    text-align: center;
    color: #718096;
    margin-bottom: 25px;
    font-size: 1em;
}

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

.example-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    border: 2px solid #e2e8f0;
    transition: all 0.3s;
    cursor: pointer;
}

.example-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.example-band {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.example-freq {
    font-size: 1.2em;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 5px;
}

.example-desc {
    font-size: 0.9em;
    color: #718096;
}

@media (max-width: 768px) {
    .examples-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .example-band {
        font-size: 1.5em;
    }
    
    .example-freq {
        font-size: 1em;
    }
}

.best-badge {
    background: #48bb78;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
}

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

.param-item {
    background: #edf2f7;
    padding: 12px;
    border-radius: 6px;
}

.param-label {
    color: #718096;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.param-value {
    color: #2d3748;
    font-size: 1.2em;
    font-weight: 600;
}

.warning {
    background: #fff5f5;
    border: 2px solid #fc8181;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    color: #742a2a;
}

.info {
    background: #ebf8ff;
    border: 2px solid #63b3ed;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    color: #2c5282;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #718096;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

@keyframes highlight {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    50% { box-shadow: 0 0 30px rgba(102, 126, 234, 0.6); }
}

.chip-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.chip-option {
    flex: 1;
    padding: 15px;
    border: 3px solid #cbd5e0;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    background: white;
}

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

.chip-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e9ecff 100%);
}

.chip-option h3 {
    color: #2d3748;
    margin-bottom: 8px;
}

.chip-option p {
    color: #718096;
    font-size: 0.9em;
}