/* === Header Main Bar === */
#main-header {
    grid-area: header;
    padding: 0 20px;
    
    /* Glassmorphism Effect */
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);

    /* 3D Tilt */
    transform: translateZ(200px) var(--header-rotate-x) var(--header-rotate-y);
    transition: transform 0.1s ease-out, background-color 0.3s ease, border-color 0.3s ease;

    /* Grid layout */
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: center;
}

/* === Header Sections === */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-center {
    display: flex;
    justify-content: center;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

/* === Header Title === */
.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
}

/* === Logo === */
.logo-container {
    display: flex;
    align-items: center;
    /* This ensures it doesn't shrink */
    flex-shrink: 0; 
}

.logo {
    height: 40px; /* <--- THIS IS THE FIX for giant logo */
    width: auto;
    display: none; /* Hide both by default */
}

/* Show correct logo based on theme */
.logo-light { display: block; }
.dark-mode .logo-light { display: none; }
.dark-mode .logo-dark { display: block; }


/* === Search Bar === */
.search-bar {
    display: flex;
    align-items: center;
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 20px; /* Space for icon on the right */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: left; /* From user request */
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

.search-input:focus {
    outline: 2px solid var(--focus-ring-color); /* Fixed this */
    outline-offset: 2px;
    background-color: var(--input-bg-focus);
    border-color: var(--focus-ring-color);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px;
    background-color: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background-color: var(--input-bg-focus);
    color: var(--focus-ring-color);
}

.search-btn:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
}

/* === Theme Toggle Button === */
.theme-toggle-btn {
    background-color: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background-color: var(--input-bg-focus);
    color: var(--focus-ring-color);
}

.theme-toggle-btn:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
}

.theme-toggle-btn .sun-icon { display: none; }
.theme-toggle-btn .moon-icon { display: block; }

.dark-mode .theme-toggle-btn .sun-icon { display: block; }
.dark-mode .theme-toggle-btn .moon-icon { display: none; }

