/* ==================== CHATBOX STYLES ==================== */

/* Chatbox Container */
#chatbox-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--font-main);
}

/* Chat Button */
#chat-button {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1000;
}

#chat-button:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 8px 30px rgba(251, 191, 36, 0.6);
}

#chat-button.active {
    transform: scale(0.9);
}

#chat-button svg {
    width: 32px;
    height: 32px;
    fill: #0f172a;
    transition: transform 0.3s;
}

#chat-button:hover svg {
    transform: scale(1.1) rotate(5deg);
}

/* Notification Badge */
#chat-button .notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    border: 2px solid var(--bg-color);
}

@keyframes pulse {

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

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

/* Chat Window */
#chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(43, 65, 98, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

#chat-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Chat Header */
#chat-header {
    background: var(--primary-gradient);
    color: white;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

#chat-header .header-subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
    color: var(--accent-color);
}

#chat-close {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

#chat-close:hover {
    background: rgba(247, 215, 116, 0.2);
}

/* Chat Messages */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 0.6rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.message.bot .message-avatar {
    background: var(--primary-gradient);
}

.message.user .message-avatar {
    background: var(--accent-color);
}

.message-content {
    max-width: 75%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.9rem;
}

.message.bot .message-content {
    background: var(--white);
    color: var(--text-color);
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message.user {
    flex-direction: row-reverse;
}

.message.user .message-content {
    background: var(--accent-color);
    color: var(--text-color);
    border-bottom-right-radius: 4px;
}

/* Message Content Formatting */
.message-content strong {
    font-weight: 600;
    color: var(--text-color);
}

.message-content a {
    color: #2b4162;
    text-decoration: underline;
    font-weight: 500;
}

.message-content a:hover {
    color: #f7d774;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 0.8rem 1rem;
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    max-width: 60px;
}

.typing-indicator.active {
    display: block;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Quick Action Buttons */
.quick-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.8rem 1rem;
    background: var(--bg-color);
    border-top: 1px solid #e0e0e0;
}

.quick-action-btn {
    padding: 0.4rem 0.8rem;
    background: var(--white);
    border: 1px solid var(--accent-color);
    color: var(--text-color);
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.quick-action-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* Chat Input */
#chat-input-container {
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 0.9rem;
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.2s;
    background: var(--bg-color);
    color: var(--text-color);
}

#chat-input:focus {
    border-color: var(--accent-color);
}

#chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#chat-send:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: scale(1.1);
}

#chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#chat-send svg {
    width: 20px;
    height: 20px;
    fill: var(--text-color);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-light);
}

.welcome-message h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.welcome-message p {
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

/* Dark Mode Support */
[data-theme="dark"] #chat-window {
    background: var(--white);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .message.bot .message-content {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: var(--text-color);
}

[data-theme="dark"] #chat-input {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: var(--text-color);
}

[data-theme="dark"] .quick-action-btn {
    background: #2a2a2a;
    border-color: var(--accent-color);
    color: var(--text-color);
}



/* ==================== ACTIVITY PANEL STYLES ==================== */

.activity-panel {
    background: var(--bg-color);
    border-top: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    max-height: 300px;
    overflow: hidden;
}

.activity-panel.collapsed {
    max-height: 45px;
}

.activity-panel.collapsed .activity-content {
    display: none;
}

.activity-header {
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    border-bottom: 1px solid #e0e0e0;
}

.activity-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.activity-toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.activity-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.activity-content {
    padding: 0.5rem;
    max-height: 240px;
    overflow-y: auto;
}

.activity-content::-webkit-scrollbar {
    width: 4px;
}

.activity-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 2px;
}

.activity-card {
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 0.6rem;
    transition: all 0.2s;
}

.activity-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.activity-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-color);
    font-weight: 600;
}

