.profile-main {
  padding-top: 80px;
  padding-bottom: 100px;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fffe 0%, #f0f9f4 100%);
}

.profile-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background: #f8fafc;
  min-height: 100vh;
}

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

/* プロフィールヘッダー */
.profile-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 3rem;
  color: white;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.profile-avatar-section {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.profile-avatar {
  position: relative;
  width: 120px;
  height: 120px;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.profile-avatar:hover img {
  transform: scale(1.05);
}

.avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #7fb069;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.avatar-edit-btn:hover {
  background: #6a9c57;
  transform: scale(1.1);
}

.profile-basic-info h1 {
  font-size: 2rem;
  color: #2d5a27;
  margin: 0 0 0.5rem 0;
  font-weight: 700;
}

.profile-info h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-type {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0 0 0.25rem 0;
}

.profile-region {
  font-size: 1rem;
  opacity: 0.8;
  margin: 0 0 1.5rem 0;
}

.profile-basic-info p {
  margin: 0.25rem 0;
  color: #6b7280;
  font-size: 1rem;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-actions .btn {
  min-width: 160px;
  justify-content: center;
}

.btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, #2d5a27, #7fb069);
  color: white;
  box-shadow: 0 4px 15px rgba(45, 90, 39, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 90, 39, 0.4);
}

.btn-secondary {
  background: white;
  color: #2d5a27;
  border: 2px solid #2d5a27;
}

.btn-secondary:hover {
  background: #2d5a27;
  color: white;
}

/* プロフィール統計 */
.profile-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat-item {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: #2d5a27;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #6b7280;
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* プロフィールセクション */
.profile-section {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.section-title {
  font-size: 1.5rem;
  color: #2d3748;
  margin: 0 0 1.5rem 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title i {
  color: #7fb069;
  font-size: 1.25rem;
}

/* SDGs関心領域 */
.sdg-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sdg-interest-item {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.sdg-interest-item:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sdg-interest-item::after {
  content: attr(data-title);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sdg-interest-item:hover::after {
  opacity: 1;
}

/* タブナビゲーション */
.profile-tabs {
  display: flex;
  background: white;
  border-radius: 16px;
  padding: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.3s ease;
  white-space: nowrap;
  min-width: 120px;
}

.tab-btn.active {
  background: linear-gradient(135deg, #2d5a27, #7fb069);
  color: white;
  box-shadow: 0 2px 8px rgba(45, 90, 39, 0.3);
}

.tab-btn:hover:not(.active) {
  background: #f3f4f6;
  color: #2d5a27;
}

/* タブコンテンツ */
.tab-content {
  display: none;
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  min-height: 400px;
}

.tab-content.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 投稿グリッド */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.post-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  aspect-ratio: 1;
}

.post-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-item:hover .post-item-overlay {
  opacity: 1;
}

.post-stats {
  color: white;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ディスカッションリスト */
.discussions-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.discussion-item {
  padding: 1.5rem;
  border: 2px solid #f3f4f6;
  border-radius: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.discussion-item:hover {
  border-color: #7fb069;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.discussion-item h4 {
  color: #2d3748;
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.discussion-item p {
  color: #718096;
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

.discussion-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.discussion-date {
  color: #9ca3af;
  font-size: 0.9rem;
}

.sdg-mini-tag {
  padding: 4px 8px;
  border-radius: 6px;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
}

/* 実績グリッド */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.5rem;
}

.achievement-item {
  text-align: center;
  padding: 2rem 1rem;
  border: 2px solid #f3f4f6;
  border-radius: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.achievement-item:hover {
  border-color: #7fb069;
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.achievement-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #7fb069, #6a9c57);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  font-size: 1.5rem;
}

.achievement-title {
  font-weight: 700;
  color: #2d3748;
  font-size: 1rem;
}

/* 空のメッセージ */
.empty-message {
  text-align: center;
  color: #9ca3af;
  font-size: 1.1rem;
  padding: 3rem;
  font-style: italic;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #718096;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #cbd5e0;
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

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

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #718096;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #f7fafc;
  color: #2d3748;
}

.modal-body {
  padding: 2rem;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #7fb069;
  box-shadow: 0 0 0 3px rgba(127, 176, 105, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

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

/* QR設定 */
.qr-settings h3 {
  color: #2d5a27;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.qr-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.qr-option {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.qr-result {
  text-align: center;
  margin-top: 2rem;
}

.qr-code-container {
  margin-bottom: 1.5rem;
}

.qr-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.qr-note {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .profile-container {
    padding: 1rem;
  }

  .container {
    padding: 0 1rem;
  }

  .profile-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
    padding: 2rem;
  }

  .profile-avatar-section {
    flex-direction: column;
    text-align: center;
  }

  .profile-info h1 {
    font-size: 2rem;
  }

  .profile-stats {
    justify-content: center;
  }

  .profile-actions {
    flex-direction: row;
    justify-content: center;
  }

  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .section-title {
    font-size: 1.25rem;
  }

  .modal-content {
    width: 95%;
    margin: 1rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

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

@media (max-width: 480px) {
  .profile-header {
    padding: 1.5rem;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
  }

  .profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
  }

  .profile-avatar:hover img {
    transform: scale(1.05);
  }

  .profile-info h1 {
    font-size: 1.75rem;
  }

  .profile-stats {
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .profile-section {
    padding: 1.5rem;
  }

  .activity-card {
    padding: 1rem;
  }

  .sdg-tag {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
}

/* タブレット以上 */
@media (min-width: 768px) {
  .profile-avatar img {
    width: 120px;
    height: 120px;
  }

  .avatar-edit-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .profile-basic-info h1 {
    font-size: 2rem;
  }

  .profile-actions {
    flex-direction: row;
  }

  .profile-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .achievements-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .modal-content {
    margin: 5% auto;
    width: 90%;
    max-width: 600px;
    height: auto;
    max-height: 80vh;
    position: relative;
    border-radius: var(--border-radius);
  }

  .sdg-interests {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }

  .sdg-interest-item {
    width: 60px;
    height: 60px;
  }
}

/* デスクトップ */
@media (min-width: 1024px) {
  .profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .profile-avatar-section {
    margin-bottom: 0;
  }

  .profile-actions {
    flex-direction: column;
    width: auto;
  }

  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}
