/*
 * 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;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

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

/* Header styles */
.navbar {
  background-color: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: #007bff;
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  gap: 1rem;
}

.nav-link {
  color: #333;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.nav-link:hover {
  background-color: #f8f9fa;
  color: #007bff;
}

/* Main content */
.main-content {
  min-height: calc(100vh - 80px);
  padding: 2rem 0;
}

/* Alert styles */
.alert {
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
  font-weight: 500;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Button styles */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
  color: white;
}

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

.btn-secondary:hover {
  background-color: #545b62;
  color: white;
}

.btn-full {
  width: 100%;
}

/* Form styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-text {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.form-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

/* Auth form styles */
.auth-form {
  max-width: 500px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h2 {
  color: #333;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: #6c757d;
}

.form-section {
  margin-bottom: 2rem;
}

.form-section h3 {
  color: #333;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.auth-links {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e9ecef;
}

.auth-links a {
  color: #007bff;
  text-decoration: none;
  margin: 0 1rem;
}

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

/* Hero section */
.hero-section {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Features section */
.features-section {
  padding: 4rem 0;
  background: white;
}

.features-section h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: #333;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-item {
  text-align: center;
  padding: 2rem;
  border-radius: 8px;
  background: #f8f9fa;
}

.feature-item h3 {
  color: #333;
  margin-bottom: 1rem;
}

/* Dashboard styles */
.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  color: #333;
  margin-bottom: 0.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-item {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-item h3 {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #6c757d;
  font-size: 0.9rem;
}

/* Profile styles */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.profile-section {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.profile-section h2 {
  color: #333;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.profile-field {
  margin-bottom: 1.5rem;
}

.profile-field label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
  display: block;
}

.profile-field p {
  color: #333;
  margin: 0;
}

/* Table styles */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

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

/* Utility classes */
.no-data {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 2rem;
}

.note {
  color: #6c757d;
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* Admin specific styles */
.admin-auth {
  border-top: 4px solid #dc3545;
}

.admin-dashboard .dashboard-header {
  border-left: 4px solid #dc3545;
  padding-left: 1rem;
}

/*--------------------------------------
 * Plan Management Styles
 *--------------------------------------*/

/* Plan info section */
.plan-info {
  margin-bottom: 3rem;
}

.plan-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border-top: 4px solid #007bff;
}

.plan-card.free-plan {
  border-top-color: #28a745;
}

.plan-card.basic-plan {
  border-top-color: #007bff;
}

.plan-card.premium-plan {
  border-top-color: #ffc107;
}

.plan-header {
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e9ecef;
}

.plan-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.5rem;
}

.plan-details {
  padding: 2rem;
}

.expiry-info {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #e3f2fd;
  border-radius: 6px;
  border-left: 4px solid #2196f3;
}

.days-remaining {
  color: #1976d2;
  font-weight: 600;
}

.plan-limits h4 {
  margin-bottom: 1rem;
  color: #333;
}

.plan-limits ul {
  list-style: none;
  padding: 0;
}

.plan-limits li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.plan-limits li:last-child {
  border-bottom: none;
}

.plan-actions {
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

/* Plan badges */
.plan-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-badge.free-plan {
  background: #d4edda;
  color: #155724;
}

.plan-badge.basic-plan {
  background: #cce5ff;
  color: #004085;
}

.plan-badge.premium-plan {
  background: #fff3cd;
  color: #856404;
}

.plan-badge.large {
  padding: 0.5rem 1rem;
  font-size: 1rem;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.5rem;
}

.status-badge.active {
  background: #d1ecf1;
  color: #0c5460;
}

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

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

.status-badge.large {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Plan limits list */
.plan-limits-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plan-limits-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.plan-limits-list li:last-child {
  border-bottom: none;
}

/*--------------------------------------
 * Admin Plan Statistics
 *--------------------------------------*/

.plan-statistics {
  margin-bottom: 3rem;
}

.plan-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.plan-stat-item {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
  border-top: 4px solid #007bff;
}

.plan-stat-item.free-plan {
  border-top-color: #28a745;
}

.plan-stat-item.basic-plan {
  border-top-color: #007bff;
}

.plan-stat-item.premium-plan {
  border-top-color: #ffc107;
}

.plan-stat-item h4 {
  color: #333;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.plan-count {
  font-size: 2rem;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 0.5rem;
}

.plan-percentage {
  color: #6c757d;
  font-size: 0.9rem;
}

/*--------------------------------------
 * Admin User Management
 *--------------------------------------*/

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e9ecef;
}

.page-header h1 {
  color: #333;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

/* Search and filters */
.search-filters {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.search-form .search-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
}

.search-field,
.filter-field {
  display: flex;
  flex-direction: column;
}

.search-field label,
.filter-field label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

.form-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  background: white;
}

.search-actions {
  display: flex;
  gap: 0.5rem;
}

/* Users stats */
.users-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
}

.users-stats .stat-item {
  background: none;
  box-shadow: none;
  padding: 0;
  text-align: left;
}

.stat-label {
  font-weight: 600;
  color: #6c757d;
}

.stat-value {
  font-weight: bold;
  color: #007bff;
}

/* Users table */
.users-table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.users-table {
  margin: 0;
  box-shadow: none;
}

.users-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
  border-bottom: 2px solid #e9ecef;
}

