/* 大学・教授レビューサイト スタイル */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  overflow-x: hidden;
}

/* ===== Header / Breadcrumb ===== */
.header {
  text-align: center;
  color: white;
  padding: 30px 20px 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.header p {
  font-size: 1.1rem;
  opacity: .9;
  margin-bottom: 15px;
}

.logo-link {
  color: #fff;
  text-decoration: none;
  transition: opacity .3s;
}

.logo-link:hover {
  opacity: .8;
  cursor: pointer;
}

.breadcrumb {
  text-align: center;
  font-size: .9rem;
  opacity: .8;
}

.breadcrumb a {
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  margin: 0 8px;
}

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

/* ===== Responsive (Header/Main) ===== */
@media (max-width: 768px) {
  .header {
    padding: 20px 15px 15px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .header p {
    font-size: 1rem;
  }

  .main-container {
    padding: 0 15px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 15px 10px 10px;
  }

  .header h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
  }

  .header p {
    font-size: .9rem;
  }

  .main-container {
    padding: 0 10px;
  }
}

/* ===== Pages ===== */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* ===== Search ===== */
.search-section {
  background: #fff;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
}

.search-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-wrapper {
  flex: 1;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color .3s;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
}

.search-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s;
}

.search-btn:hover {
  transform: translateY(-2px);
}

.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 2px;
}

.suggestion-item {
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f7fafc;
  transition: background-color .2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.suggestion-item:hover {
  background: #f7fafc;
}

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

.suggestion-content {
  flex: 1;
}

.suggestion-name {
  font-weight: 500;
  color: #2d3748;
}

.suggestion-name strong {
  background: #ffd700;
  color: #333;
  padding: 1px 2px;
  border-radius: 2px;
}

.suggestion-location {
  font-size: .85rem;
  color: #718096;
}

.suggestion-type {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: .75rem;
  margin-left: auto;
  font-weight: 500;
}

@media (max-width:768px) {
  .search-section {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
  }

  .search-container {
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width:480px) {
  .search-section {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
  }

  .search-input {
    padding: 10px 12px;
    font-size: .9rem;
  }

  .search-btn {
    padding: 10px 15px;
    font-size: .9rem;
  }

  .suggestions-dropdown {
    max-height: 250px;
    border-radius: 6px;
  }

  .suggestion-item {
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .suggestion-name {
    font-size: .9rem;
  }

  .suggestion-location {
    font-size: .8rem;
  }

  .suggestion-type {
    align-self: flex-end;
    margin-top: 5px;
    margin-left: 0;
  }
}

/* ===== Universities ===== */
.universities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.university-card {
  background: #fff;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
  transition: transform .3s, box-shadow .3s;
  cursor: pointer;
}

.university-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .15);
}

.university-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #4a5568;
  margin-bottom: 8px;
}

.university-type {
  display: inline-block;
  background: #e2e8f0;
  color: #4a5568;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 500;
  margin-left: 10px;
}

.university-info {
  color: #718096;
  margin-bottom: 15px;
  font-size: .9rem;
}

.university-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.university-stat-item {
  text-align: center;
  padding: 10px;
  background: #f7fafc;
  border-radius: 8px;
}

.university-stat-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: #667eea;
}

.university-stat-label {
  font-size: .8rem;
  color: #718096;
  margin-top: 2px;
}

@media (max-width:768px) {
  .universities-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
  }

  .university-card {
    padding: 20px;
    border-radius: 12px;
  }

  .university-name {
    font-size: 1.2rem;
  }
}

@media (max-width:480px) {
  .universities-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 15px;
  }

  .university-card {
    padding: 15px;
    border-radius: 10px;
  }

  .university-card:hover {
    transform: translateY(-2px);
  }

  .university-name {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }

  .university-info {
    font-size: .85rem;
    margin-bottom: 12px;
  }

  .university-stats {
    gap: 8px;
    margin-bottom: 12px;
  }

  .university-stat-item {
    padding: 8px;
  }

  .university-stat-value {
    font-size: 1rem;
  }

  .university-stat-label {
    font-size: .75rem;
  }
}

/* 「もっと見る」 */
.load-more-container {
  text-align: center;
  margin-bottom: 30px;
}

