/* SciencesConf Replica Theme */
:root {
    --primary-color: #004d7f;
    /* SciencesConf Blue/Grey tone, adjustable */
    --secondary-color: #003355;
    --accent-color: #e67e22;
    --bg-body: #eaedf0;
    /* Light grey background outside the sheet */
    --bg-sheet: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #dddddd;
    --header-height: 180px;
    --sidebar-width: 260px;
    --font-main: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    font-size: 14px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Page Wrapper */
#wrapper {
    max-width: 1140px;
    margin: 0 auto;
    background-color: var(--bg-sheet);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: visible;
    /* Changed from hidden to visible for the search bar popover */
}

/* Optional: Decorative circle or abstract shape in header */
header::after {
    content: '';
    position: absolute;
    right: -50px;
    top: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
    /* Let clicks pass through */
}

.header-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    z-index: 1;
}

.header-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    z-index: 1;
}

/* Top Bar (Login etc) */
.user-bar {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 0.85rem;
    z-index: 10;
    display: flex;
    align-items: center;
}

.user-bar a {
    color: white;
    margin-left: 15px;
    opacity: 0.8;
}

.user-bar a:hover {
    opacity: 1;
    text-decoration: none;
}

/* Search Bar Container */
.search-container {
    display: inline-block;
    position: relative;
    margin-left: 10px;
}

.search-icon-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    vertical-align: middle;
}

/* Hidden search input that expands or appears */
.search-input-wrapper {
    display: none;
    position: absolute;
    right: 0;
    top: 30px;
    background: white;
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    width: 200px;
    align-items: center;
}

.search-input-wrapper.active {
    display: flex;
}

.search-input-wrapper input {
    margin-bottom: 0;
    border: 1px solid #ddd;
    font-size: 0.85rem;
    padding: 5px;
}

.search-input-wrapper button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 8px;
    margin-left: 5px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.85rem;
}


/* Layout Container (Sidebar + Main) */
.columns-container {
    display: flex;
    flex: 1;
    border-top: 1px solid var(--border-color);
}

/* Sidebar Navigation */
#sidebar {
    width: var(--sidebar-width);
    background-color: #f7f9fa;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    flex-shrink: 0;
}

#sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sidebar ul li {
    margin-bottom: 0;
    border-bottom: 1px solid #e0e0e0;
}

#sidebar ul li:last-child {
    border-bottom: none;
}

#sidebar ul li a {
    display: block;
    padding: 10px 15px;
    color: var(--text-main);
    font-weight: 600;
    /* Bold links like SciencesConf */
    transition: background 0.2s, color 0.2s;
}

#sidebar ul li a:hover,
#sidebar ul li a.active {
    background-color: white;
    color: var(--primary-color);
    box-shadow: -3px 0 0 var(--primary-color) inset;
    /* Left border indicator */
    text-decoration: none;
}

/* Sidebar Widgets */
.sidebar-widget {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--primary-color);
}

.sidebar-widget h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-weight: 700;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 100%;
    /* Prevent overflow */
}

h1.page-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-weight: normal;
}

h2 {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.2rem;
    color: #444;
    margin-bottom: 0.8rem;
}

p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Cards (for news, info) */
.card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-box {
    background: #eef5f9;
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin-bottom: 20px;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-bottom: 10px;
    font-family: inherit;
}

button.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1rem;
}

button.btn-primary:hover {
    background-color: var(--secondary-color);
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    background: #333;
    color: white;
    padding: 10px;
    text-align: right;
    cursor: pointer;
}

/* Footer */
footer {
    background-color: #f7f9fa;
    border-top: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    color: #777;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .columns-container {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: none;
        /* Hidden by default on mobile */
    }

    #sidebar.active {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    header {
        height: auto;
        padding: 1.5rem;
    }

    .header-title {
        font-size: 1.5rem;
    }
}