/* assets/css/style.css */

/* --- 1. 基本スタイル --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}
.container {
    max-width: 960px;
    margin: 20px auto;
    padding: 0 20px;
}

/* --- 2. ヘッダー & フッター --- */
header {
    background: #333;
    color: #fff;
    padding: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header h1 a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
}
header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}
header nav ul li {
    margin-right: 20px;
}
header nav ul li a {
    color: #fff;
    text-decoration: none;
}
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #777;
}

/* --- 3. メインコンテンツ & カード --- */
main {
    padding: 20px;
}
.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

/* --- 4. フォーム要素 --- */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* paddingを含めてwidth 100%にする */
    font-family: inherit;
}
.form-group-inline {
    display: flex;
    gap: 20px; /* 要素間のスペース */
}
.inline-form {
    display: inline;
}

/* --- 5. ボタン --- */
button, .button {
    cursor: pointer;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    color: #fff;
    background-color: #007bff;
    text-decoration: none;
    display: inline-block;
}
.btn-in { background-color: #28a745; }
.btn-out { background-color: #ffc107; color: #333; }
.btn-complete { background-color: #17a2b8; }
.btn-delete { background-color: #dc3545; font-size: 0.8em; padding: 5px 8px;}

/* 管理者画面用ボタン */
.btn-cancel, .btn-edit, .btn-reset {
    padding: 5px 8px;
    font-size: 0.8em;
    text-decoration: none;
    border-radius: 4px;
    color: white;
    border: none;
    cursor: pointer;
}
.btn-cancel { background-color: #6c757d; }
.btn-edit { background-color: #ffc107; color: #333; }
.btn-reset { background-color: #17a2b8; }


/* --- 6. テーブル --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
th {
    background-color: #f2f2f2;
}

/* --- 7. ログインページ --- */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.login-container {
    width: 320px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 5px;
}

/* --- 8. メッセージ表示 (エラー、成功) --- */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid;
}
.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}


/* --- 9. カレンダースタイル --- */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
}
.calendar-header h3 {
    margin: 0;
}
.calendar {
    width: 100%;
    table-layout: fixed; /* セルの幅を均等に */
}
.calendar th, .calendar td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: top;
    height: 120px;
}
.calendar th {
    background-color: #f2f2f2;
    height: auto;
    text-align: center;
}
.calendar td .day-number {
    font-size: 0.9em;
    font-weight: bold;
    display: block;
    text-align: right;
}
.calendar td .day-number.today {
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    float: right;
}
.event {
    font-size: 0.8em;
    background-color: #e7f3ff;
    border-left: 3px solid #007bff;
    padding: 3px;
    margin-top: 3px;
    border-radius: 2px;
    position: relative;
    word-wrap: break-word; /* 長いテキストを折り返す */
}
.delete-event-form {
    display: inline;
    position: absolute;
    top: 1px;
    right: 1px;
}
.delete-event-form button {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 4px;
    line-height: 1;
}
.delete-event-form button:hover {
    color: #dc3545;
}


/* --- 10. 管理画面 --- */
.admin-nav {
    background-color: #555;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}
.admin-nav a {
    color: white;
    margin-right: 15px;
    text-decoration: none;
}
.admin-nav a:hover {
    text-decoration: underline;
}