/*
OpenAlbaResearchMap
Main Application Styles (app.css)
*/

:root {
    --primary-color: #1f4e79;
    --secondary-color: #eef4f6;
    --border-color: #d8dde3;
    --box-shadow:
        0 2px 8px rgba(0,0,0,0.12);
    --text-color:#333;
    --dashboard-width:360px;
    --header-height:60px;
    --footer-height:45px;
}
/*
|--------------------------------------------------------------------------
| Global
|--------------------------------------------------------------------------
*/
* {
    box-sizing:border-box;
}
html,
body {
    margin:0;
    padding:0;
    width:100%;
    height:100%;
    font-family:
        "Segoe UI",
        Arial,
        sans-serif;
    color:var(--text-color);
}
body {
    display:flex;
    flex-direction:column;
}
/*
|--------------------------------------------------------------------------
| Header
|--------------------------------------------------------------------------
*/
.header {
    min-height:var(--header-height);
    display:flex;
    align-items:center;
    gap:12px;
    padding:10px 20px;
    background:white;
    border-bottom:
        1px solid var(--border-color);
    position:relative;
    z-index:3500;
    flex-wrap:wrap;
}
.header-title {
    font-size:20px;
    font-weight:600;
    color:var(--primary-color);
}
.main-menu {
    display:flex;
    gap:14px;
    align-items:center;
}
.menu-panel {
    display:flex;
    align-items:center;
    margin-left:auto;
    gap:8px;
}
.main-menu a {
    color:var(--primary-color);
    text-decoration:none;
    font-weight:600;
    font-size:14px;
}
.main-menu a:hover {
    text-decoration:underline;
}
.menu-toggle {
    display:none;
    border:1px solid var(--border-color);
    background:#fff;
    color:var(--primary-color);
    border-radius:6px;
    padding:7px 10px;
    font-weight:600;
    cursor:pointer;
}
.language-menu {
    white-space:nowrap;
    margin-left:8px;
}
.language-menu a {
    color:var(--primary-color);
    text-decoration:none;
    font-weight:600;
}
.language-menu a:hover {
    text-decoration:underline;
}

.header-logout-form {
    display:inline-block;
    margin-left:8px;
}

.header-logout-button {
    border:1px solid var(--border-color);
    background:#fff;
    color:var(--primary-color);
    border-radius:6px;
    padding:5px 9px;
    font-size:12px;
    cursor:pointer;
}

.header-logout-button:hover {
    background:#f5f9fc;
}

.content-page {
    flex:1;
    display:flex;
    align-items:flex-start;
    justify-content:center;
    padding:40px 20px;
    background:var(--secondary-color);
}

.content-card {
    width:min(900px, 100%);
    background:#fff;
    border:1px solid var(--border-color);
    border-radius:12px;
    box-shadow:var(--box-shadow);
    padding:24px;
}

.content-card h1 {
    margin-top:0;
    color:var(--primary-color);
}

.content-card p {
    margin-bottom:0;
    line-height:1.6;
}

.content-include-block {
    margin-top:18px;
    padding:14px;
    border:1px dashed var(--border-color);
    border-radius:8px;
    background:#f8fbfd;
}

.content-include-block h2 {
    margin:0 0 8px;
    font-size:18px;
    color:var(--primary-color);
}

.about-image-link {
    display:block;
    width:100%;
    text-decoration:none;
}

.about-image {
    display:block;
    width:100%;
    height:auto;
    border-radius:8px;
    box-shadow:0 4px 14px rgba(0,0,0,0.14);
    transition:transform .2s ease, box-shadow .2s ease;
}

.about-image-link:hover .about-image,
.about-image-link:focus-visible .about-image {
    transform:scale(1.01);
    box-shadow:0 6px 18px rgba(0,0,0,0.18);
}

.content-notice {
    margin:10px 0 16px;
    padding:10px 12px;
    border-radius:8px;
    font-size:14px;
}

.content-notice-error {
    background:#fdeaea;
    border:1px solid #efc9c9;
    color:#7e1d1d;
}

.content-notice-success {
    background:#e9f6ef;
    border:1px solid #bfdcc9;
    color:#1e5d3a;
}

.login-form {
    margin-top:14px;
    display:grid;
    gap:10px;
    max-width:420px;
}

