/*
Theme Name: 地方電車路線・時刻・運賃検索システム
Theme URI: 
Author: 
Author URI: 
Description: 地方電車の路線情報・時刻表・運賃を検索できるカスタムテーマ
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: local-train-search
Tags: custom-theme, train, schedule, fare
*/

/* 基本スタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ヘッダー */
.site-header {
  background-color: #2c3e50;
  color: #fff;
  padding: 20px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.site-header h1 {
  margin: 0;
  font-size: 24px;
}

/* 検索フォーム */
.search-section {
  background-color: #fff;
  padding: 30px;
  margin: 30px 0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 8px;
  font-weight: bold;
  color: #2c3e50;
}

.form-group select,
.form-group input[type="time"] {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.form-group select:focus,
.form-group input[type="time"]:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-button {
  background-color: #3498db;
  color: #fff;
  padding: 12px 30px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  grid-column: 1 / -1;
  justify-self: start;
}

.search-button:hover {
  background-color: #2980b9;
}

/* 検索結果 */
.search-results {
  background-color: #fff;
  padding: 30px;
  margin: 30px 0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-results h2 {
  margin-bottom: 30px;
  font-size: 24px;
  color: #2c3e50;
  border-bottom: 3px solid #3498db;
  padding-bottom: 10px;
}

/* 時刻表路線 */
.timetable-route {
  margin-bottom: 40px;
}

.timetable-route:last-child {
  margin-bottom: 0;
}

.route-title {
  font-size: 20px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 20px;
  padding: 10px 15px;
  background-color: #ecf0f1;
  border-left: 5px solid #3498db;
  border-radius: 4px;
}

/* 時刻表テーブル */
.timetable-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

.timetable-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timetable-table thead {
  background-color: #34495e;
  color: #fff;
}

.timetable-table th {
  padding: 12px 15px;
  text-align: left;
  font-weight: bold;
  font-size: 13px;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.timetable-table th:last-child {
  border-right: none;
}

.timetable-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.2s;
}

.timetable-table tbody tr:hover {
  background-color: #f8f9fa;
}

.timetable-table tbody tr.even {
  background-color: #fafafa;
}

.timetable-table tbody tr.odd {
  background-color: #fff;
}

.timetable-table tbody tr.even:hover,
.timetable-table tbody tr.odd:hover {
  background-color: #e8f4f8;
}

.timetable-table td {
  padding: 12px 15px;
  vertical-align: middle;
  border-right: 1px solid #e0e0e0;
}

.timetable-table td:last-child {
  border-right: none;
}

/* 列車情報列 */
.train-number {
  font-weight: bold;
  color: #2c3e50;
  font-size: 14px;
  text-align: center;
  min-width: 80px;
  background-color: #ecf0f1 !important;
}

.train-type {
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  min-width: 60px;
}

.train-direction {
  text-align: center;
  font-size: 13px;
  min-width: 60px;
}

.train-daytype {
  text-align: center;
  font-size: 12px;
  color: #7f8c8d;
  min-width: 70px;
}

/* 駅時刻列 */
.station-time {
  text-align: center;
  font-size: 14px;
  min-width: 80px;
  padding: 8px 5px !important;
}

.station-time .time-value {
  font-family: "Courier New", monospace;
  font-weight: bold;
  display: block;
}

.station-time .time-value.stops {
  color: #2980b9;
  font-size: 15px;
}

.station-time .time-value.pass {
  color: #95a5a6;
  font-size: 13px;
}

.station-time .pass-indicator {
  font-size: 10px;
  color: #95a5a6;
  display: block;
  margin-top: 2px;
}

.station-time .no-service {
  color: #bdc3c7;
  font-size: 12px;
}

.train-info-col {
  width: 8%;
}

.train-type-col {
  width: 6%;
}

.train-direction-col {
  width: 6%;
}

.train-daytype-col {
  width: 8%;
}

.station-time-col {
  width: auto;
  min-width: 80px;
  font-size: 12px;
  white-space: nowrap;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #7f8c8d;
  font-size: 16px;
}

/* 運賃情報セクション */
.fare-info-section {
  margin-top: 40px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #3498db;
}

.fare-info-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2c3e50;
  font-size: 18px;
}

.fare-display {
  text-align: center;
}

.fare-route {
  font-size: 16px;
  margin-bottom: 10px;
  color: #2c3e50;
}

.fare-from,
.fare-to {
  font-weight: bold;
  padding: 5px 10px;
  background-color: #fff;
  border-radius: 4px;
  display: inline-block;
}

.fare-arrow {
  margin: 0 15px;
  font-size: 20px;
  color: #3498db;
}

.fare-amount {
  font-size: 28px;
  font-weight: bold;
  color: #e74c3c;
  margin: 10px 0 0 0;
}

.fare-amount.no-fare {
  font-size: 16px;
  color: #95a5a6;
  font-weight: normal;
}

/* フッター */
.site-footer {
  background-color: #2c3e50;
  color: #fff;
  padding: 20px 0;
  text-align: center;
  margin-top: 50px;
}

/* エラーメッセージ */
.error-message {
  background-color: #e74c3c;
  color: #fff;
  padding: 15px;
  border-radius: 4px;
  margin: 20px 0;
}

.success-message {
  background-color: #27ae60;
  color: #fff;
  padding: 15px;
  border-radius: 4px;
  margin: 20px 0;
}

/* 時間ベースの時刻表 */
.timetable-table.hourly-timetable {
  width: 100%;
  max-width: 600px;
}

.timetable-table.hourly-timetable .hour-col {
  width: 80px;
  background-color: #ecf0f1;
  font-weight: bold;
  text-align: center;
  vertical-align: middle;
  border-right: 2px solid #bdc3c7;
}

.timetable-table.hourly-timetable .hour-cell {
  background-color: #ecf0f1;
  font-weight: bold;
  font-size: 16px;
  text-align: center;
  padding: 15px 10px;
  border-right: 2px solid #bdc3c7;
  vertical-align: middle;
}

.timetable-table.hourly-timetable .times-col {
  padding: 10px 15px;
}

.timetable-table.hourly-timetable .times-cell {
  padding: 10px 15px;
  vertical-align: middle;
}

.timetable-table.hourly-timetable .time-entry {
  display: inline-block;
  margin-right: 15px;
  margin-bottom: 5px;
  padding: 5px 8px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.timetable-table.hourly-timetable .time-entry .minute {
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 14px;
  color: #2c3e50;
  margin-right: 5px;
}

.timetable-table.hourly-timetable .time-entry .destination {
  font-size: 13px;
  color: #34495e;
}

.timetable-table.hourly-timetable .hour-row {
  border-bottom: 1px solid #e0e0e0;
}

.timetable-table.hourly-timetable .hour-row:hover {
  background-color: #f8f9fa;
}

.timetable-table.hourly-timetable .hour-row .no-service {
  color: #bdc3c7;
  font-size: 12px;
  font-style: italic;
}

/* 路線図 */
.route-map-container {
  margin-top: 40px;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.route-map-container h2 {
  margin-bottom: 20px;
  font-size: 20px;
  color: #2c3e50;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

.route-map-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 20px;
}

#route-map-svg {
  width: 100%;
  height: auto;
  max-width: 1000px;
  display: block;
  margin: 0 auto;
}

.route-path {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.station-group {
  cursor: pointer;
}

.station-circle {
  transition: all 0.2s ease;
}

.station-group:hover .station-circle {
  fill: #3498db !important;
  stroke-width: 3;
}

.station-number {
  font-weight: bold;
  pointer-events: none;
}

.station-name {
  font-weight: normal;
  pointer-events: none;
}

.junction-station {
  cursor: pointer;
}

.route-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 20px;
  height: 4px;
  display: inline-block;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .search-form {
    grid-template-columns: 1fr;
  }

  .timetable-wrapper {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
  }

  .timetable-table {
    min-width: 700px;
    font-size: 12px;
  }

  .timetable-table th,
  .timetable-table td {
    padding: 8px 10px;
  }

  .departure-time,
  .arrival-time {
    font-size: 14px;
  }

  .station-name {
    font-size: 13px;
  }

  .route-title {
    font-size: 18px;
  }
}

/* =========================================
   Premium Route Map Styles (Glassmorphism & Neon)
   ========================================= */

.route-map-container {
  margin-top: 40px;
  padding: 30px;
  background: linear-gradient(
    135deg,
    #1a1c2c 0%,
    #4a192c 100%
  ); /* Deep purple/red theme */
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* Glass effect overlay */
.route-map-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  z-index: 0;
  pointer-events: none;
}

.route-map-container h2 {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.route-map-wrapper {
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 20px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* SVG Styles */
.route-path {
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.5s ease;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.route-path:hover {
  stroke-width: 6 !important;
}

/* Line Colors with Neon Glow */
#main-line {
  stroke: #00d2ff;
  filter: drop-shadow(0 0 8px #00d2ff);
}

#fujikoshi-line {
  stroke: #ff9f00;
  filter: drop-shadow(0 0 8px #ff9f00);
}

#tateyama-line {
  stroke: #00ff88;
  filter: drop-shadow(0 0 8px #00ff88);
}

/* Station Nodes */
.station-circle {
  fill: #1a1c2c;
  stroke: #fff;
  stroke-width: 2;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.station-group:hover .station-circle {
  fill: #fff !important;
  r: 8px; /* Expand */
  stroke-width: 0;
  filter: drop-shadow(0 0 10px #fff);
}

.station-group.selected .station-circle {
  fill: #ff0055 !important;
  stroke: #fff !important;
  r: 10px;
  filter: drop-shadow(0 0 15px #ff0055);
}

.station-number {
   font-family: "Roboto Mono", monospace;
   font-size: 8px;
   fill: rgba(255, 255, 255, 0.9);
   font-weight: bold;
   pointer-events: none;
}

.station-name {
   font-size: 10px;
   fill: #fff;
   text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 5px rgba(0, 0, 0, 0.8);
   font-weight: 500;
   letter-spacing: 0.3px;
   pointer-events: none;
}

/* Legend */
.route-legend {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.legend-item span {
  font-size: 12px;
  letter-spacing: 1px;
}

.legend-color {
  box-shadow: 0 0 5px currentColor;
}

/* Interactive UI Overlay */
.map-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.control-panel {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 200px;
}

.control-panel h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 5px;
}

.selected-station-display {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
}

.reset-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 5px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s;
}


/* Station Timetable Style Search Results */
.search-results-container {
    padding: 20px 0;
    font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
}

.fare-info-wrapper {
    margin-bottom: 20px;
}

/* 2-Column or Single Column Layout based on width */
.timetable-grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.timetable-column {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}

.timetable-header {
    padding: 10px;
    text-align: center;
    color: #fff;
    font-weight: bold;
}
.header-red { background-color: #b71c1c; } /* Example Red */
.header-blue { background-color: #0d47a1; } /* Example Blue */

.direction-label {
    display: block;
    font-size: 1.2rem;
}
.direction-sub {
    display: block;
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Hour Rows */
.timetable-body {
    display: flex;
    flex-direction: column;
}

.hour-row {
    display: flex;
    border-bottom: 1px solid #ddd;
    min-height: 40px;
}
.hour-row:nth-child(even) {
    background-color: #f5f5f5; /* Stripe effect */
}
.hour-row:nth-child(odd) {
    background-color: #fff;
}

.hour-cell {
    width: 40px;
    background-color: #333;
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #555;
    flex-shrink: 0;
}

.minutes-cell {
    flex: 1;
    padding: 5px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.minute-item {
    display: inline-flex;
    align-items: baseline;
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

.minute-val {
    margin-right: 2px;
}

/* Train Type Colors (applied to the minute number) */
.type-rapid .minute-val { color: #f57c00; } /* Orange */
.type-limited .minute-val { color: #d32f2f; } /* Red */
.type-local .minute-val { color: #333; } /* Black */

.dest-suffix {
    font-size: 0.6rem;
    margin-left: 1px;
    color: #666;
    font-weight: normal;
}
.type-marker {
    font-size: 0.6rem;
    margin-right: 2px;
}

/* Legend */
.timetable-legend {
    margin-top: 10px;
    padding: 10px;
    font-size: 0.8rem;
    background: #fff;
    border: 1px solid #ddd;
}
.legend-item { margin-right: 15px; }

/* Responsive */
@media (max-width: 600px) {
    .timetable-column {
        width: 100%;
        max-width: none;
    }
}