#load-more-universities {
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s;
}

#load-more-universities:hover:not(:disabled) {
  transform: translateY(-2px);
}

#load-more-universities:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ===== Professors ===== */
.professors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  padding: 0 10px;
}

.professor-card {
  background: #fff;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
  transition: transform .3s, box-shadow .3s;
  cursor: pointer;
}

.professor-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .15);
}

.professor-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #4a5568;
  margin-bottom: 8px;
}

.professor-info {
  color: #718096;
  margin-bottom: 15px;
  font-size: .9rem;
}

.rating-display {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.stars {
  color: #ffd700;
  margin-right: 8px;
}

.rating-text {
  font-weight: 600;
  color: #4a5568;
}

.professor-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.stat-item {
  text-align: center;
  padding: 10px;
  background: #f7fafc;
  border-radius: 8px;
}

.stat-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: #667eea;
}

.stat-label {
  font-size: .8rem;
  color: #718096;
  margin-top: 2px;
}

.retake-rate .stat-value {
  color: #48bb78;
  font-weight: 700;
}

.review-count {
  text-align: center;
  color: #718096;
  font-size: .9rem;
  margin-bottom: 15px;
}

.add-review-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s;
  margin-top: auto;
  font-size: 14px;
}

.add-review-btn:hover {
  transform: scale(1.02);
}

@media (max-width:768px) {
  .professors-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    padding: 0 5px;
  }

  .professor-card {
    padding: 20px;
    border-radius: 12px;
  }

  .professor-name {
    font-size: 1.2rem;
  }

  .professor-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media (max-width:480px) {
  .professors-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0;
  }

  .professor-card {
    padding: 15px;
    border-radius: 10px;
  }

  .professor-card:hover {
    transform: translateY(-2px);
  }

  .professor-name {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }

  .professor-info {
    font-size: .85rem;
    margin-bottom: 12px;
  }

  .rating-display {
    margin-bottom: 8px;
  }

  .rating-text {
    font-size: .9rem;
  }

  .review-count {
    font-size: .85rem;
    margin-bottom: 12px;
  }

  .add-review-btn {
    padding: 10px;
    font-size: .9rem;
  }
}

/* 追加：教授を追加ボタン（リスト上/下） */
.add-professor-header {
  display: flex;
  justify-content: center;
  margin: 15px 0;
  padding: 0 20px;
}

.add-professor-btn-header {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: #fff;
  border: none;
  padding: 14px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all .3s;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(72, 187, 120, .3);
  min-width: 200px;
  justify-content: center;
  width: auto;
  max-width: 400px;
}

.add-professor-btn-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(72, 187, 120, .4);
  background: linear-gradient(135deg, #38a169, #2f855a);
}

.add-professor-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px 0 20px;
  padding: 0 20px;
}

.add-professor-btn-footer {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: #fff;
  border: none;
  padding: 16px 40px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all .3s;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(72, 187, 120, .3);
  min-width: 250px;
  justify-content: center;
  width: auto;
  max-width: 500px;
}

.add-professor-btn-footer:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(72, 187, 120, .4);
  background: linear-gradient(135deg, #38a169, #2f855a);
}

.plus-icon {
  font-size: 20px;
  font-weight: bold;
}

@media (max-width:768px) {
  .add-professor-footer {
    margin: 30px 0 15px;
    padding: 0 15px;
  }

  .add-professor-btn-footer {
    padding: 14px 30px;
    font-size: 16px;
    min-width: 200px;
    max-width: 350px;
  }

  .add-professor-btn-header {
    padding: 12px 25px;
    font-size: 15px;
    min-width: 200px;
  }
}

@media (max-width:480px) {
  .add-professor-footer {
    margin: 25px 0 10px;
    padding: 0 10px;
  }

  .add-professor-btn-footer {
    padding: 12px 25px;
    font-size: 15px;
    min-width: auto;
    width: calc(100% - 20px);
    max-width: none;
  }

  .add-professor-header {
    padding: 0;
    margin: 0 0 10px 0;
  }

  .add-professor-btn-header {
    padding: 12px 20px;
    font-size: 14px;
    min-width: auto;
    width: calc(100% - 20px);
    max-width: none;
    margin: 0 10px;
  }
}