.activity-date {
    display: inline-block;
    background: var(--accent-color);
    color: var(--text-color);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.activity-speaker,
.activity-details,
.activity-date-full {
    margin: 0.3rem 0;
    font-size: 0.75rem;
    color: var(--text-light);
}

.activity-view-all {
    display: block;
    text-align: center;
    padding: 0.6rem;
    background: var(--white);
    color: #2b4162;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid var(--accent-color);
}

.activity-view-all:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

.activity-loading,
.activity-empty,
.activity-error {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.activity-empty a {
    color: #2b4162;
    text-decoration: underline;
}

/* ==================== GALLERY MODAL STYLES ==================== */

.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    background: var(--white);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-modal-header {
    padding: 1.2rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.gallery-close-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.gallery-close-btn:hover {
    background: rgba(247, 215, 116, 0.2);
}

.gallery-categories {
    padding: 1rem 1.5rem;
    background: var(--bg-color);
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gallery-category-btn {
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 2px solid #e0e0e0;
    color: var(--text-color);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.gallery-category-btn:hover {
    border-color: var(--accent-color);
    background: var(--accent-color);
}

.gallery-category-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-color);
    font-weight: 600;
}

.gallery-grid {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    align-content: start;
}

.gallery-grid::-webkit-scrollbar {
    width: 8px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.gallery-item {
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item-img {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    background-image: linear-gradient(45deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 50%, #f0f0f0 50%, #f0f0f0 75%, #e0e0e0 75%, #e0e0e0);
    background-size: 40px 40px;
}

.gallery-item-info {
    padding: 1rem;
}

.gallery-item-info h4 {
    margin: 0 0 0.4rem 0;
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 600;
}

.gallery-item-info p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.4;
}

.gallery-loading,
.gallery-empty,
.gallery-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

/* ==================== IMAGE VIEWER STYLES ==================== */

.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-viewer.active {
    display: flex;
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 10;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 3rem;
    width: 60px;
    height: 60px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.image-prev {
    left: 30px;
}

.image-next {
    right: 30px;
}

.image-viewer-content {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.image-viewer-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.image-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    text-align: center;
    max-width: 600px;
}

.image-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: #2b4162;
}

.image-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 10px;
    }

    #chatbox-container {
        bottom: 10px;
        right: 10px;
    }

    #chat-button {
        width: 55px;
        height: 55px;
    }

    .message-content {
        max-width: 85%;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.8rem;
        padding: 1rem;
    }

    .gallery-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .gallery-categories {
        padding: 0.8rem;
    }

    .gallery-category-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    .activity-panel {
        max-height: 250px;
    }

    .activity-content {
        max-height: 190px;
    }

    .image-nav-btn {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .image-prev {
        left: 15px;
    }

    .image-next {
        right: 15px;
    }

    .image-viewer-close {
        top: 15px;
        right: 15px;
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    #chat-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    #chatbox-container {
        bottom: 0;
        right: 0;
    }

    #chat-button {
        bottom: 10px;
        right: 10px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        padding: 0.8rem;
    }

    .gallery-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .gallery-categories {
        padding: 0.6rem;
        gap: 0.4rem;
    }

    .activity-panel {
        max-height: 200px;
    }

    .activity-card {
        padding: 0.6rem;
    }

    .image-viewer-content {
        max-width: 95%;
    }

    .image-info {
        padding: 1rem;
    }

    .image-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

/* Dark Mode for New Components */
[data-theme="dark"] .activity-panel,
[data-theme="dark"] .activity-header,
[data-theme="dark"] .activity-card,
[data-theme="dark"] .gallery-modal-content,
[data-theme="dark"] .gallery-item,
[data-theme="dark"] .gallery-category-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

[data-theme="dark"] .gallery-categories {
    background: #1a1a1a;
}

[data-theme="dark"] .image-info {
    background: rgba(42, 42, 42, 0.95);
}

[data-theme="dark"] .image-info h3 {
    color: var(--accent-color);
}

[data-theme="dark"] .image-info p {
    color: #ccc;
}