.login-form label {
    font-size:14px;
    font-weight:600;
}

.login-form input {
    width:100%;
    padding:8px 10px;
    border:1px solid var(--border-color);
    border-radius:6px;
    font-size:14px;
}

/*
|--------------------------------------------------------------------------
| Viewer Layout
|--------------------------------------------------------------------------
*/
.viewer-container {
    flex:1;
    display:flex;
    min-height:0;
    overflow:hidden;
}
.map-container {
    flex:1;
    position:relative;
    overflow:hidden;
    transition:
        width .3s ease,
        flex .3s ease;
}
#map {
    width:100%;
    height:100%;
}
/*
|--------------------------------------------------------------------------
| Dashboard
|--------------------------------------------------------------------------
*/
.dashboard {
    width:var(--dashboard-width);
    background:var(--secondary-color);
    border-left:
        1px solid var(--border-color);
    overflow-y:auto;
    transition:
        width .3s ease,
        opacity .3s ease;
}
.viewer-container.dashboard-hidden .dashboard {
    width:0;
    opacity:0;
    overflow:hidden;
    border:none;
}
.dashboard-header {
    height:55px;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:8px;
    padding:0 15px;
    background:white;
    border-bottom:
        1px solid var(--border-color);
    font-weight:600;
}
.dashboard-header-toggle {
    display:none;
    border:none;
    background:transparent;
    color:var(--primary-color);
    font-size:20px;
    font-weight:700;
    line-height:1;
    cursor:pointer;
    padding:2px 6px;
}
.dashboard-box {
    background:#fff7ef;
    margin:15px;
    padding:15px;
    border-radius:8px;
    box-shadow:
        var(--box-shadow);
}
.box-title {
    font-weight:600;
    margin-bottom:12px;
}
.box-content {
    font-size:14px;
    color:#555;
}
/*
|--------------------------------------------------------------------------
| Dashboard Controls
|--------------------------------------------------------------------------
*/
.dashboard-input {
    width:100%;
    padding:8px 10px;
    border:
        1px solid var(--border-color);
    border-radius:5px;
    font-size:14px;
}
.dashboard-input:focus {
    outline:none;
    border-color:
        var(--primary-color);
}
.dashboard-select {
    width:100%;
    padding:8px 10px;
    border:
        1px solid var(--border-color);
    border-radius:5px;
    background:white;
    font-size:14px;
}
.dashboard-select:focus {
    outline:none;
    border-color:
        var(--primary-color);
}
.dashboard-box label {
    display:block;
    margin-bottom:5px;
    font-size:13px;
    color:#555;
}

/* Reset Button */
.dashboard-button {
    display:inline-block;
    padding:8px 12px;
    background:var(--primary-color);
    color:white;
    border:none;
    border-radius:6px;
    font-size:14px;
    cursor:pointer;
    box-shadow:0 2px 6px rgba(0,0,0,0.12);
}
.dashboard-button:hover {
    opacity:0.95;
}
.dashboard-button:active {
    transform:translateY(1px);
}

/* Project controls */
.dashboard-box .dashboard-select + div {
    margin-top:8px;
}
/*
|--------------------------------------------------------------------------
| Dashboard Toggle
|--------------------------------------------------------------------------
*/
.dashboard-toggle {
    position:absolute;
    top:15px;
    right:15px;
    z-index:2000;
    width:38px;
    height:38px;
    border:none;
    border-radius:50%;
    background:
        var(--primary-color);
    color:white;
    font-size:18px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:
        0 2px 6px rgba(0,0,0,0.25);
}
.dashboard-toggle:hover {
    opacity:.85;
}
/*
|--------------------------------------------------------------------------
| Marker Styles
|--------------------------------------------------------------------------
*/
.map-marker-icon {
    width:27px;
    height:33px;
    display:inline-block;
    font-size:0;
    line-height:0;
    transform:translateY(-9px);
}

.map-marker-icon svg {
    display:block;
    width:100%;
    height:100%;
}

.map-marker-icon.marker-exact {
    filter: drop-shadow(0 4px 12px rgba(31, 78, 121, 0.35));
}

.map-marker-icon.marker-city {
    filter: drop-shadow(0 4px 12px rgba(31, 78, 121, 0.35));
}