/* ===== Reviews detail pages ===== */
.professor-detail-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.reviews-section h3 {
  margin-bottom: 20px;
  color: #4a5568;
}

.review-item {
  background: #f7fafc;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 15px;
  border-left: 4px solid #667eea;
}

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

.review-course {
  font-weight: 600;
  color: #4a5568;
}

.review-date {
  font-size: .8rem;
  color: #718096;
}

.review-ratings {
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.review-rating-item {
  font-size: .9rem;
}

.review-details {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

.review-detail-item {
  font-size: .9rem;
  color: #666;
  font-weight: 500;
}

.review-comment {
  line-height: 1.6;
  color: #4a5568;
}

.would-retake {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f7fafc;
}

.retake-yes {
  color: #38a169;
  background: #c6f6d5;
}

.retake-no {
  color: #e53e3e;
  background: #fed7d7;
}

/* 投票ボタン */
.review-voting {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  padding: 12px 0;
  border-top: 1px solid #e2e8f0;
  justify-content: flex-start;
}

.vote-button {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 10px;
  transition: all .2s;
  font-size: .9rem;
  font-weight: 600;
  border: 2px solid transparent;
  min-width: 80px;
  justify-content: center;
}

.vote-button.upvote {
  background: linear-gradient(135deg, #e6ffed, #c6f6d5);
  color: #22543d;
  border-color: #38a169;
}

.vote-button.downvote {
  background: linear-gradient(135deg, #fed7d7, #fbb6ce);
  color: #742a2a;
  border-color: #e53e3e;
}

.vote-button.upvote:hover:not(:disabled) {
  background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 161, 105, .3);
}

.vote-button.downvote:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbb6ce, #f687b3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 62, 62, .3);
}

.vote-button.voted {
  opacity: .8;
  transform: scale(.95);
}

.vote-button:disabled {
  cursor: not-allowed;
  opacity: .6;
  transform: none;
}

.thumbs-icon {
  width: 20px;
  height: 20px;
  transition: all .2s;
}

.vote-button.upvote .thumbs-icon {
  fill: #22543d;
}

.vote-button.downvote .thumbs-icon {
  fill: #742a2a;
}

.vote-button:hover:not(:disabled) .thumbs-icon {
  transform: scale(1.1);
}

.vote-count {
  font-weight: 700;
  font-size: 1rem;
  min-width: 20px;
  text-align: center;
}

.vote-label {
  font-size: .75rem;
  opacity: .8;
  margin-left: 4px;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  transition: border-color .3s;
}

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

.rating-input {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}

.rating-input span {
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform .2s;
  filter: grayscale(100%);
}

.rating-input span.active,
.rating-input span:hover {
  transform: scale(1.1);
  filter: grayscale(0%);
}

/* ラジオ */
.radio-group {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.radio-text {
  color: #4a5568;
  font-size: 1rem;
}

.radio-option:hover .radio-text {
  color: #667eea;
}

/* Submit */
.form-group button,
#review-form button[type="submit"] {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform .2s;
}

.form-group button:hover,
#review-form button[type="submit"]:hover {
  transform: translateY(-2px);
}

/* ===== Modal (レビュー/教授追加) ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, .5);
}

.modal-content {
  background: #fff;
  margin: 5% auto;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #718096;
}

.close:hover {
  color: #4a5568;
}

/* ===== Terms モーダル ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
}

.modal-overlay .terms-modal-content {
  background: #fff;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 24px;
  padding: 28px;
  position: relative;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  animation: termsFadeIn 0.2s ease;
}

.terms-close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.terms-close-button:hover {
  background: #e2e8f0;
}

.terms-header {
  margin-bottom: 22px;
  padding-right: 42px;
}

.terms-header h2 {
  font-size: 30px;
  font-weight: 900;
  color: #1e293b;
  margin-bottom: 6px;
}

.terms-header p {
  color: #64748b;
  font-size: 14px;
}

.terms-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
}

.terms-section h3 {
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
  border-left: 4px solid #667eea;
  padding-left: 10px;
}

.terms-section p {
  color: #475569;
  line-height: 1.8;
  font-size: 15px;
}

.terms-list {
  list-style: none;
  padding-left: 0;
}

.terms-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  color: #475569;
  line-height: 1.7;
}

.terms-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #667eea;
  font-weight: 900;
}

.terms-section a {
  color: #667eea;
  font-weight: 800;
  text-decoration: none;
}

.terms-section a:hover {
  text-decoration: underline;
}

.terms-agree-button {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}

.terms-agree-button:hover {
  transform: translateY(-1px);
}

.terms-button {
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin: 20px auto;
  display: block;
  padding: 10px 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

@keyframes termsFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  .modal-overlay .terms-modal-content {
    padding: 22px;
    border-radius: 20px;
  }

  .terms-header h2 {
    font-size: 26px;
  }

  .terms-section {
    padding: 15px;
  }
}

/* ===== 学部フィルタ（大学レビュー） ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .10);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .18);
}

.filter-bar label {
  font-weight: 600;
  color: #fff;
}

.filter-bar select,
.filter-bar button {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .95);
  color: #222;
  outline: none;
}

/* ===== Fixed Contact ===== */
.contact-info-fixed {
  position: absolute;
  top: 10px;
  right: 20px;
  z-index: 100;
  font-size: 11px;
  color: #666;
  background: transparent;
  padding: 4px 8px;
  white-space: nowrap;
}

.contact-info-fixed a {
  color: #222;
}

.contact-info-fixed a:hover {
  text-decoration: underline;
}

@media (max-width:768px) {
  .contact-info-fixed {
    top: 8px !important;
    right: 15px !important;
    font-size: 11px;
    padding: 6px 10px;
  }
}

@media (max-width:480px) {
  .contact-info-fixed {
    top: 5px !important;
    right: 10px !important;
    font-size: 10px;
    padding: 5px 8px;
  }
}

/* ===== Misc ===== */
.loading {
  text-align: center;
  color: #fff;
  font-size: 1.2rem;
  margin-top: 50px;
}

.no-results {
  text-align: center;
  background: #fff;
  padding: 40px;
  border-radius: 15px;
  color: #718096;
}

.no-results h3 {
  margin-bottom: 10px;
  color: #4a5568;
}

@media (max-width:768px) {
  .form-group {
    margin-bottom: 15px;
  }

  .form-group label {
    margin-bottom: 6px;
    font-size: .95rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 10px;
    font-size: .95rem;
  }

  .rating-input span {
    font-size: 1.3rem;
  }

  .form-group button,
  #review-form button[type="submit"] {
    padding: 12px;
    font-size: 1rem;
  }
}

