:root {
    --primary-color: #ff4b4b;
    /* Streamlit red-ish similarity or a nice brand color */
    --primary-hover: #e04141;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --font-family: 'Noto Sans JP', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.subtitle {
    color: #666;
    margin-top: 0;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

h2 {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-color);
}

/* File Upload */
.file-drop-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    padding: 40px 20px;
    border: 2px dashed #ccc;
    border-radius: var(--radius);
    transition: 0.2s;
    background-color: #fafafa;
    cursor: pointer;
    box-sizing: border-box;
    /* box-sizing ensures padding doesn't overflow width */
}

.file-drop-area.highlight {
    border-color: var(--primary-color);
    background-color: rgba(255, 75, 75, 0.05);
}

.file-drop-area.active {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.05);
}

.file-msg {
    color: #666;
    text-align: center;
    pointer-events: none;
}

#file-input {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Ruby Inputs */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.btn-remove {
    background: #f1f1f1;
    border: none;
    color: #666;
    width: 40px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.2s;
}

.btn-remove:hover {
    background: #ddd;
    color: #333;
}

.btn-add {
    background: transparent;
    border: 2px dashed #ccc;
    color: #666;
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 500;
    transition: 0.2s;
}

.btn-add:hover {
    border-color: #aaa;
    color: #333;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: 0.2s;
}

.radio-label:hover {
    background-color: #f5f5f5;
}

.radio-label input {
    margin-top: 4px;
    margin-right: 12px;
}

.radio-text {
    display: flex;
    flex-direction: column;
}

.radio-text strong {
    font-weight: 500;
    color: #333;
}

.radio-text .desc {
    font-size: 0.9rem;
    color: #666;
}

/* Submit */
.submit-area {
    margin-top: 30px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: var(--radius);
    cursor: pointer;
    width: 100%;
    box-shadow: var(--shadow-sm);
    transition: 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.flash-messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: var(--radius);
    border: 1px solid #ffcdd2;
}

footer {
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 0;
    }

    .input-group {
        flex-direction: column;
        gap: 5px;
        background: #f9f9f9;
        padding: 10px;
        border-radius: 6px;
        position: relative;
    }

    .btn-remove {
        position: absolute;
        top: 5px;
        right: 5px;
        width: 24px;
        height: 24px;
        line-height: 24px;
        padding: 0;
        font-size: 1rem;
    }
}