/**
 * ACS Business Calendar - フロントエンドCSS
 * カレンダー表示、イベント詳細、予約フォームのスタイル
 */

/* カレンダーコンテナ */
.acs-calendar-container {
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* コントロール */
.acs-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.acs-view-switcher {
    display: flex;
    gap: 5px;
}

.acs-view-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.acs-view-btn:hover {
    background: #f5f5f5;
}

.acs-view-btn.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.acs-calendar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.acs-nav-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.acs-nav-btn:hover {
    background: #f5f5f5;
}

.acs-calendar-title {
    font-size: 18px;
    font-weight: 600;
    min-width: 150px;
    text-align: center;
}

/* ローディング */
.acs-calendar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.acs-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 月表示 */
.acs-month-view {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.acs-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.acs-weekday {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #555;
}

.acs-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
}

.acs-day {
    min-height: 100px;
    padding: 10px;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.acs-day:hover {
    background: #f8f9fa;
}

.acs-day-empty {
    background: #fafafa;
    cursor: default;
}

.acs-day-today {
    background: #fff9e6;
}

.acs-day-has-events .acs-day-number {
    font-weight: bold;
    color: #2271b1;
}

.acs-day-number {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.acs-rokuyou {
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
}

.acs-day-events {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 5px;
}

.acs-event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: pointer;
}

/* リスト表示 */
.acs-list-view {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.acs-no-events {
    padding: 40px;
    text-align: center;
    color: #999;
}

.acs-event-list-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.acs-event-list-item:hover {
    background: #f8f9fa;
}

.acs-event-date {
    flex: 0 0 80px;
    text-align: center;
    margin-right: 20px;
}

.acs-event-month {
    display: block;
    font-size: 12px;
    color: #666;
}

.acs-event-day {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.acs-event-info {
    flex: 1;
}

.acs-event-info h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.acs-event-info p {
    margin: 4px 0;
    font-size: 14px;
    color: #666;
}

.acs-event-status {
    flex: 0 0 60px;
    text-align: center;
}

.acs-availability-icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
}

.acs-event-status.available .acs-availability-icon {
    background: #d1f2eb;
    color: #00a854;
}

.acs-event-status.limited .acs-availability-icon {
    background: #fff3cd;
    color: #ff8c00;
}

.acs-event-status.full .acs-availability-icon {
    background: #f8d7da;
    color: #d63638;
}

/* モーダル */
.acs-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.acs-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.acs-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.acs-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.acs-modal-close:hover {
    background: #e0e0e0;
}

.acs-modal-body {
    padding: 30px;
}

/* イベント詳細 */
.acs-event-detail h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
}

.acs-event-meta {
    margin-bottom: 20px;
}

.acs-event-meta p {
    margin: 8px 0;
    font-size: 15px;
}

.acs-availability {
    font-size: 18px;
    font-weight: bold;
    margin-left: 10px;
}

.acs-event-description {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    line-height: 1.6;
}

.acs-booking-full {
    padding: 15px;
    background: #f8d7da;
    color: #d63638;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

/* 予約フォーム */
.acs-booking-form {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
}

.acs-booking-form h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.acs-booking-form p {
    margin: 15px 0;
}

.acs-booking-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.acs-booking-form .required {
    color: #d63638;
}

.acs-booking-form input[type="text"],
.acs-booking-form input[type="email"],
.acs-booking-form input[type="tel"],
.acs-booking-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.acs-booking-form textarea {
    resize: vertical;
}

.acs-submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.acs-submit-btn:hover {
    background: #135e96;
}

.acs-submit-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

/* 予約メッセージ */
.acs-booking-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

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

.acs-booking-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .acs-calendar-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .acs-view-switcher,
    .acs-calendar-nav {
        justify-content: center;
    }
    
    .acs-day {
        min-height: 80px;
        padding: 5px;
        font-size: 12px;
    }
    
    .acs-day-number {
        font-size: 14px;
    }
    
    .acs-event-list-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .acs-event-date {
        margin-bottom: 10px;
    }
    
    .acs-event-status {
        margin-top: 10px;
    }
    
    .acs-modal-content {
        width: 95%;
    }
    
    .acs-modal-body {
        padding: 20px;
    }
}
}

/* 週表示 - 横並びレイアウト */
.acs-week-view {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

/* 各行：曜日・日付・イベントを横並び */
.acs-week-row {
    display: grid;
    grid-template-columns: 60px 120px 1fr;
    border-bottom: 1px solid #e0e0e0;
    min-height: 60px;
    align-items: center;
    transition: background 0.2s;
}

.acs-week-row:last-child {
    border-bottom: none;
}

.acs-week-row:hover {
    background: #f9f9f9;
}

.acs-week-today {
    background: #e7f3ff !important;
}

.acs-week-has-events {
    background: #fffbf0 !important;
}

.acs-week-today.acs-week-has-events {
    background: #e0f0ff !important;
}

/* 曜日カラム */
.acs-week-day-name {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: #333;
    border-right: 1px solid #e0e0e0;
}

.acs-week-row:first-child .acs-week-day-name {
    color: #e74c3c; /* 日曜日 */
}

.acs-week-row:nth-child(7) .acs-week-day-name {
    color: #3498db; /* 土曜日 */
}

/* 日付カラム */
.acs-week-date {
    padding: 15px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.acs-week-day-number {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.acs-week-today .acs-week-day-number {
    color: #2271b1;
}

.acs-week-rokuyou {
    font-size: 11px;
    color: #666;
}

/* イベントカラム */
.acs-week-events {
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acs-week-no-event {
    color: #999;
    font-size: 14px;
}

.acs-week-event {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border-left: 3px solid #2271b1;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.acs-week-event:hover {
    background: #f5f5f5;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.acs-week-event-time {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    min-width: 45px;
}

.acs-week-event-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.acs-week-event-status {
    font-size: 16px;
    font-weight: 600;
    margin-left: auto;
}

/* 週表示のレスポンシブ対応 */
@media (max-width: 768px) {
    .acs-week-row {
        grid-template-columns: 50px 100px 1fr;
        min-height: 50px;
    }
    
    .acs-week-day-name {
        padding: 10px;
        font-size: 14px;
    }
    
    .acs-week-date {
        padding: 10px;
    }
    
    .acs-week-day-number {
        font-size: 14px;
    }
    
    .acs-week-rokuyou {
        font-size: 10px;
    }
    
    .acs-week-events {
        padding: 8px 10px;
    }
    
    .acs-week-event {
        padding: 6px 8px;
        gap: 6px;
    }
    
    .acs-week-event-time {
        font-size: 11px;
        min-width: 40px;
    }
    
    .acs-week-event-title {
        font-size: 12px;
    }
    
    .acs-week-event-status {
        font-size: 14px;
    }
}

/* イベント画像表示 */
.acs-event-images {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.acs-event-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.acs-event-thumbnail:hover {
    border-color: #2271b1;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 画像ライトボックス */
.acs-image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}

.acs-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.acs-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 8px;
}

.acs-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 36px;
    color: #fff;
    cursor: pointer;
    font-weight: 300;
    line-height: 1;
    transition: color 0.2s;
}

.acs-lightbox-close:hover {
    color: #ccc;
}

@media (max-width: 768px) {
    .acs-event-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .acs-lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .acs-lightbox-close {
        top: -35px;
        font-size: 30px;
    }
}

/* イベント詳細ページURLボタン */
.acs-event-link-button {
    margin: 15px 0;
}

.acs-detail-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.acs-detail-link-btn:hover {
    background: #135e96;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.acs-detail-link-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .acs-detail-link-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
}
