/**
 * MOVIE ON Widget Styles
 * コンパクトな埋め込み用ウィジェット向けスタイル
 */

/* === ベーススタイル === */
.movieon-widget {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    line-height: 1.5;
    color: #333;
}

/* === ヘッダー === */
.widget-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 12px 20px;
    text-align: center;
}

.widget-title {
    margin: 0;
    font-size: 1.1em;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* === コンテンツエリア === */
.widget-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.widget-date-group {
    border-bottom: 1px solid #eee;
}

.widget-date-group:last-child {
    border-bottom: none;
}

.widget-date {
    background: #f8f9fa;
    padding: 8px 15px;
    font-weight: bold;
    font-size: 0.9em;
    color: #1e3c72;
    border-left: 4px solid #2a5298;
    position: sticky;
    top: 0;
    z-index: 2;
}

.widget-movies {
    padding: 0;
}

/* === 映画カード === */
.movie-card {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    min-height: 60px;
}

.movie-card:hover {
    background-color: #f8f9fa;
}

.movie-card:last-child {
    border-bottom: none;
}

.movie-card.unavailable {
    opacity: 0.6;
    background-color: #fafafa;
}

.movie-info {
    flex: 1;
    min-width: 0;
}

.movie-title {
    font-weight: bold;
    font-size: 0.95em;
    color: #1e3c72;
    margin-bottom: 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.movie-details > span {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
    white-space: nowrap;
}

.showtime {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    font-weight: bold;
    padding: 3px 8px !important;
}

.screen {
    background: #6c757d;
    color: white;
}

.rating {
    background: #ffc107;
    color: #333;
    font-weight: bold;
}

.seat-info {
    font-size: 0.8em;
    font-weight: bold;
    padding: 3px 0;
}

.seat-info.available {
    color: #28a745;
}

.seat-info.few-seats {
    color: #ffc107;
}

.seat-info.sold-out {
    color: #dc3545;
}

.movie-action {
    margin-left: 10px;
    flex-shrink: 0;
}

.book-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.book-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.4);
}

.book-btn:active {
    transform: translateY(0);
}

/* === フッター === */
.widget-footer {
    background: #f8f9fa;
    padding: 10px 15px;
    text-align: center;
    border-top: 1px solid #eee;
}

.widget-link {
    color: #2a5298;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    transition: color 0.2s ease;
}

.widget-link:hover {
    color: #1e3c72;
    text-decoration: underline;
}

/* === ローディング === */
.widget-loading {
    padding: 40px 20px;
    text-align: center;
}

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2a5298;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.loading-text {
    color: #666;
    font-size: 0.9em;
}

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

/* === エラー表示 === */
.widget-error {
    padding: 30px 20px;
    text-align: center;
    color: #666;
}

.error-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.error-text {
    font-size: 0.9em;
    margin-bottom: 8px;
}

.error-detail {
    font-size: 0.8em;
    color: #999;
    font-family: monospace;
}

/* === 空データ === */
.widget-empty {
    padding: 30px 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

/* === テーマバリエーション === */

/* モダンテーマ（デフォルト） */
.movieon-widget-modern {
    /* 既定のスタイル */
}

/* クラシックテーマ */
.movieon-widget-classic {
    border: 2px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.movieon-widget-classic .widget-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.movieon-widget-classic .showtime {
    background: #3498db;
}

.movieon-widget-classic .book-btn {
    background: #e74c3c;
}

/* ミニマルテーマ */
.movieon-widget-minimal {
    border: 1px solid #e0e0e0;
    box-shadow: none;
}

.movieon-widget-minimal .widget-header {
    background: #f5f5f5;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
}

.movieon-widget-minimal .widget-title {
    text-shadow: none;
}

.movieon-widget-minimal .showtime {
    background: #333;
}

.movieon-widget-minimal .book-btn {
    background: #333;
    border-radius: 4px;
}

/* === レスポンシブ対応 === */
@media (max-width: 480px) {
    .movieon-widget {
        font-size: 0.9em;
    }
    
    .widget-header {
        padding: 10px 15px;
    }
    
    .widget-title {
        font-size: 1em;
    }
    
    .movie-card {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        min-height: auto;
    }
    
    .movie-action {
        margin-left: 0;
        margin-top: 8px;
        align-self: flex-end;
    }
    
    .movie-details {
        gap: 4px;
    }
    
    .movie-details > span {
        font-size: 0.7em;
        padding: 1px 5px;
    }
    
    .book-btn {
        font-size: 0.75em;
        padding: 5px 10px;
    }
}

@media (max-width: 320px) {
    .movieon-widget {
        font-size: 0.85em;
    }
    
    .movie-title {
        font-size: 0.9em;
    }
}

/* === 高さ制限バリエーション === */
.movieon-widget[data-height="compact"] .widget-content {
    max-height: 250px;
}

.movieon-widget[data-height="tall"] .widget-content {
    max-height: 600px;
}

/* === スクロールバーのスタイリング（Webkit系） === */
.widget-content::-webkit-scrollbar {
    width: 6px;
}

.widget-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.widget-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.widget-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
