/**
 * 施設稼働率ウィジェット - コンポーネント版
 * 既存HTMLに組み込み可能
 */

.occupancy-widget {
    font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.occupancy-widget * {
    box-sizing: border-box;
}

/* ヘッダー */
.occupancy-widget .widget-header {
    text-align: center;
    margin-bottom: 32px;
}

.occupancy-widget .widget-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #534d46;
    display: inline-block;
}

.occupancy-widget .widget-title-icon {
    display: inline-block;
    animation: widget-pulse 2s ease-in-out infinite;
}

.occupancy-widget .widget-last-update {
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
}

/* V2: 凡例削除のためスタイル削除 */

/* フロアカードコンテナ */
.occupancy-widget .widget-floors-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* フロアカード */
.occupancy-widget .widget-floor-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
    animation: widget-slideUp 0.5s ease-out both;
}

.occupancy-widget .widget-floor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.occupancy-widget .widget-floor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.occupancy-widget .widget-floor-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.occupancy-widget .widget-floor-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d3748;
}

/* ウィジェット用フロアタイプバッジ */
.occupancy-widget .widget-floor-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid;
    transition: all 0.3s;
}

.occupancy-widget .widget-floor-type-badge:hover {
    transform: scale(1.05);
}

.occupancy-widget .widget-floor-type-male {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.15));
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.3);
}

.occupancy-widget .widget-floor-type-female {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(219, 39, 119, 0.15));
    color: #db2777;
    border-color: rgba(236, 72, 153, 0.3);
}

.occupancy-widget .widget-floor-type-reserved {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.15), rgba(75, 85, 99, 0.15));
    color: #4b5563;
    border-color: rgba(107, 114, 128, 0.3);
}

/* ウィジェット用貸切フロアスタイル */
.occupancy-widget .widget-floor-card-reserved {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-color: #d1d5db;
}

.occupancy-widget .widget-floor-card-reserved:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.occupancy-widget .widget-reserved-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
}

.occupancy-widget .widget-reserved-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.6;
    animation: widget-pulse 2s ease-in-out infinite;
}

.occupancy-widget .widget-reserved-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 1.5px;
}



/* 営業時間外・定休日オーバーレイ */
.occupancy-widget .widget-business-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    text-align: center;
    animation: widget-scaleIn 0.4s ease-out;
}

.occupancy-widget .widget-business-status-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #a0aec0;
    animation: widget-pulse 2s ease-in-out infinite;
}

.occupancy-widget .widget-business-status-icon-svg svg {
    width: 64px;
    height: 64px;
}

.occupancy-widget .widget-icon-alert {
    color: #ecc94b;
}

.occupancy-widget .widget-business-status-text {
    font-size: 2rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 12px;
}

.occupancy-widget .widget-business-status-sub {
    font-size: 1rem;
    color: #718096;
}

.occupancy-widget .widget-status-display-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.occupancy-widget .widget-status-icon-v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 12px;
    animation: widget-scaleIn 0.4s ease-out;
}

.occupancy-widget .widget-status-icon-v2 svg {
    width: 48px;
    height: 48px;
}

.occupancy-widget .widget-status-text-v2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4a5568;
}

/* V2用ステータスカラー背景（薄い色） */
.occupancy-widget .widget-status-low {
    color: #48bb78;
    background: rgba(72, 187, 120, 0.1);
}

.occupancy-widget .widget-status-medium {
    color: #ed8936;
    background: rgba(237, 137, 54, 0.1);
}

.occupancy-widget .widget-status-high {
    color: #f56565;
    background: rgba(245, 101, 101, 0.1);
}

.occupancy-widget .widget-status-low {
    color: #48bb78;
    text-shadow: 0 0 15px rgba(72, 187, 120, 0.3);
}

.occupancy-widget .widget-status-medium {
    color: #ed8936;
    text-shadow: 0 0 15px rgba(237, 137, 54, 0.3);
}

.occupancy-widget .widget-status-high {
    color: #f56565;
    text-shadow: 0 0 15px rgba(245, 101, 101, 0.3);
}

/* V2: 詳細情報削除のためスタイル削除 */

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

.occupancy-widget .widget-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: widget-spin 1s linear infinite;
}

/* エラーメッセージ */
.occupancy-widget .widget-error-message {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid #f56565;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    text-align: center;
    color: #c53030;
}

.occupancy-widget .widget-error-icon {
    font-size: 1.3rem;
    margin-right: 8px;
}

/* アニメーション */
@keyframes widget-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes widget-scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

@keyframes widget-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes widget-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes widget-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* レスポンシブ */
@media (max-width: 768px) {
    .occupancy-widget .widget-title {
        font-size: 1.6rem;
    }

    .occupancy-widget .widget-floors-container {
        grid-template-columns: 1fr;
    }

    .occupancy-widget .widget-legend {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .occupancy-widget {
        padding: 12px;
    }

    .occupancy-widget .widget-floor-card {
        padding: 18px;
    }

    .occupancy-widget .widget-occupancy-rate {
        font-size: 2rem;
    }

    .occupancy-widget .widget-details {
        grid-template-columns: 1fr;
    }
}