﻿/* ========================================
   TOP BAR STYLES
   ======================================== */

.top-bar {
    background-color: #6b1d2d;
    color: #ffffff;
    font-size: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);
    line-height: 1.5;
    padding: 8px 0;
    width: 100%;
}

.top-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    padding: 0 20px;
    margin: 0 auto;
}

/* ========================================
   LEFT SIDE - DATE
   ======================================== */

.top-bar-left {
    display: flex;
    align-items: center;
}

.top-bar-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hijri-date,
.gregorian-date {
    font-weight: 400;
}

.date-separator {
    opacity: 0.6;
    margin: 0 4px;
}

/* ========================================
   RIGHT SIDE - UTILITIES
   ======================================== */

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0;
}

.top-bar-item {
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

    .top-bar-item:first-child {
        border-left: none;
    }

/* RTL Support */
[dir="rtl"] .top-bar-item {
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

    [dir="rtl"] .top-bar-item:first-child {
        border-right: none;
    }

.top-bar-label {
    margin-right: 8px;
    opacity: 0.9;
    font-size: 1em;
}

[dir="rtl"] .top-bar-label {
    margin-right: 0;
    margin-left: 8px;
}

/* ========================================
   FONT SIZE CONTROLS
   ======================================== */

.font-size-controls {
    gap: 5px;
}

.font-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    transition: all 0.2s ease;
    margin-left: 5px;
}

    .font-btn:hover {
        background-color: rgba(255, 255, 255, 0.24);
        border-color: #ffffff;
    }

    .font-btn:focus,
    .font-btn:focus-visible {
        outline: 3px solid #ffffff;
        outline-offset: 2px;
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.22);
    }

/* ========================================
   DARK MODE TOGGLE
   ======================================== */

.theme-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.2s ease;
}

    .theme-btn:hover {
        background-color: rgba(255, 255, 255, 0.22);
    }

    .theme-btn i {
        font-size: 0.9rem;
    }


html.dark-mode .top-bar {
    background-color: #4a1020;
}

/* Active state indicator for dark mode button */
html.dark-mode .theme-btn {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* Smooth transition for theme changes */
.top-bar,
.theme-btn,
.theme-btn i {
    transition: background-color 0.3s ease, color 0.3s ease;
}


/* ========================================
   WELCOME MESSAGE
   ======================================== */

.welcome-message {
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
}

    .welcome-message .user-name {
        font-weight: 600;
    }

.welcome-link {
    color: #ffffff;
}

.welcome-link:focus-visible,
.user-guide-link .guide-link:focus-visible,
.theme-btn:focus-visible,
.chatbot-link .chatbot-btn:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
    border-radius: 6px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.22);
}

    .welcome-link:hover .user-name {
        text-decoration: none;
    }

.user-guide-link .guide-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    font-size: 1rem;
    line-height: 1.5;
}

    .user-guide-link .guide-link:hover {
        color: #ffffff;
        text-decoration: none;
        background-color: rgba(255, 255, 255, 0.12);
        border-radius: 0.375rem;
    }


/* ========================================
   CHATBOT BUTTON
   ======================================== */

.chatbot-link .chatbot-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.2s ease;
}

    .chatbot-link .chatbot-btn:hover {
        background-color: rgba(255, 255, 255, 0.22);
    }

    .chatbot-link .chatbot-btn i {
        font-size: 0.95rem;
    }

    /* focus - consistent with accessibility */
    .chatbot-link .chatbot-btn:focus {
        outline: 3px solid #ffffff;
        outline-offset: 2px;
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.22);
    }

/* dark mode tweak (optional) */
html.dark-mode .chatbot-link .chatbot-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
}


/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 992px) {
    .top-bar-container {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }

    .top-bar-left,
    .top-bar-right {
        width: 100%;
        justify-content: center;
    }

    .top-bar-right {
        flex-wrap: wrap;
        gap: 10px;
    }

    .top-bar-item {
        border: none !important;
        padding: 5px 10px;
    }
}

@media (max-width: 576px) {
    .top-bar {
        font-size: 0.875rem;
    }

    .top-bar-label {
        display: none;
    }

    .top-bar-right {
        gap: 5px;
    }

    .welcome-message span:first-child {
        display: none; /* Hide "Welcome," on mobile, show only name */
    }
}
