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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    font-weight: 700;
}

main {
    padding: 40px;
}

#calculator-form {
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    flex: 1;
    min-width: 120px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9em;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    padding-right: 35px;
}

.form-group select:hover {
    border-color: #667eea;
}

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

.form-group select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.loading-indicator {
    position: absolute;
    right: 12px;
    top: 42px;
    font-size: 0.75em;
    color: #667eea;
    font-style: italic;
}

#result-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e0e0e0;
}

#result-section h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #333;
}

#result-json {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #333;
    max-height: 600px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    main {
        padding: 20px;
    }

    #calculator-form {
        flex-direction: column;
    }

    .form-group {
        min-width: 100%;
    }

    .form-group select {
        padding: 12px 15px;
        padding-right: 35px;
    }

    .loading-indicator {
        top: 50px;
        right: 15px;
    }
}
