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

html,
body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;
}

body {
  /* グラデーション背景を指定通り設定 */
  background: linear-gradient(180deg, #529bdc 0%, #4089d9 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Container */
.container {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.content-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

/* Logo */
.logo-container {
  display: flex;
  justify-content: center;
}

.logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

/* トップページのロゴをさらに大きくするクラス */
.logo-large {
  width: 120px;
  height: 120px;
}

@media (min-width: 768px) {
  .logo {
    width: 100px;
    height: 100px;
  }

  /* PC表示時のロゴサイズを拡大 */
  .logo-large {
    width: 160px;
    height: 160px;
  }
}

/* Catchcopy */
.catchcopy {
  text-align: center;
}

.catchcopy h1 {
  font-size: 28px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .catchcopy h1 {
    font-size: 36px;
  }
}

/* Login Button */
.login-button {
  width: 100%;
  display: block;
  padding: 12px 0;
  background-color: white;
  color: #529bdc;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border-radius: 8px;
  transition: background-color 0.3s ease;
  border: none;
}

.login-button:hover {
  background-color: #f5f5f5;
}

@media (min-width: 768px) {
  .login-button {
    padding: 14px 0;
    font-size: 16px;
  }
}

/* Search Section */
.search-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-label {
  color: white;
  font-size: 14px;
  font-weight: 500;
  display: block;
}

.search-input-group {
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

@media (min-width: 768px) {
  .search-input {
    padding: 12px 16px;
    font-size: 15px;
  }
}

.search-button {
  padding: 10px 32px;
  background-color: white;
  color: #529bdc;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-button:hover:not(:disabled) {
  background-color: #f5f5f5;
}

.search-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (min-width: 768px) {
  .search-button {
    padding: 12px 36px;
    font-size: 15px;
  }
}

/* Error Message */
.error-message {
  color: #ffb3b3;
  font-size: 13px;
  text-align: center;
  min-height: 16px;
}

/* ログインページ用のスタイルを追加 */

/* Login Container */
.login-container {
  background: linear-gradient(180deg, #529bdc 0%, #4089d9 100%);
  min-height: 100vh;
  padding: 16px;
}

/* Login Box */
.login-box {
  width: 100%;
  max-width: 400px;
  background-color: white;
  border-radius: 12px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .login-box {
    padding: 48px 32px;
    gap: 32px;
  }
}

/* Login Logo */
.login-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.login-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

@media (min-width: 768px) {
  .login-logo {
    width: 80px;
    height: 80px;
  }
}

/* Login Form */
.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Form Group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Form Label */
.form-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* Form Input */
.form-input {
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-input::placeholder {
  color: #999;
}

.form-input:focus {
  outline: none;
  border-color: #529bdc;
  box-shadow: 0 0 0 3px rgba(82, 155, 220, 0.1);
}

@media (min-width: 768px) {
  .form-input {
    padding: 14px 16px;
    font-size: 15px;
  }
}

/* Login Error Message */
.login-error-message {
  color: #e74c3c;
  font-size: 13px;
  text-align: center;
  min-height: 16px;
  font-weight: 500;
}

/* Login Submit Button */
.login-submit-button {
  padding: 12px 0;
  background-color: #529bdc;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-family: inherit;
}

.login-submit-button:hover {
  background-color: #4089d9;
}

.login-submit-button:active {
  background-color: #2f6ab0;
}

@media (min-width: 768px) {
  .login-submit-button {
    padding: 14px 0;
    font-size: 16px;
  }
}

/* Back to Top Link */
.back-to-top-link {
  color: #529bdc;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.3s ease;
  margin-top: 8px;
}

.back-to-top-link:hover {
  color: #4089d9;
  text-decoration: underline;
}

/* ユーザーページ用のスタイルを追加 */

/* User Page Container */
.user-page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(180deg, #529bdc 0%, #4089d9 100%);
}

/* User Header */
.user-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #5ba3e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .user-header {
    height: 70px;
    padding: 0 24px;
  }
}

/* Header sections */
.user-header-left {
  flex: 0 0 auto;
  width: 100px;
}

.user-header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.user-header-right {
  flex: 0 0 auto;
  width: 100px;
}

/* Header Logo Link */
.user-header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.user-header-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

@media (min-width: 768px) {
  .user-header-icon {
    width: 48px;
    height: 48px;
  }
}

/* Header Button */
.user-header-button {
  width: 100%;
  padding: 8px 12px;
  background-color: white;
  color: #5ba3e0;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  display: block;
}

.user-header-button:hover {
  background-color: #f5f5f5;
}

@media (min-width: 768px) {
  .user-header-button {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* Main Content */
.user-main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 80px 16px 16px;
  margin-top: 0;
}

@media (min-width: 768px) {
  .user-main-content {
    padding: 90px 16px 16px;
  }
}

/* User Content Wrapper */
.user-content-wrapper {
  width: 100%;
  max-width: 500px;
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
  .user-content-wrapper {
    padding: 24px;
  }
}

/* User Info Block */
.user-info-block {
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
}

@media (min-width: 768px) {
  .user-info-block {
    padding: 24px 0;
  }
}

.user-profile-container {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.user-profile-icon {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .user-profile-icon {
    width: 56px;
    height: 56px;
  }
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-display-name {
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

@media (min-width: 768px) {
  .user-display-name {
    font-size: 18px;
  }
}

.user-username {
  font-size: 13px;
  color: #999;
  font-weight: 500;
}

@media (min-width: 768px) {
  .user-username {
    font-size: 14px;
  }
}

/* Posts Container */
.posts-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
}

@media (min-width: 768px) {
  .posts-container {
    gap: 20px;
    padding-top: 20px;
  }
}

/* Post Item */
.post-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  background-color: #fafafa;
  transition: all 0.3s ease;
}

.post-item:hover {
  background-color: #f5f5f5;
  border-color: #e5e5e5;
}

@media (min-width: 768px) {
  .post-item {
    gap: 16px;
    padding: 20px;
  }
}

.post-user-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .post-user-icon {
    width: 40px;
    height: 40px;
  }
}

.post-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-header {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.post-user-name {
  font-weight: 700;
  font-size: 14px;
  color: #333;
}

@media (min-width: 768px) {
  .post-user-name {
    font-size: 15px;
  }
}

.post-user-id {
  font-size: 13px;
  color: #999;
  font-weight: 500;
}

@media (min-width: 768px) {
  .post-user-id {
    font-size: 14px;
  }
}

.post-text {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  word-wrap: break-word;
}

@media (min-width: 768px) {
  .post-text {
    font-size: 15px;
  }
}

.post-engagement {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: #999;
  margin-top: 4px;
}

@media (min-width: 768px) {
  .post-engagement {
    font-size: 14px;
  }
}

.post-heart {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.post-heart:hover {
  transform: scale(1.2);
}

.post-likes {
  font-weight: 600;
  color: #666;
}

.post-image {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 8px;
  margin-top: 12px;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.post-image:hover {
  opacity: 0.9;
}

@media (min-width: 768px) {
  .post-image {
    max-width: 350px;
    margin-top: 16px;
  }
}

/* Image Modal */
#imageModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
}

#imageModal.active {
  display: flex;
}

.image-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  cursor: pointer;
  z-index: 201;
}

.image-modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 202;
}

.modal-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