@media (max-width:480px) {
  .review-item {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
  }

  .review-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .review-course {
    font-size: .9rem;
  }

  .review-date {
    font-size: .75rem;
  }

  .review-ratings {
    gap: 8px;
    flex-direction: column;
    align-items: flex-start;
  }

  .review-rating-item {
    font-size: .8rem;
  }

  .review-comment {
    font-size: .9rem;
    line-height: 1.5;
  }

  .radio-group {
    flex-direction: column;
    gap: 12px;
  }

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

  .form-group label {
    margin-bottom: 5px;
    font-size: .9rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 8px;
    font-size: .9rem;
    border-radius: 6px;
  }

  .rating-input {
    gap: 3px;
    justify-content: center;
  }

  .rating-input span {
    font-size: 1.2rem;
  }

  .form-group button,
  #review-form button[type="submit"] {
    padding: 10px;
    font-size: .95rem;
    border-radius: 6px;
  }

  .no-results {
    padding: 25px 15px;
    border-radius: 10px;
  }

  .no-results h3 {
    font-size: 1rem;
  }
}

@media (max-width:320px) {
  body {
    font-size: 14px;
  }

  .header h1 {
    font-size: 1.4rem;
  }

  .search-section {
    padding: 12px;
  }

  .university-card,
  .professor-card {
    padding: 12px;
  }

  .university-stats,
  .professor-stats {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .modal-content {
    padding: 15px;
    border-radius: 8px;
  }
}

/* 教授追加ボタン（検索下にコンパクト設置） */
.add-professor-inline {
  text-align: right;
  margin-top: 10px;
}

.add-professor-btn-inline {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 8px rgba(56, 161, 105, 0.25);
}

.add-professor-btn-inline:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 10px rgba(56, 161, 105, 0.35);
}

