/* ===================================
   Global Smooth Scrolling
   =================================== */
html {
    scroll-behavior: smooth;
}

/* Improve scrolling performance */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

h1 { font-family: Arial, Helvetica, sans-serif; }

/* ===================================
   Dynamic News Banner (Twitter/X Style)
   =================================== */
.news-banner {
    position: fixed;
    top: -200px; /* Hidden above screen */
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateY(0);
}

.news-banner.show {
    transform: translateY(200px); /* Slide down */
}

.news-banner.minimized {
    transform: translateY(160px); /* Partially visible */
}

.news-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.news-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.news-banner-icon {
    font-size: 24px;
    animation: pulse 2s infinite;
}

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

.news-banner-label {
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
}

.news-banner-main {
    flex: 1;
    min-width: 300px;
    color: white;
}

.news-banner-emoji {
    font-size: 28px;
    margin-right: 12px;
    display: inline-block;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.news-banner-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.news-banner-details {
    font-size: 14px;
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.news-banner-separator {
    opacity: 0.6;
}

.news-banner-deadline {
    font-size: 13px;
    opacity: 0.9;
    margin: 4px 0 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-banner-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.news-banner-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.news-banner-btn-primary {
    background: white;
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.news-banner-btn-primary:hover {
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.news-banner-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.news-banner-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.news-banner-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.news-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .news-banner {
        top: -300px;
    }
    
    .news-banner.show {
        transform: translateY(300px);
    }
    
    .news-banner.minimized {
        transform: translateY(260px);
    }
    
    .news-banner-content {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    
    .news-banner-left {
        width: 100%;
        justify-content: center;
    }
    
    .news-banner-main {
        text-align: center;
        min-width: unset;
    }
    
    .news-banner-title {
        font-size: 18px;
    }
    
    .news-banner-details {
        justify-content: center;
        font-size: 13px;
    }
    
    .news-banner-actions {
        width: 100%;
        justify-content: center;
    }
    
    .news-banner-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ===================================
   Organization Tab Buttons (Support Organizations Section)
   =================================== */
.org-tab-btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.org-tab-btn:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.org-tab-btn.active {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.org-tab-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* Mobile responsive for org tabs */
@media (max-width: 768px) {
    .org-tab-btn {
        padding: 12px 20px;
        font-size: 14px;
        flex: 1;
        min-width: 140px;
    }
}

/* ===================================
   Card Hover Effects
   =================================== */
.card-hover {
    transition: all 0.3s ease;
}

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

/* ===================================
   Back to Top Button
   =================================== */
.back-to-top-button {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 9999;
}

.back-to-top-button.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-button:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.6);
}

.back-to-top-button:active {
    transform: translateY(-2px);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .back-to-top-button {
        bottom: 90px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* ===================================
   Quick Navigation (独立機能 - 簡単に削除可能)
   =================================== */

/* デスクトップ用フローティングナビ */
.quick-nav {
    position: fixed;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 16px;
    z-index: 9998;
    width: 200px;
    transition: all 0.3s ease;
}

.quick-nav:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.quick-nav-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
}

.quick-nav-header i {
    font-size: 16px;
}

.quick-nav-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.quick-nav-item i {
    width: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.quick-nav-item:hover {
    background: #f3f4f6;
    color: #2563eb;
    transform: translateX(-3px);
}

.quick-nav-item:hover i {
    color: #2563eb;
}

.quick-nav-item.active {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    font-weight: 600;
}

.quick-nav-item.active i {
    color: #1e40af;
}

/* モバイル用ボトムナビ */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    z-index: 1000;
    align-items: center;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 9998;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    text-decoration: none;
    color: #6b7280;
    font-size: 11px;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 100px;
}

.mobile-nav-item i {
    font-size: 20px;
    transition: all 0.2s ease;
}

.mobile-nav-item span {
    font-weight: 500;
    white-space: nowrap;
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

.mobile-nav-item:active i {
    color: #2563eb;
}

/* チャットボタンのスタイル */
.chatbot-button-container {
    z-index: 10000 !important;
}

/* デスクトップではクイックナビのみ表示 */
@media (min-width: 1024px) {
    .mobile-bottom-nav {
        display: none;
    }
}

/* モバイルではボトムナビのみ表示 */
@media (max-width: 1023px) {
    .quick-nav {
        display: none;
    }
    
    /* モバイルではBack to Topボタンの位置を調整 */
    .back-to-top-button {
        bottom: 90px !important;
    }
    
    /* モバイルではチャットボタンの位置を調整 */
    .chatbot-button-container {
        bottom: 90px !important;
    }
}