:root {
    --primary-color: #0F172A;
    --accent-color: #6366F1;
    --gradient-start: #818CF8;
    --gradient-end: #6366F1;
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-color: #334155;
    --border-radius: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
}

.card-wrapper {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
}

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

.header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-color), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.header .subtitle {
    color: #64748B;
    font-size: 1.2rem;
    font-weight: 500;
}

.ratio-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.ratio-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #F8FAFC;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
}

.ratio-tab:hover {
    transform: translateY(-2px);
    background: #F1F5F9;
}

.ratio-tab.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.ratio-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.ratio-value {
    font-size: 0.9rem;
    opacity: 0.8;
}

.input-preview-section {
    background: #F8FAFC;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    margin: 3rem 0;
}

.total-input {
    text-align: center;
    margin-bottom: 3rem;
}

.total-input input {
    font-size: 2.5rem;
    font-weight: 700;
    width: 200px;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.total-input label {
    display: block;
    color: #64748B;
    font-size: 1rem;
    font-weight: 500;
}

.ratio-preview {
    margin-top: 2rem;
}

.bar-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

.ratio-bar {
    position: relative;
    height: 80px;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    transition: all 0.3s ease-in-out;
    width: 100%;
}

.ratio-bar:last-child {
    margin-bottom: 0;
}

.bar-input {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    width: 120px;
    text-align: center;
    backdrop-filter: blur(4px);
}

.bar-label {
    color: white;
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.precision-control {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.precision-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    background: #F1F5F9;
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.precision-btn:hover {
    background: #E2E8F0;
}

.precision-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.info-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid #F1F5F9;
}

.info-section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

.info-content p {
    color: #64748B;
    line-height: 1.8;
    font-size: 1.1rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .card-wrapper {
        padding: 2rem;
    }

    .header h1 {
        font-size: 2.5rem;
    }

    .total-input input {
        font-size: 2rem;
    }

    .ratio-bar {
        height: 60px;
    }

    .bar-input {
        font-size: 1.2rem;
        width: 100px;
    }
}

@keyframes barWidth {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.ratio-bar {
    transform-origin: left;
    animation: barWidth 0.3s ease-out forwards;
} 