.plus-icon {
  font-size: 14px;
  margin-right: 4px;
}

/* セレクトと追加ボタンを横並びに */
.filter-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

/* セレクトの高さを明示してボタンと揃える */
.filter-select {
  height: 36px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

/* 追加ボタンをセレクトと同じ高さに */
.add-professor-btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  /* ← 揃えるポイント */
  padding: 0 14px;
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 3px 8px rgba(56, 161, 105, .25);
}

.add-professor-btn-inline:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 10px rgba(56, 161, 105, .35);
}

.plus-icon {
  font-size: 14px;
}

/* モバイルでは縦積みにして押しやすく */
@media (max-width: 600px) {
  .filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .add-professor-btn-inline {
    width: 100%;
  }
}

/* 教授一覧ページだけ学部フィルタを非表示 */
#professors-page #department-filter {
  display: none !important;
}

/* ===== Recent Posts ===== */
.recent-posts-section {
  margin-bottom: 30px;
}

.section-header-row {
  margin-bottom: 14px;
  padding: 0 4px;
}

.section-header-row h2 {
  font-size: 1.35rem;
  color: #2d3748;
  margin-bottom: 4px;
}

.section-header-row p {
  color: #718096;
  font-size: 0.95rem;
}

.recent-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 10px;
}

.recent-post-card {
  background: #fff;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  border: 1px solid #edf2f7;
}

.recent-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .14);
}

.recent-post-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.recent-post-university {
  font-size: 0.88rem;
  color: #4c51bf;
  font-weight: 700;
}

.recent-post-rating {
  font-size: 0.92rem;
  color: #f6ad55;
  font-weight: 700;
  background: #f7fafc;
  padding: 4px 8px;
  border-radius: 999px;
}

.recent-post-professor {
  font-size: 1.15rem;
  color: #2d3748;
  margin-bottom: 6px;
}

.recent-post-department {
  color: #718096;
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.recent-post-course {
  color: #4a5568;
  font-size: 0.9rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.recent-post-comment {
  color: #4a5568;
  line-height: 1.6;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.recent-post-comment.empty {
  color: #a0aec0;
}

.recent-post-date {
  color: #a0aec0;
  font-size: 0.82rem;
  text-align: right;
}

.recent-posts-loading {
  background: #fff;
  border-radius: 15px;
  padding: 24px;
  text-align: center;
  color: #718096;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

@media (max-width: 768px) {
  .recent-posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
  }

  .recent-post-card {
    padding: 16px;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .recent-posts-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .section-header-row h2 {
    font-size: 1.15rem;
  }

  .section-header-row p {
    font-size: 0.88rem;
  }

  .recent-post-professor {
    font-size: 1.05rem;
  }

  .recent-post-comment {
    font-size: 0.9rem;
  }
}

.professor-detail-top-action {
  display: flex;
  justify-content: center;
  margin: 22px 0 26px;
}

.professor-detail-add-review-btn {
  max-width: 360px;
  width: 100%;
}

.validation-error {
  position: absolute;
  background: #fff;
  border: 1px solid #ff9800;
  color: #333;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 9999;
}

.error-border {
  border: 2px solid #ff4d4f;
}

.validation-error {
  position: absolute;
  background: #fff;
  border: 1px solid #f59e0b;
  color: #333;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  z-index: 9999;
  white-space: nowrap;
}

.error-border {
  border: 2px solid #ef4444 !important;
  border-radius: 10px;
}

/* ===== Nihon mode ===== */
.faculty-card {
  background: #fff;
  border-radius: 15px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
  transition: transform .25s, box-shadow .25s;
  cursor: pointer;
}

.faculty-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .14);
}

.faculty-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 8px;
}


.faculty-card-campus {
  color: #4a5568;
  font-size: .95rem;
  margin-bottom: 8px;
}

.faculty-card-location {
  color: #718096;
  font-size: .88rem;
}

.campus-badge {
  display: inline-block;
  background: #edf2f7;
  color: #4a5568;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  margin-right: 6px;
  margin-bottom: 6px;
}

#professors-page #department-filter {
  display: block !important;
}

.suggestions-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  overflow: hidden;
}

.suggestion-item {
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
}

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

