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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

header h1 {
    color: #667eea;
    margin-bottom: 15px;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 5px 15px;
    font-size: 14px;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-edit {
    background: #28a745;
    color: white;
    padding: 5px 15px;
    font-size: 14px;
}

.btn-edit:hover {
    background: #218838;
}

main {
    max-width: 900px;
    margin: 0 auto;
}

.events-list-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.events-list-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 24px;
    display: inline-block;
    margin-right: 20px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-event-btn {
    flex: 1;
}

.reset-btn {
    flex: 1;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.event-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #667eea;
    transition: all 0.3s;
}

.event-item:not(.editing) {
    cursor: move;
}

.event-item:not(.editing):hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.event-item.dragging {
    opacity: 0.5;
}

.event-item.drag-over {
    border-top: 3px solid #667eea;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.event-info {
    flex: 1;
}

.event-time {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.event-duration {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
}

.event-name {
    font-size: 18px;
    color: #333;
}

.event-actions {
    display: flex;
    gap: 10px;
}

.drag-handle {
    cursor: move;
    color: #6c757d;
    font-size: 24px;
    margin-right: 10px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state p {
    font-size: 18px;
}

/* 編集モード */
.event-item.editing {
    background: #e7f3ff;
}

.event-item.editing .event-display {
    display: none;
}

.event-item .event-edit-form {
    display: none;
}

.event-item.editing .event-edit-form {
    display: block;
}

.event-edit-form .form-group {
    margin-bottom: 10px;
}

.event-edit-form .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-save {
    background: #28a745;
    color: white;
    padding: 8px 20px;
    font-size: 14px;
}

.btn-save:hover {
    background: #218838;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    padding: 8px 20px;
    font-size: 14px;
}

.btn-cancel:hover {
    background: #5a6268;
}

/* ルビボタン */
.ruby-btn {
    background: #9c27b0;
    color: white;
    padding: 5px 15px;
    font-size: 14px;
}

.ruby-btn:hover {
    background: #7b1fa2;
}

.ruby-auto-btn {
    background: #ff9800;
    color: white;
    padding: 5px 15px;
    font-size: 14px;
}

.ruby-auto-btn:hover {
    background: #f57c00;
}

.ruby-controls {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.ruby-help {
    font-size: 0.85em;
    color: #666;
    margin-top: 3px;
}
