:root {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --success-color: #10b981;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --background-color: #f9fafb;
    --card-background: #ffffff;
    --input-background: #f3f4f6;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 2rem;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.calculator {
    background: var(--card-background);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.2s;
}

.input-group:hover {
    transform: translateX(4px);
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-with-prefix,
.input-with-suffix {
    display: flex;
    align-items: center;
    background-color: var(--input-background);
    border: 2px solid transparent;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s;
}

.input-with-prefix:focus-within,
.input-with-suffix:focus-within {
    border-color: var(--primary-color);
    background-color: var(--card-background);
}

.prefix,
.suffix {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
}

input[type="number"] {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
    border: none;
    outline: none;
    color: var(--text-color);
    background: transparent;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper select {
    width: 100%;
    padding: 0.75rem;
    padding-right: 2.5rem;
    font-size: 1rem;
    background-color: var(--input-background);
    border: 2px solid transparent;
    border-radius: 0.75rem;
    color: var(--text-color);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.select-wrapper select:focus {
    border-color: var(--primary-color);
    background-color: var(--card-background);
}

.select-wrapper:hover select {
    background-color: var(--card-background);
}

.select-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.2s;
}

.select-wrapper:hover .select-arrow {
    color: var(--primary-color);
}

.select-wrapper select:focus + .select-arrow {
    color: var(--primary-color);
    transform: translateY(-50%) rotate(180deg);
}

.result-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    padding: 2rem;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    color: white;
}

.result-group h3 {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.result {
    font-size: 2.5rem;
    font-weight: 600;
    color: white;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.detail-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-group label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.detail {
    font-size: 1.125rem;
    font-weight: 500;
}

.chart-container {
    grid-column: span 2;
    min-height: 400px;
    width: 100%;
    padding: 1.5rem 0;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--card-background);
    border-radius: 0.75rem;
}

.info-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.info-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.info-section p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.formula {
    padding: 1.5rem;
    margin: 1rem 0;
    background-color: var(--input-background);
    border-radius: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 1rem;
    color: var(--primary-color);
    overflow-x: auto;
    text-align: center;
}

.info-section ul {
    padding-left: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.info-section li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    position: relative;
}

.info-section li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: -1rem;
}

.info-section strong {
    color: var(--primary-color);
    font-weight: 500;
}

@media (max-width: 768px) {
    .calculator {
        grid-template-columns: 1fr;
    }

    .chart-container {
        grid-column: 1;
    }

    .info-container {
        grid-template-columns: 1fr;
    }
}