/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.sidebar-mini {
  background: #f4f6f9;
}

/* Flash Messages */
p.notice, p.alert,
.flash-notice, .flash-alert {
  position: relative;
  padding: 1rem 3rem 1rem 1.5rem;
  margin: 0;
  text-align: center;
  font-weight: 500;
}

p.notice, .flash-notice {
  background-color: #d4edda;
  color: #155724;
  border-bottom: 2px solid #c3e6cb;
}

p.alert, .flash-alert {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.flash-close {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  color: inherit;
  padding: 0;
}

.flash-close:hover {
  opacity: 1;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
}

/* Auth Container */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 3rem;
  width: 100%;
  max-width: 440px;
}

.auth-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 2rem;
  text-align: center;
  white-space: nowrap;
}

/* Form Styles */
.field {
  margin-bottom: 1.5rem;
}

.field label {
  display: block;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
}

.field input[type="email"]:focus,
.field input[type="password"]:focus,
.field input[type="text"]:focus {
  outline: none;
  border-color: #667eea;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.field input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
}

.field input[type="checkbox"] + label {
  display: inline;
  font-weight: normal;
  margin-bottom: 0;
}

.field p {
  margin: 0;
}

/* Actions */
.actions {
  margin-top: 2rem;
}

.actions input[type="submit"] {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.actions input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.actions input[type="submit"]:active {
  transform: translateY(0);
}

/* Error messages (Devise) */
#error_explanation {
  background-color: #fff5f5;
  border: 1px solid #feb2b2;
  border-radius: 8px;
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  color: #c53030;
  font-size: 0.9rem;
}

#error_explanation .error-summary {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

#error_explanation ul {
  margin: 0;
  padding-left: 1.25rem;
}

#error_explanation li {
  margin-bottom: 0.2rem;
}

/* Links */
.auth-links {
  margin-top: 1.5rem;
  text-align: center;
}

.auth-links a {
  color: #667eea;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.auth-links a:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* Admin Action Buttons
 * show ページ下部と card-footer のボタンに適切なパディングを設定する。
 * テーブル行内の btn-group-sm ボタンは対象外（直接の子要素でないため影響しない）。
 */
.content-wrapper .mb-3 > .btn,
.content-wrapper .card-footer > .btn {
  padding: 0.5rem 1rem;
}

/* Home Page */
.home-container {
  text-align: center;
  color: white;
  padding: 4rem 2rem;
}

.home-container h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.home-container p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.home-nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.home-container .btn {
  padding: 0.875rem 2rem;
  background: white;
  color: #667eea;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: inline-block;
  border: none;
}

.home-container .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  color: #667eea;
}

.home-container .btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.home-container .btn-secondary:hover {
  background: white;
  color: #667eea;
}
