@import 'variables.css';

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-secondary);
    background-color: var(--color-background);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header inspired by Berlin.de */
.site-header {
    background-color: var(--color-white);
    border-bottom: 5px solid var(--color-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    flex-wrap: wrap;
    gap: var(--spacing-sm) var(--spacing-lg);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--color-secondary);
    text-decoration: none;
    flex-shrink: 0;
}

.search-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 0 1 auto;
    min-width: 280px;
    justify-content: flex-start;
}

#search-input {
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    width: 100%;
    max-width: 400px;
    height: 40px;
}

.brand-logo svg {
    height: 40px;
    width: auto;
}

.header-nav {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    /* Standardize height */
    padding: 0 var(--spacing-md);
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s;
    line-height: 1;
}

.btn-icon {
    width: 40px;
    padding: 0;
    flex: none !important;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: #003366;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Main Layout */
.main-container {
    flex: 1;
    position: relative;
    display: flex;
    overflow: hidden;
}

/* Sidebar/Modal Containers */
.sidebar {
    width: 400px;
    max-width: 100%;
    background: var(--color-white);
    border-right: 1px solid var(--color-border);
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 900;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: var(--shadow-md);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: var(--spacing-md);
    background-color: var(--color-primary);
    color: var(--color-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.sidebar-content {
    padding: var(--spacing-md);
    overflow-y: auto;
    flex: 1;
}

/* Footer Placeholder */
.site-footer {
    background-color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.8rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    color: #666;
}

/* Media Queries */
@media (max-width: 940px) {
    .site-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }

    .brand-logo {
        justify-content: flex-start;
    }

    .header-nav {
        justify-content: flex-start;
        order: 1;
        margin-left: 0;
        /* Keep buttons near logo */
    }

    .search-container {
        width: 100%;
        order: 2;
        /* Search bar at the bottom of header */
        margin-right: 0;
    }

    #search-input {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: var(--spacing-sm);
    }

    .brand-logo {
        font-size: 1.25rem;
    }

    .brand-logo svg {
        height: 32px;
    }

    .sidebar {
        width: 100%;
    }

    .site-footer {
        justify-content: center;
        gap: var(--spacing-sm);
        text-align: center;
    }

    .site-footer span {
        display: none;
        /* Hide separators */
    }

    .site-footer span:last-of-type {
        display: inline;
        width: auto;
        margin-left: 0 !important;
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .header-nav {
        width: 100%;
        justify-content: center;
    }

    .header-nav .btn {
        flex: 1;
    }

    .btn {
        height: 48px;
        font-size: 1rem;
        padding: 0 var(--spacing-sm);
    }

    #search-input {
        height: 48px;
    }

    .btn-icon {
        width: 48px;
        height: 48px;
    }
}

/* User Initials Button */
.user-initials-btn {
    font-weight: bold;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* Custom Tooltip */
.custom-tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    z-index: 10000;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Comment Actions */
.comment-actions {
    opacity: 0.4;
    transition: opacity 0.2s;
}

.comment:hover .comment-actions {
    opacity: 1;
}

.btn-xs {
    font-size: 0.75rem;
    padding: 2px 6px;
    height: auto;
    min-height: 0;
    line-height: 1.2;
}

.btn-icon-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-icon-circle:hover {
    background: #e2e6ea;
    color: #333;
    border-color: #adb5bd;
    transform: scale(1.05);
}

.btn-icon-circle:active {
    transform: scale(0.95);
}