/* WorkTime - 完全無料勤怠管理アプリ */

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

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #2c3e50;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.wide-container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

h1 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  font-weight: 700;
}

h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 600;
  border-left: 5px solid #667eea;
  padding-left: 15px;
}

h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.3rem;
  font-weight: 600;
}

.header-info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  text-align: center;
}

.info-box {
  background: #e8f5e9;
  border: 2px solid #4caf50;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
}

.warning-box {
  background: #fff3cd;
  border: 2px solid #ffc107;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  color: #856404;
}

.error-box {
  background: #f8d7da;
  border: 2px solid #f5c6cb;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  color: #721c24;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

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

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-success {
  background: #4caf50;
  color: white;
}

.btn-success:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-danger {
  background: #f44336;
  color: white;
}

.btn-danger:hover {
  background: #da190b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

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

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
  display: block;
}

.card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin: 15px 0;
  border: 2px solid #e1e8ed;
}

.card-header {
  font-weight: 600;
  margin-bottom: 10px;
  color: #2c3e50;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: white;
}

table thead {
  background: #667eea;
  color: white;
}

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

table tbody tr:hover {
  background: #f8f9fa;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.status-badge.working {
  background: #d4edda;
  color: #155724;
}

.status-badge.off-work {
  background: #cce5ff;
  color: #004085;
}

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

.clock-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  margin: 20px 0;
}

.clock-display .time {
  font-size: 3rem;
  font-weight: 700;
  margin: 10px 0;
}

.clock-display .date {
  font-size: 1.2rem;
  opacity: 0.9;
}

.attendance-info {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
}

.attendance-info .item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e1e8ed;
}

.attendance-info .item:last-child {
  border-bottom: none;
}

.employee-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.employee-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e1e8ed;
  cursor: pointer;
  transition: all 0.3s;
}

.employee-card:hover {
  border-color: #667eea;
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.employee-card .name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2c3e50;
}

.employee-card .email {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
}

.modal-close:hover {
  color: #2c3e50;
}

/* モバイル対応（タブレット・スマートフォン） */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container, .wide-container {
    padding: 15px;
    border-radius: 10px;
  }
  
  h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
  
  h2 {
    font-size: 1.2rem;
  }
  
  h3 {
    font-size: 1.1rem;
  }
  
  .clock-display .time {
    font-size: 2rem;
  }
  
  .employee-list {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* テーブルの横スクロール対応 */
  table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  table th,
  table td {
    padding: 8px 6px;
    min-width: 80px;
  }
  
  /* ボタンのタッチ操作最適化 */
  .btn {
    padding: 14px 20px;
    font-size: 1rem;
    min-height: 44px; /* タッチターゲットの最小サイズ */
    touch-action: manipulation; /* ダブルタップズームを防ぐ */
  }
  
  .btn-sm {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-height: 40px;
  }
  
  /* 入力フォームの最適化 */
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 14px;
    font-size: 16px; /* iOSのズームを防ぐ */
    min-height: 44px;
  }
  
  /* カードの最適化 */
  .card {
    padding: 15px;
  }
  
  .employee-card {
    padding: 15px;
  }
  
  .application-card {
    padding: 15px;
  }
  
  /* モーダルの最適化 */
  .modal-content {
    width: 95%;
    max-width: 95%;
    margin: 10px auto;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  /* グリッドレイアウトの最適化 */
  .application-list {
    grid-template-columns: 1fr;
  }
  
  /* フレックスボックスの最適化 */
  .application-actions {
    flex-direction: column;
  }
  
  .application-actions .btn {
    width: 100%;
  }
  
  /* フィルターコントロールの最適化 */
  .attendance-filter-controls {
    flex-direction: column;
  }
  
  .attendance-filter-controls label {
    width: 100%;
  }
  
  .attendance-filter-controls select {
    width: 100%;
  }
}

/* ローディングアニメーション */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ユーティリティクラス */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none;
}

/* 申請カードスタイル */
.application-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.application-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e1e8ed;
  transition: all 0.3s;
}

.application-card.pending {
  border-color: #ffc107;
  background: #fffbf0;
}

.application-card.approved {
  border-color: #28a745;
  background: #f8fff8;
}

.application-card.rejected {
  border-color: #dc3545;
  background: #fff8f8;
}

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

.application-type {
  background: #667eea;
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.9rem;
  font-weight: 600;
}

.application-time {
  color: #6c757d;
  font-size: 0.9rem;
}

.application-user {
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 10px;
}

.application-content {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  line-height: 1.5;
}

.application-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.application-status {
  text-align: center;
}

.status-badge.approved {
  background: #d4edda;
  color: #155724;
}

.status-badge.rejected {
  background: #f8d7da;
  color: #721c24;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

