:root {
    --bg-color: #0f172a;
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --warning-color: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

header p {
    color: var(--text-muted);
    font-size: 14px;
}

.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 25px;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #e2e8f0;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-muted);
}

.checkbox-group, .radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-group.nested {
    margin-left: 20px;
    margin-top: 10px;
    padding-left: 15px;
    border-left: 2px solid var(--glass-border);
}

input[type="checkbox"], input[type="radio"] {
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
    margin-right: 10px;
    vertical-align: middle;
}

.text-input, .time-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.text-input:focus, .time-input:focus {
    border-color: var(--primary-color);
}

.hidden {
    display: none !important;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn:not(:disabled):active {
    transform: scale(0.98);
}

.submit-btn.primary { background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }
.submit-btn.secondary { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4); }
.submit-btn.warning { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); }
.submit-btn.success { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4); }

.list-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: flex-end; /* 下寄せに変更 */
    z-index: 100;
}

.modal-content {
    background: #1e293b;
    padding: 25px 25px 40px;
    border-radius: 24px 24px 0 0; /* 下側は角丸なし、上側だけ角丸 */
    width: 100%;
    max-width: 500px; /* glass-containerの最大幅に合わせる */
    border: 1px solid var(--glass-border);
    border-bottom: none;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #e2e8f0;
}

#confirm-details {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 15px;
}

.cancel-btn, .confirm-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.cancel-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
}

.confirm-btn {
    background: var(--primary-color);
    color: white;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.accordion-header {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.accordion-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 2px solid var(--primary-color);
    margin-left: 10px;
    margin-bottom: 5px;
}

.toggle-group label.active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Settings Area */
.settings-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 10px 15px;
    margin: 15px auto 0;
    width: fit-content;
    max-width: 100%;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-out;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-main);
    font-weight: 500;
    user-select: none;
}
