/**
 * チケット予約システム - 公開画面スタイルシート
 */

/* ===================================
   基本設定
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

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

/* ===================================
   ヘッダー
   =================================== */
.site-header {
    background: white;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.site-title {
    font-size: 20px;
    font-weight: 600;
}

.site-title a {
    color: #333;
    text-decoration: none;
}

.main-nav a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.3s;
}

.main-nav a:hover {
    background: #f0f0f0;
}

/* ===================================
   メインコンテンツ
   =================================== */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #333;
}

h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

/* ===================================
   公演一覧グリッド
   =================================== */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.event-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.event-card.sold-out {
    opacity: 0.6;
}

.event-date {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: center;
}

.event-date .month {
    display: block;
    font-size: 14px;
}

.event-date .day {
    display: block;
    font-size: 32px;
    font-weight: bold;
}

.event-date .weekday {
    display: block;
    font-size: 12px;
}

.event-info {
    padding: 20px;
}

.event-info h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

.event-info .venue,
.event-info .time,
.event-info .price {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.event-info .price {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-top: 10px;
}

.availability {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.seats-info {
    font-size: 14px;
    color: #666;
}

/* ===================================
   バッジ
   =================================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

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

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

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

/* ===================================
   ボタン
   =================================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
}

.btn:active {
    transform: translateY(1px);
}

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

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

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

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

.btn-lg {
    padding: 14px 30px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ===================================
   座席選択画面
   =================================== */
.event-details {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.event-details p {
    margin-bottom: 8px;
}

.seat-legend {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.seat-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #333;
}

.seat-icon.available {
    background: #90EE90;
}

.seat-icon.reserved {
    background: #FFD700;
}

.seat-icon.selected {
    background: #667eea;
}

.seat-icon.sold {
    background: #ccc;
}

.seat-map-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#seatMap .seat-available {
    fill: #90EE90;
    cursor: pointer;
    transition: fill 0.2s;
}

#seatMap .seat-available:hover {
    fill: #7CFC00;
}

#seatMap .seat-selected {
    fill: #667eea;
}

#seatMap .seat-reserved {
    fill: #FFD700;
}

#seatMap .seat-sold {
    fill: #ccc;
    cursor: not-allowed;
}

.selected-seats-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.selected-seats-panel h3 {
    margin-bottom: 15px;
}

.selected-seats-panel ul {
    list-style: none;
    margin-bottom: 15px;
}

.selected-seats-panel li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

/* ===================================
   自由席リスト
   =================================== */
.free-seats-list {
    display: grid;
    gap: 20px;
}

.free-seat-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.free-seat-section h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.free-seat-section form {
    display: flex;
    gap: 15px;
    align-items: end;
    margin-top: 15px;
}

.free-seat-section label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.free-seat-section input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* ===================================
   決済画面
   =================================== */
.checkout-summary {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.checkout-summary h3 {
    font-size: 18px;
    margin: 20px 0 10px;
}

.checkout-summary ul {
    list-style: none;
    margin: 15px 0;
}

.checkout-summary li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.total-amount {
    font-size: 24px;
    color: #667eea;
    margin: 20px 0;
}

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

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

.form-control {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

#card-errors {
    color: #dc3545;
    margin-top: 10px;
    font-size: 14px;
}

/* ===================================
   購入完了画面
   =================================== */
.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
}

.success-message h1 {
    color: #155724;
    margin-bottom: 10px;
}

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

.order-info {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 15px;
    margin-top: 20px;
}

.order-info dt {
    font-weight: 600;
    color: #666;
}

.order-info dd {
    color: #333;
}

.order-info ul {
    list-style: none;
}

.order-info li {
    padding: 5px 0;
}

.ticket-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.ticket-info h3 {
    margin-bottom: 10px;
    color: #0c5460;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.notes {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.notes h4 {
    margin-bottom: 10px;
}

.notes ul {
    margin-left: 20px;
}

.notes li {
    margin-bottom: 5px;
}

/* ===================================
   アラート
   =================================== */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

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

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

/* ===================================
   フッター
   =================================== */
.site-footer {
    background: #333;
    color: white;
    padding: 30px 0;
    margin-top: 60px;
}

.footer-content {
    text-align: center;
}

.footer-nav {
    margin-top: 15px;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    font-size: 14px;
}

.footer-nav a:hover {
    text-decoration: underline;
}

/* ===================================
   レスポンシブデザイン
   =================================== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .seat-map-container {
        overflow-x: scroll;
    }
    
    #seatMap {
        min-width: 600px;
    }
    
    .order-info {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .free-seat-section form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===================================
   印刷用スタイル
   =================================== */
@media print {
    .site-header,
    .site-footer,
    .action-buttons,
    .notes {
        display: none;
    }
    
    .order-detail {
        box-shadow: none;
    }
}
