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

body {
    font-family: 'Inter', sans-serif;
    background-color: #f5f8fa;
    color: #14171a;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1da1f2;
    margin-bottom: 0.5rem;
}

.description {
    color: #657786;
    font-size: 0.9rem;
}

.calculator {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #14171a;
    cursor: pointer;
}

input {
    padding: 0.75rem;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: #1da1f2;
    box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.2);
}

.advanced-options {
    margin-top: 0.5rem;
}

summary {
    cursor: pointer;
    color: #1da1f2;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

summary:focus {
    outline: none;
}

.weights-section {
    background-color: #f7f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.weights-section h3 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: #657786;
}

.weight-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.weight-group input {
    width: 80px;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    flex: 1;
}

button:active {
    transform: translateY(1px);
}

.primary-btn {
    background-color: #1da1f2;
    color: white;
}

.primary-btn:hover {
    background-color: #1a91da;
}

.secondary-btn {
    background-color: #e1e8ed;
    color: #657786;
}

.secondary-btn:hover {
    background-color: #d1d8dd;
}

.error-message {
    color: #e0245e;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 1.5rem;
}

.results {
    background-color: #f7f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    transition: opacity 0.3s, transform 0.3s;
}

.results.hidden {
    display: none;
}

.result-item {
    text-align: center;
}

.result-item h3 {
    font-size: 0.9rem;
    color: #657786;
    margin-bottom: 0.5rem;
}

.result-item p {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1da1f2;
}

.summary {
    grid-column: span 2;
    text-align: center;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e8ed;
}

.summary p {
    font-size: 1rem;
    color: #14171a;
}

footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: #657786;
}

/* Responsive styles */
@media (max-width: 600px) {
    .container {
        margin: 1rem;
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .input-section {
        grid-template-columns: 1fr;
    }
    
    .results {
        grid-template-columns: 1fr;
    }
    
    .summary {
        grid-column: span 1;
    }
    
    .button-group {
        flex-direction: column;
    }
}
