/* 全体のスタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

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

h1 {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

h2 {
  margin-bottom: 15px;
  color: #34495e;
  font-size: 1.4rem;
}

h3 {
  font-size: 1.1rem;
  color: #7f8c8d;
}

.page {
  width: 100%;
  min-height: 100vh;
}

/* ログイン画面のスタイル */
.login-container {
  max-width: 500px;
  margin: 40px auto;
  padding: 20px;
}

.auth-form {
  display: none;
  background-color: #fff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 25px;
  color: #2c3e50;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.auth-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border 0.3s;
}

.auth-form input:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.auth-form small {
  display: block;
  margin-top: 5px;
  color: #7f8c8d;
  font-size: 12px;
}

.auth-form button {
  width: 100%;
  padding: 12px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.auth-form button:hover {
  background-color: #2980b9;
}

.form-error {
  color: #e74c3c;
  font-size: 14px;
  margin-bottom: 15px;
  min-height: 20px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: #7f8c8d;
}

.auth-switch a {
  color: #3498db;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ヘッダースタイル */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e1e1e1;
}

.app-header h1 {
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

#user-name {
  font-weight: 600;
  color: #2c3e50;
}

#logout-btn {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

#logout-btn:hover {
  background-color: #c0392b;
}

/* フォームスタイル */
.input-form {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

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

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #2980b9;
}

/* サマリースタイル */
.summary {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.summary-items {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.summary-item {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 10px;
}

.summary-item p {
  font-size: 1.2rem;
  font-weight: bold;
  margin-top: 5px;
}

/* 累計表示スタイル */
.accumulative {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  text-align: center;
}

#total-balance {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
}

/* フィルタースタイル */
.filter {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-controls input {
  flex: 1;
}

.filter-controls button {
  min-width: 80px;
}

/* テーブルスタイル */
.transactions {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #f8f9fa;
  font-weight: 600;
}

tbody tr:hover {
  background-color: #f1f1f1;
}

.delete-btn {
  background-color: #e74c3c;
  font-size: 0.9rem;
  padding: 5px 10px;
}

.delete-btn:hover {
  background-color: #c0392b;
}

/* スマートフォン用のレスポンシブ対応 */
@media (max-width: 600px) {
  .login-container {
    margin: 20px auto;
    padding: 15px;
  }

  .auth-form {
    padding: 20px;
  }

  .app-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .user-info {
    width: 100%;
    justify-content: center;
  }

  .summary-items {
    flex-direction: column;
  }

  .summary-item {
    margin-bottom: 10px;
  }

  th,
  td {
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .filter-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-controls input,
  .filter-controls button {
    width: 100%;
    margin-bottom: 10px;
  }

  .filter-controls label {
    margin-bottom: 5px;
  }
}
