:root {
    --primary-color: #4CAF50;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
}

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    background: #eef6ec;
    margin: 0;
    padding: 0;
    color: var(--text-color);
}
/* ===== サイドバー ===== */
.sidebar {
  width: 250px;
  height: 100vh;
  background-color: #2d3232;
  color: white;
  padding-top: 20px;
  position: fixed;
  top: 0;
  right: -250px;
  transition: right 0.3s ease;
  z-index: 200;
}

.sidebar.open {
  right: 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li a {
  display: block;
  padding: 15px 20px;
  text-decoration: none;
  color: white;
  border-bottom: 1px solid #444;
}

.sidebar ul li a:hover {
  background-color: #45514f;
}

/* ===== メニューボタン (PC表示時) ===== */
.menu-button {
  position: fixed;
  top: 5%;
  right: 20px;
  z-index: 250;
  background-color: gray;
  color: white;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 4px;
}

.menu-button:hover {
  background-color: rgb(113, 113, 113);
}

/* ===== オーバーレイ背景 ===== */
.overlay-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 150;
}

.overlay-bg.show {
  opacity: 1;
  visibility: visible;
}

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

/* ヘッダー */
.diary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.add-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.add-btn:hover {
    background-color: #45a049;
}

/* グリッドレイアウト */
.diary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* カードスタイル */
.diary-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s;
}

.diary-card:hover {
    transform: translateY(-5px);
}

.diary-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #eee;
}

.diary-content {
    padding: 15px;
}

.diary-date {
    font-size: 12px;
    color: #888;
    display: block;
    margin-bottom: 5px;
}

.diary-title {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.diary-text {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.diary-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.edit-btn, .delete-btn {
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.edit-btn { background-color: #e0f2f1; color: #00695c; }
.delete-btn { background-color: #ffebee; color: #c62828; }

/* モーダル */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
}

.modal-content {
    background-color: #fff;
    margin: 10% auto; 
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover { color: #000; }

/* フォーム */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box; /* 枠線を幅に含める */
}

.submit-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
    .menu-button {
        display: none;
    }

    .modal-content{
	margin: 0;
	position: fixed;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: calc(100% - 24px);
	max-width: none;
	border-radius: 16px 16px 0 0;
    }

    /* ===== 新しいモバイルナビバー ===== */
    .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around; /* 均等配置 */
    align-items: center;
    background-color: #2a9d8f;
    padding: 10px 0;
    border-top: 2px solid #1c6f64;
    z-index: 300;
    }

    /* ===== 各リンク要素 ===== */
    .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* 中央寄せ */
    text-decoration: none;
    color: white;
    font-size: 0.8rem;
    width: 20%; /* 3～5個の均等幅 */
    }


    /* ===== 画像アイコン部分 ===== */
    .mobile-nav a img {
    width: 28px;   /* すべて統一サイズ */
    height: 28px;
    object-fit: contain;
    display: block;
    margin: 0 auto; /* 中央寄せ */
    }

    footer {
    margin-bottom: 60px; /* ナビ分の余白 */
    text-align: center;
    }

    footer p {
    font-size: 0.7rem;
    padding: 0 8px;
    }
}
