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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

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

nav.tabs {
    background: white;
    display: flex;
    justify-content: center;
    gap: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-btn {
    flex: 1;
    max-width: 250px;
    padding: 1rem 2rem;
    border: none;
    background: white;
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #f8f8f8;
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f8ff;
}

main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.tab-content {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tab-content.active {
    display: block;
}

h2 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
}

/* FILTERS */
.filters {
    background: #f8f8ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

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

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

.filter-group select,
.question select,
.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.filter-group select:focus,
.question select:focus,
.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

#reset-filters {
    padding: 0.75rem 1.5rem;
    background: #666;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

#reset-filters:hover {
    background: #555;
}

.result-count {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #666;
}

.result-count span {
    font-weight: bold;
    color: #667eea;
}

/* TABLE */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

thead {
    background: #667eea;
    color: white;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    position: relative;
}

th:hover {
    background: #5568d3;
}

th::after {
    content: '⇅';
    position: absolute;
    right: 0.5rem;
    opacity: 0.5;
}

tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

tbody tr:hover {
    background: #f8f8ff;
}

td {
    padding: 1rem;
}

.details-btn {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.details-btn:hover {
    background: #5568d3;
}

/* WIZARD */
.wizard {
    max-width: 600px;
    margin: 0 auto;
}

.question {
    margin-bottom: 2rem;
}

.question label {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

.primary-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.result-box {
    margin-top: 2rem;
    padding: 2rem;
    background: #f8f8ff;
    border-left: 4px solid #667eea;
    border-radius: 8px;
}

.result-box h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.result-box .recommendation {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.result-box .recommendation h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.result-box .recommendation p {
    color: #666;
    margin-bottom: 0.5rem;
}

.result-box .matching-configs {
    margin-top: 1.5rem;
}

.result-box .config-card {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    border-left: 3px solid #667eea;
}

.result-box .config-card h5 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.result-box .config-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

/* SUBMIT FORM */
.submit-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
    background: white;
    margin-top: 3rem;
    border-top: 1px solid #eee;
}

footer p {
    margin: 0.5rem 0;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    padding: 2rem;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    margin: 2rem 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

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

.modal-header h3 {
    color: #667eea;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 1;
}

.close-modal:hover {
    color: #333;
}

.modal-body dl {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
}

.modal-body dt {
    font-weight: 600;
    color: #555;
}

.modal-body dd {
    color: #333;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .tab-content {
        padding: 1rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .modal-body dl {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .modal-body dt {
        font-weight: 600;
        margin-top: 1rem;
    }
}