.suggestion-item:hover {
  background: #f8fafc;
}

.suggestion-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suggestion-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: #1e293b;
}

.suggestion-location {
  font-size: 0.85rem;
  color: #64748b;
}

.review-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.review-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.review-card,
.recent-post-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.review-card:hover,
.recent-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.rank-card {
  background: white;
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition:
      transform 0.18s ease,
      box-shadow 0.18s ease;
  border: 2px solid transparent;
}

.rank-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.rank-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.rank-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rank-badge {
  font-size: 1.4rem;
  font-weight: 700;
  min-width: 44px;
  text-align: center;
  line-height: 1.2;
}

.rank-professor-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
}

.rank-subinfo {
  font-size: 0.92rem;
  color: #64748b;
  margin-top: 4px;
}

.rank-metric {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  color: #1e293b;
}

.rank-stats {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #334155;
}

.rank-1 {
  border-color: #facc15;
  background: linear-gradient(135deg, #fff9db, #ffffff);
}

.rank-2 {
  border-color: #cbd5e1;
  background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.rank-3 {
  border-color: #d6a77a;
  background: linear-gradient(135deg, #fff4eb, #ffffff);
}

@media (max-width: 640px) {
    .rank-card-top {
        flex-direction: column;
        gap: 10px;
    }

    .rank-metric {
        white-space: normal;
    }

    .rank-professor-name {
        font-size: 1.05rem;
    }
}

.status.added {
  color: #2e7d32;
  font-weight: 700;
}

.status.not-added {
  color: #d84315;
  font-weight: 700;
}

.add-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* =====================
   掲示板デザイン
===================== */

.board-section {
  max-width: 900px;
  margin: 40px auto;
  padding: 24px;
}

.board-section h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.board-description {
  color: #555;
  margin-bottom: 20px;
}

#board-form,
#comment-form {
  background: white;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

#board-form select,
#board-form input,
#board-form textarea,
#comment-form textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
}

#board-form textarea,
#comment-form textarea {
  min-height: 100px;
  resize: vertical;
}

#board-form button,
#comment-form button,
.board-section button {
  background: #333;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: bold;
  cursor: pointer;
}

#board-form button:hover,
#comment-form button:hover,
.board-section button:hover {
  opacity: 0.85;
}

.board-card {
  background: white;
  padding: 18px;
  margin-bottom: 14px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: 0.2s;
}

.board-card:hover {
  transform: translateY(-2px);
}

.board-category-badge {
  display: inline-block;
  background: #edf2ff;
  color: #3b5bdb;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 8px;
}

.board-card-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 6px;
}

.board-card-body {
  color: #555;
  line-height: 1.6;
  margin-bottom: 8px;
}

.board-card-meta {
  color: #777;
  font-size: 13px;
}

.comment-card {
  background: white;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
  line-height: 1.6;
}

.cat1 {
  background: #e3fafc;
  color: #0c8599;
}

.cat2 {
  background: #f3f0ff;
  color: #5f3dc4;
}

.cat3 {
  background: #fff3bf;
  color: #e67700;
}

.board-filter {
  margin-bottom: 16px;
}

.board-filter button {
  margin-right: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: #eee;
  cursor: pointer;
}

.board-filter button:hover {
  background: #ddd;
}

.board-filter button.active {
  background: #333;
  color: white;
}

.board-like-btn {
  margin-top: 10px;
  background: #f1f3f5;
  color: #333;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: bold;
  cursor: pointer;
}

.board-like-btn:hover {
  background: #ffe066;
}

.board-sort {
  margin: 10px 0 20px;
}

.board-sort button {
  margin-right: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: #eee;
  cursor: pointer;
  font-weight: bold;
}

.board-sort button.active {
  background: #333;
  color: white;
}

#board-search {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.comment-meta {
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
}

.comment-body {
  font-size: 14px;
}

.report-btn {
  margin-top: 8px;
  background: transparent;
  color: #999;
  border: none;
  font-size: 12px;
  cursor: pointer;
}

.board-card {
  position: relative;
}

.post-delete-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0;
  transition: 0.2s;
}

.board-card:hover .post-delete-btn {
  opacity: 1;
}

.comment-card {
  position: relative;
  padding-bottom: 48px;
}