.map-marker-icon.marker-unknown {
    filter: drop-shadow(0 4px 12px rgba(85, 85, 85, 0.35));
}

.map-marker-icon.marker-exact svg path,
.map-marker-icon.marker-city svg path,
.map-marker-icon.marker-unknown svg path {
    stroke: #ffffff;
    stroke-width: 2;
}
/*
|--------------------------------------------------------------------------
| Popup
|--------------------------------------------------------------------------
*/
.leaflet-popup-content {
    font-size:14px;
}
.leaflet-popup-content strong {
    color:var(--primary-color);
}

/* Popup tweaks and profile page styling */
.map-popup {
    z-index: 6000;
}
.map-popup .leaflet-popup-content-wrapper {
    box-shadow: 0 8px 30px rgba(15,35,70,0.08);
}

.member-profile {
    padding:24px;
    max-width:1080px;
    margin:0 auto;
}

.page-card {
    background:white;
    border-radius:12px;
    box-shadow:0 12px 30px rgba(15,35,70,0.06);
    padding:20px;
    border:1px solid rgba(31,78,121,0.06);
}

.profile-header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin-bottom:18px;
}

.profile-summary { display:grid; grid-template-columns:1.2fr 0.8fr; gap:16px; margin-bottom:20px; }
.profile-card { background:#f8fbff; padding:14px; border-radius:10px; border:1px solid rgba(31,78,121,0.06); }
.profile-card h2 { margin-top:0; color:var(--primary-color); }
.tag-list { list-style:none; padding:0; display:flex; gap:8px; flex-wrap:wrap; }
.tag-list li { background:#eef7ff; padding:6px 10px; border-radius:999px; color:var(--primary-color); }
.profile-links { list-style:none; padding:0; margin:0; }
.profile-links li { margin-bottom:8px; }
.project-item { border-radius:10px; padding:12px; border:1px solid rgba(31,78,121,0.06); background:white; margin-bottom:12px; }

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/
@media(max-width:700px){
    .header {
        align-items:flex-start;
        position:sticky;
        top:0;
        overflow:visible;
    }

    .menu-toggle {
        display:inline-block;
        margin-left:auto;
    }

    .main-menu {
        display:flex;
        width:100%;
        flex-direction:column;
        align-items:flex-start;
        gap:8px;
        margin:0;
    }

    .main-menu a {
        display:block;
        width:100%;
        padding:6px 2px;
    }

    .menu-panel {
        display:none;
        width:100%;
        margin:8px 0 0;
        padding:10px 12px;
        flex-direction:column;
        align-items:flex-start;
        background:#fff;
        border:1px solid var(--border-color);
        border-radius:10px;
        box-shadow:0 10px 28px rgba(15,35,70,0.15);
        z-index:3600;
    }

    .menu-panel.is-open {
        display:flex;
    }

    .language-menu {
        width:100%;
        margin-left:0;
        padding-top:8px;
        border-top:1px solid var(--border-color);
    }

    .viewer-container {
        flex-direction:column;
    }
    .dashboard {
        width:100%;
        height:45%;
    }
    .dashboard-header-toggle {
        display:inline-flex;
        align-items:center;
        justify-content:center;
        margin-left:2px;
    }
    .viewer-container.dashboard-hidden .dashboard {
        height:0;
        width:100%;
    }
}


.btn-back{

    display:inline-flex;
    align-items:center;
    gap:.5rem;

    color:#2c6bed;

    padding:.75rem 1.2rem;

    border-radius:999px;

    background:#eef5ff;

    text-decoration:none;

    font-weight:600;

    transition:.2s;

}

.btn-back:hover{

    background:#dfeeff;

}







.profile-table{
    width:100%;
    border-collapse:collapse;
}

.profile-table tr{
    border-bottom:1px solid #eceff3;
}

.profile-table tr:last-child{
    border-bottom:none;
}

.profile-table th{
    width:180px;
    padding:14px 0;
    text-align:left;
    font-weight:600;
    color:#666;
}

.profile-table td{
    padding:14px 0;
    color:#222;
}

.profile-table a{
    color:#3366cc;
    text-decoration:none;
}

.profile-table a:hover{
    text-decoration:underline;
}



/* ==========================================================================
   Member Profile View
   (isolated styles - no conflicts with application)
   ========================================================================== */

.member-profile-view{

    max-width:1000px;
    margin:30px auto;
    padding:20px;

}

/* Profile cards */

.member-profile-view .mp-card{

    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:10px;
    padding:20px;
    margin-bottom:20px;
    box-shadow:0 3px 10px rgba(0,0,0,.05);

}

/* Two-column layout */

.member-profile-view .mp-grid{

    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
    gap:20px;

}

/* Verification badge */

.member-profile-view .mp-badge{

    display:inline-block;
    padding:6px 12px;
    border-radius:20px;
    background:#e8f8ee;
    color:#0f7a35;
    font-size:.9rem;
    font-weight:600;

}

/* Definition lists */

.member-profile-view dl{

    margin:0;

}

.member-profile-view dt{

    margin-top:12px;
    font-weight:600;

}

.member-profile-view dd{

    margin:4px 0 0;
    color:#666;

}

/* External profile links */

.member-profile-view .mp-links{

    margin:0;
    padding:0;
    list-style:none;

}

.member-profile-view .mp-links li{

    margin-bottom:10px;

}

.member-profile-view .mp-links a{

    color:#2d6cdf;
    text-decoration:none;

}

.member-profile-view .mp-links a:hover{

    text-decoration:underline;

}

/* Research tags */

.member-profile-view .mp-tags{

    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin:15px 0 0;
    padding:0;
    list-style:none;

}

.member-profile-view .mp-tags li{

    padding:8px 14px;
    border-radius:20px;
    background:#e8f0ff;
    color:#2d6cdf;
    font-size:.95rem;

}

/* Projects */

.member-profile-view .mp-project{

    margin-top:15px;
    padding:15px;
    border-left:5px solid #2d6cdf;
    border-radius:8px;
    background:#fafafa;

}

.member-profile-view .mp-project h3{

    margin:0 0 10px;

}

.member-profile-view .mp-project p{

    margin:10px 0;

}

.member-profile-view .mp-project a{

    display:inline-block;
    margin-top:10px;
    color:#2d6cdf;
    font-weight:600;
    text-decoration:none;

}

.member-profile-view .mp-project a:hover{

    text-decoration:underline;

}

/* Mobile */

@media (max-width:700px){

    .member-profile-view{

        padding:15px;

    }

}



/* Footer */
footer{
    text-align:center;
	font-size:.7rem;
    background:#92b3d3;
    padding:5px 0;
    margin-top:10px;
}

/*
|--------------------------------------------------------------------------
| Global Popup Overlay
|--------------------------------------------------------------------------
*/
.opal-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.58);
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: opalPopupFadeIn 0.18s ease;
}
.opal-popup-overlay[hidden] {
    display: none;
}
@keyframes opalPopupFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.opal-popup-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.36);
    /* Default size */
    width: 860px;
    height: 82vh;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    min-width: 260px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    /* Enable user resize via browser handle (bottom-right corner) */
    resize: both;
    animation: opalPopupSlideIn 0.2s ease;
}
@keyframes opalPopupSlideIn {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.opal-popup-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 8px 14px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 10px 10px 0 0;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
    min-height: 40px;
    gap: 8px;
}
.opal-popup-titlebar-text {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.opal-popup-close {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff;
    flex-shrink: 0;
    transition: background 0.15s;
}
.opal-popup-close:hover {
    background: rgba(220,30,30,0.75);
    border-color: rgba(255,255,255,0.6);
}
.opal-popup-iframe {
    flex: 1;
    border: none;
    width: 100%;
    display: block;
    min-height: 0;
}
/* Resize-hint indicator in bottom-right corner */
.opal-popup-box::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: repeating-linear-gradient(
        -45deg,
        #bbb 0px, #bbb 2px,
        transparent 2px, transparent 4px
    );
    pointer-events: none;
    border-radius: 0 0 4px 0;
    opacity: 0.6;
}
@media (max-width: 600px) {
    .opal-popup-box {
        width: calc(100vw - 16px);
        height: 92vh;
        max-width: 100%;
        border-radius: 8px;
        resize: vertical;
    }
    .opal-popup-overlay {
        padding: 8px;
    }
}