.page-find-middle-container {
    width: 100%;
    position: relative;
    height: auto;
    /* min-height: 100vh; */
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}
  
.station-widget-container {
    margin: 1em;
    position: relative;
}
  
.station-widget {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.station-widget:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.widget-header {
    background: #f8fafc;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.widget-header h3 {
    background: none;
    padding: 0;
}

.widget-header h3::before {
    background: none;
    border: none;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-widget {
    background: none;
    border: none;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toggle-widget:hover {
    background: #e2e8f0;
    color: #334669;
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #334669;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #64748b;
}

.status-number {
    background: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
}

.api-badge {
    background: #10b981;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    margin-left: 4px;
}

/* ローディングアニメーション */
.loading-item {
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
}

.spinner-ring {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 1.5s ease-in-out infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.3s;
    background: #2196F3;
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.6s;
    background: #FF9800;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

.loading-text {
    color: #334669;
    font-size: 18px;
    margin: 10px 0;
    animation: fadeInOut 2s ease-in-out infinite;
}

.loading-subtext {
    color: #64748b;
    font-size: 14px;
    margin: 8px 0 16px 0;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.loading-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dots .dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ツールチップスタイル */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(51, 70, 105, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
    width: 200px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: tooltipFadeIn 0.3s ease-out;
    pointer-events: none;
}

[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(51, 70, 105, 0.95);
    z-index: 1000;
    animation: tooltipFadeIn 0.3s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* モバイル対応 */
@media (max-width: 768px) {
    [data-tooltip]:hover::before {
        width: 180px;
        font-size: 11px;
        padding: 6px 10px;
    }
    
    /* タッチデバイスでのツールチップ表示 */
    [data-tooltip]:active::before,
    [data-tooltip]:active::after {
        display: block;
    }
}

/* カルーセル内のツールチップ位置調整 */
.carousel-item [data-tooltip]:hover::before {
    bottom: 140%;
    width: 250px;
}
  
  
.widget-content {
    padding: 16px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.station-widget.collapsed .widget-content {
    display: none;
}

.station-grid-wrapper {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fafafa;
}

.station-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
}

.station-grid:empty::after {
    content: "駅を追加してください";
    display: block;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    padding: 20px;
    font-style: italic;
}

/* カスタムスクロールバー */
.station-grid-wrapper::-webkit-scrollbar {
    width: 6px;
}

.station-grid-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.station-grid-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.station-grid-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
  
.station-item {
    width: 100%;
}
  
.station-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    position: relative;
    transition: all 0.2s ease;
}

.station-card:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.station-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e7ff;
    border-radius: 6px;
}

.station-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
  
.station-name {
    margin: 0 !important;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.station-line {
    margin: 0;
    font-size: 11px;
    color: #64748b;
}

.remove-station {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    /* background: #ef4444; */
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-station:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.widget-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.add-station-btn,
.recalculate-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-station-btn {
    background: #4CAF50;
    color: white;
}

.add-station-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.recalculate-btn {
    background: #2196F3;
    color: white;
}

.recalculate-btn:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.recalculate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .station-widget-container {
        margin: 0.5em;
    }
    
    .widget-header {
        padding: 10px 14px;
    }
    
    .widget-title {
        font-size: 15px;
    }
    
    .widget-content {
        padding: 14px;
    }
    
    .station-grid-wrapper {
        max-height: 250px;
    }
    
    .station-grid {
        padding: 10px;
    }
    
    .station-card {
        padding: 10px;
    }
    
    .station-name {
        font-size: 14px;
    }
    
    .station-line {
        font-size: 11px;
    }
    
    .widget-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .add-station-btn,
    .recalculate-btn {
        width: 100%;
    }
}