.comment-delete-btn {
  position: absolute;
  right: 16px;
  bottom: 16px;

  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;

  background: #eee !important;
  color: #333 !important;
  border: none;

  opacity: 0;
  transition: 0.2s;
}

.comment-card:hover .comment-delete-btn {
  opacity: 1;
}

.board-meta {
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.board-controls {
  background: rgba(255, 255, 255, 0.18);
  padding: 16px;
  border-radius: 20px;
  margin: 16px 0 24px;
}

.board-control-group {
  margin-bottom: 14px;
}

.board-control-group:last-child {
  margin-bottom: 0;
}

.board-control-label {
  font-size: 13px;
  font-weight: 700;
  color: #444;
  margin-bottom: 8px;
}

.board-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.board-control-row select {
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
}

.board-control-row button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
}

#board-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#board-form input,
#board-form select {
  height: 44px;
}

#board-title {
  grid-column: 1 / 3;
}

#board-body {
  grid-column: 1 / 3;
  height: 120px;
}

#board-form button {
  grid-column: 1 / 3;
}

#board-form button {
  justify-self: flex-end;
  width: 120px;
}

#board-form select,
#board-form input,
#board-form textarea {
  margin-bottom: 0 !important;
}

#board-form select,
#board-form input {
  padding: 10px !important;
}

#board-form textarea {
  padding: 10px !important;
}

#board-form input,
#board-form select {
  height: 40px;
}

.reset-row {
  justify-content: flex-end;
}


.board-controls {
  position: relative;
}

.reset-row {
  position: absolute;
  right: 20px;
  bottom: 20px;
}

  z-index: 9999;

  background: rgba(255, 255, 255, 0.92);
  color: #333;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;

  font-weight: 700;
  font-size: 14px;
  cursor: pointer;

  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.back-button:hover {
  transform: translateY(-2px);
  background: white;
}

.back-button {
  position: fixed;

  top: 100px;   /* ←ここ調整（重要） */
  left: 20px;   /* ←左端に寄せる */

  z-index: 9999;

  background: rgba(255, 255, 255, 0.92);
  color: #333;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;

  font-weight: 700;
  font-size: 14px;
  cursor: pointer;

  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

#open-board-form-btn {
  background: #000;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: bold;
  margin: 12px 0;
}

.board-filter button,
.board-sort button {
  color: #333;   /* ←ここ重要 */
}

.board-filter button,
.board-sort button {
  background: rgba(255,255,255,0.7);
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 16px 0 0;
}

.top-nav button {
  background: rgba(255,255,255,0.18);
  color: white;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  cursor: pointer;
}

.top-nav button:hover {
  background: rgba(255,255,255,0.3);
}

/* ===== 掲示板 詳細ページ ===== */
#board-detail-page .board-section {
  max-width: 900px;
  margin: 40px auto;
  padding: 24px;
}

.board-detail-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  margin-bottom: 24px;
}

#board-detail-title {
  font-size: 32px;
  margin-bottom: 12px;
}

#board-detail-body {
  font-size: 17px;
  line-height: 1.8;
  color: #444;
}

.comment-section-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.comment-section-card h3 {
  font-size: 22px;
  margin-bottom: 16px;
}

#comment-form {
  box-shadow: none;
  padding: 0;
  margin-bottom: 20px;
}

#comment-form textarea {
  min-height: 110px;
}

#comment-list {
  margin-top: 16px;
}

#comment-list:empty::before {
  content: "まだコメントはありません";
  color: #777;
}

.board-detail-card,
.comment-section-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 32px;

  /* ←ここが重要 */
  box-shadow: 
    0 25px 60px rgba(0,0,0,0.25),
    0 10px 25px rgba(0,0,0,0.1);

  border: none;
}

#board-detail-title {
  font-size: 36px;
  font-weight: 900;
}

#board-detail-body {
  font-size: 16px;
  color: #666;
}

.board-detail-card h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;

  /* ←これがポイント */
  border-left: 4px solid #6366f1;
  padding-left: 10px;
}

#comment-form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#comment-body {
  width: 100%;
}

#comment-form button[type="submit"] {
  align-self: flex-end;
}

.back-button {
  display: none;
}