.users-table td {
  vertical-align: middle;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

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

.btn-danger:hover {
  background-color: #c82333;
}

.table-actions {
  padding: 1rem;
  background: #f8f9fa;
  text-align: center;
}

.no-users {
  padding: 3rem;
  text-align: center;
  color: #6c757d;
}

/*--------------------------------------
 * Admin User Detail & Edit
 *--------------------------------------*/

.user-details {
  max-width: 800px;
}

.detail-section {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.detail-section h2 {
  color: #333;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.detail-item {
  margin-bottom: 1rem;
}

.detail-item label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
  display: block;
}

.detail-item p {
  color: #333;
  margin: 0;
}

.plan-details-card {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.plan-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.plan-info-item {
  margin-bottom: 1rem;
}

.bio-content {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #007bff;
}

.admin-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Form styles for admin edit */
.edit-form-container {
  max-width: 800px;
}

.user-edit-form {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.form-field {
  margin-bottom: 1.5rem;
}

.form-field label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
  display: block;
}

.form-help {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.25rem;
  display: block;
}

.plan-limits-display {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 6px;
}

.limit-item {
  text-align: center;
}

.limit-item label {
  font-weight: 600;
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: block;
}

.limit-item p {
  margin: 0;
  font-size: 1.25rem;
}

.error-messages {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 2rem;
  border: 1px solid #f5c6cb;
}

.error-messages h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.error-messages ul {
  margin: 0;
  padding-left: 1.5rem;
}

.text-muted {
  color: #6c757d !important;
}

/* Responsive design */
@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
    gap: 1rem;
  }

  .navbar-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .profile-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .form-actions {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .plan-stats-grid {
    grid-template-columns: 1fr;
  }

  .search-form .search-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .search-actions {
    justify-content: stretch;
  }

  .search-actions .btn {
    flex: 1;
  }

  .users-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .header-actions {
    flex-direction: column;
  }

  .admin-actions {
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .plan-info-grid {
    grid-template-columns: 1fr;
  }

  .plan-limits-display {
    grid-template-columns: 1fr;
  }
}

/*--------------------------------------
/* App Layout (ログイン後)
/*--------------------------------------*/
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* サイドバー */
.sidebar {
  width: 280px;
  background: #ffffff;
  color: #333333;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  border-right: 1px solid #e9ecef;
  box-shadow: 2px 0 4px rgba(0,0,0,0.05);
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid #e9ecef;
}

.sidebar-header .logo {
  text-decoration: none;
}

.sidebar-header .logo h1 {
  color: #2c3e50;
  font-size: 1.5rem;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-nav ul {
  list-style: none;
}

.nav-item {
  margin: 0.25rem 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #6c757d;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin: 0.25rem 1rem;
  text-decoration: none;
}

.nav-link:hover {
  background: #f8f9fa;
  color: #2c3e50;
}

.nav-link.active {
  background: #2c3e50;
  color: white;
}

.nav-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-icon {
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

.nav-text {
  font-weight: 500;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #e9ecef;
}

.user-info {
  margin-bottom: 1rem;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #2c3e50;
}

.user-plan {
  font-size: 0.8rem;
  color: #6c757d;
}

.logout-btn {
  display: block;
  width: 100%;
  padding: 0.5rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  color: #6c757d;
  text-align: center;
  transition: all 0.3s ease;
  text-decoration: none;
}

.logout-btn:hover {
  background: #e9ecef;
  color: #495057;
}

/* メインコンテンツエリア */
.main-content {
  margin-left: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* トップバー */
.topbar {
  background: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-bottom: 1px solid #e9ecef;
}

.topbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  color: #333;
  font-size: 1.5rem;
  font-weight: 600;
}

/* ページコンテンツ */
.page-content {
  flex: 1;
  padding: 2rem;
}

/* アプリ内フッター */
.app-footer {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: 1rem 2rem;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-link {
  color: #6c757d;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #495057;
}

.footer-copyright {
  color: #6c757d;
  font-size: 0.85rem;
}

/*--------------------------------------
/* Public Layout (ログイン前)
/*--------------------------------------*/
.public-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.public-header {
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 1rem 0;
}

.public-header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.public-header .logo {
  text-decoration: none;
}

.public-header .logo h1 {
  color: #667eea;
  font-size: 1.8rem;
  font-weight: 700;
}

.public-nav {
  display: flex;
  gap: 1rem;
}

.public-content {
  flex: 1;
  padding: 2rem 0;
}

.public-footer {
  background: #343a40;
  color: white;
  padding: 2rem 0;
  margin-top: auto;
}

.public-footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.public-footer .footer-links {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.public-footer .footer-link {
  color: #adb5bd;
  transition: color 0.3s ease;
}

.public-footer .footer-link:hover {
  color: white;
}

.public-footer .footer-copyright {
  color: #6c757d;
  font-size: 0.9rem;
}

/*--------------------------------------
/* Admin Layout (管理者)
/*--------------------------------------*/
.admin-app-layout {
  display: flex;
  min-height: 100vh;
}

/* 管理者サイドバー */
.admin-sidebar {
  width: 280px;
  background: linear-gradient(135deg, #495057 0%, #343a40 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.admin-sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-logo {
  text-decoration: none;
  display: block;
}

.admin-logo h1 {
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
}

.admin-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.admin-sidebar-nav ul {
  list-style: none;
}

.admin-nav-item {
  margin: 0.25rem 0;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: rgba(255,255,255,0.8);
  transition: all 0.3s ease;
  border-radius: 0 25px 25px 0;
  margin-right: 1rem;
  text-decoration: none;
}

.admin-nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.admin-nav-link.active {
  background: rgba(255,255,255,0.2);
  color: white;
}

.admin-nav-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-nav-icon {
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

.admin-nav-text {
  font-weight: 500;
}

.admin-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-info {
  margin-bottom: 1rem;
}

.admin-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}

.admin-role {
  font-size: 0.8rem;
  opacity: 0.8;
  margin: 0;
}

.user-site-btn {
  display: block;
  width: 100%;
  padding: 0.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: rgba(255,255,255,0.9);
  text-align: center;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.user-site-btn:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.admin-logout-btn {
  display: block;
  width: 100%;
  padding: 0.5rem;
  background: rgba(220, 53, 69, 0.8);
  border: 1px solid rgba(220, 53, 69, 0.9);
  border-radius: 6px;
  color: white;
  text-align: center;
  transition: all 0.3s ease;
  font-size: 0.85rem;
}

.admin-logout-btn:hover {
  background: #dc3545;
  border-color: #dc3545;
}

/* 管理者メインコンテンツエリア */
.admin-main-content {
  margin-left: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 管理者トップバー */
.admin-topbar {
  background: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-bottom: 1px solid #e9ecef;
}

.admin-topbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-page-title {
  color: #333;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

/* 管理者ページコンテンツ */
.admin-page-content {
  flex: 1;
  padding: 2rem;
}

/* 管理者アプリ内フッター */
.admin-app-footer {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: 1rem 2rem;
  margin-top: auto;
}

.admin-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.admin-footer-links {
  display: flex;
  gap: 2rem;
}

.admin-footer-link {
  color: #6c757d;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.admin-footer-link:hover {
  color: #495057;
}

.admin-footer-copyright {
  color: #6c757d;
  font-size: 0.85rem;
}

.admin-footer-copyright p {
  margin: 0;
}

/*--------------------------------------
/* Responsive Design
/*--------------------------------------*/
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  /* 管理者レスポンシブ */
  .admin-app-layout {
    flex-direction: column;
  }
  
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  
  .admin-main-content {
    margin-left: 0;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
  
  .public-footer .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
  
  .admin-footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .admin-footer-links {
    flex-direction: column;
    gap: 1rem;
  }
}

/*--------------------------------------
/* Component Styles
/*--------------------------------------*/
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

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

.btn-primary:hover {
  background: #5a6fd8;
}

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

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

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

.btn-danger:hover {
  background: #c82333;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
}

.alert-success {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.alert-danger {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/*--------------------------------------
/* Dashboard Styles
/*--------------------------------------*/
.dashboard .container {
  max-width: none;
  padding: 0;
}

.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-item {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-align: center;
}

.stat-item h3 {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #667eea;
  margin: 0.5rem 0;
}

.stat-label {
  color: #6c757d;
  font-size: 0.8rem;
}

/*--------------------------------------
/* Plan Information Styles
/*--------------------------------------*/
.plan-info {
  margin-bottom: 2rem;
}

.plan-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-left: 4px solid #667eea;
}

.plan-card.free-plan {
  border-left-color: #6c757d;
}

.plan-card.basic-plan {
  border-left-color: #28a745;
}

.plan-card.premium-plan {
  border-left-color: #ffc107;
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.plan-header h3 {
  margin: 0;
  color: #333;
}

.plan-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.plan-status.active {
  background: #d4edda;
  color: #155724;
}

.plan-status.expired {
  background: #f8d7da;
  color: #721c24;
}

.plan-limits h4 {
  margin-bottom: 0.5rem;
  color: #495057;
}

.plan-limits ul {
  list-style: none;
  padding: 0;
}

.plan-limits li {
  padding: 0.25rem 0;
  color: #6c757d;
}

.plan-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}

/*--------------------------------------
/* Quick Actions
/*--------------------------------------*/
.quick-actions {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.quick-actions h2 {
  margin-bottom: 1rem;
  color: #333;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/*--------------------------------------
/* Profile Styles
/*--------------------------------------*/
.profile-show, .profile-edit {
  max-width: 800px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.profile-header h1 {
  color: #333;
  margin: 0;
}

.profile-section {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.profile-section h2 {
  color: #495057;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e9ecef;
}

.profile-field {
  margin-bottom: 1rem;
}

.profile-field label {
  display: block;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.25rem;
}

.profile-field p {
  color: #6c757d;
  margin: 0;
}

.plan-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-badge.free-plan {
  background: #e9ecef;
  color: #495057;
}

.plan-badge.basic-plan {
  background: #d4edda;
  color: #155724;
}

.plan-badge.premium-plan {
  background: #fff3cd;
  color: #856404;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

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

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

.status-badge.free {
  background: #e9ecef;
  color: #495057;
}

.plan-limits-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plan-limits-list li {
  padding: 0.25rem 0;
  color: #6c757d;
}

/*--------------------------------------
/* Form Styles
/*--------------------------------------*/
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25);
}

/*--------------------------------------
/* Table Styles
/*--------------------------------------*/
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

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

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

/* Button group styles for plan actions */
.button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.button-group .btn {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

/* Responsive button group */
@media (max-width: 768px) {
  .button-group {
    flex-direction: column;
    gap: 8px;
  }
  
  .button-group .btn {
    width: 100%;
    flex: none;
  }
}

/* Plan comparison styles */
.plan-comparison {
  margin: 20px 0;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.plan-comparison h4 {
  margin-bottom: 16px;
  color: #495057;
  font-size: 1.1rem;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.plan-option {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  position: relative;
}

.plan-option.current {
  border-color: #007bff;
  background-color: #f8f9ff;
}

.plan-option.recommended {
  border-color: #28a745;
  background-color: #f8fff9;
}

.plan-option h5 {
  margin-bottom: 12px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.current-label {
  background-color: #007bff;
  color: white;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: normal;
}

.recommended-label {
  background-color: #28a745;
  color: white;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: normal;
}

.price {
  font-weight: bold;
  color: #495057;
  font-size: 0.9rem;
}

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

.plan-option li {
  padding: 4px 0;
  font-size: 0.9rem;
  color: #6c757d;
}

.plan-option li:before {
  content: "✓";
  color: #28a745;
  font-weight: bold;
  margin-right: 8px;
}

/* Premium button styling */
.btn-premium {
  background-color: #28a745 !important;
  border-color: #28a745 !important;
}

.btn-premium:hover {
  background-color: #218838 !important;
  border-color: #1e7e34 !important;
}

/* Upgrade options styling */
.upgrade-options {
  margin-top: 16px;
}

.upgrade-options .button-group {
  justify-content: flex-start;
}

/*--------------------------------------
/* Admin Specific Styles
/*--------------------------------------*/
.admin-dashboard .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.recent-users {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.recent-users h2 {
  margin-bottom: 1rem;
  color: #333;
}

.users-table {
  overflow-x: auto;
}

.table-actions {
  margin-top: 1rem;
  text-align: center;
}

.no-data {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 2rem;
}

.admin-actions {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-actions h2 {
  margin-bottom: 1rem;
  color: #333;
}

.admin-actions .action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-actions .note {
  margin-top: 1rem;
  color: #6c757d;
  font-size: 0.9rem;
  font-style: italic;
}

/*--------------------------------------
/* Plan Statistics
/*--------------------------------------*/
.plan-statistics {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.plan-statistics h2 {
  margin-bottom: 1rem;
  color: #333;
}

.plan-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.plan-stat-item {
  text-align: center;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.plan-stat-item.free-plan {
  border-left: 4px solid #6c757d;
}

.plan-stat-item.basic-plan {
  border-left: 4px solid #28a745;
}

.plan-stat-item.premium-plan {
  border-left: 4px solid #ffc107;
}

.plan-stat-item h4 {
  margin-bottom: 0.5rem;
  color: #495057;
  font-size: 0.9rem;
}

.plan-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin: 0.25rem 0;
}

.plan-percentage {
  color: #6c757d;
  font-size: 0.8rem;
}

/*--------------------------------------
/* Home Page Styles
/*--------------------------------------*/
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.features-section {
  padding: 4rem 0;
  background: white;
}

.features-section h2 {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2rem;
  color: #333;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-item {
  text-align: center;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  background: #f8f9fa;
}

.feature-item h3 {
  color: #495057;
  margin-bottom: 1rem;
}

.feature-item p {
  color: #6c757d;
  line-height: 1.6;
}
