/*
    Layout

    description: Contains styling for the elements of the program. - Updated to match Belmont repository style
    author: Ben Jordan, Kritan Duwal
 */

/* ── Global ── */
body {
    font-family: var(--font), sans-serif;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

/* Ensure all form elements inherit the page font instead of browser serif defaults */
input, button, select, textarea {
    font-family: inherit;
}

/* ── App Bar ── */
#appbar {
    background: linear-gradient(135deg, #001540 0%, #00205b 50%, #1a4a9e 100%);
    color: var(--text-color-white);
    padding: 14px 32px;
    font-size: var(--font-size);
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 3;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.appbar-logos {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.appbar-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
}

.appbar-logo--invert {
    filter: brightness(0) invert(1);
}

.app-title {
    font-weight: 500;
}

/* ── Tab Navigation ── */
#tab-nav {
    display: flex;
    background-color: var(--maincolor);
    border-bottom: 2px solid #e0e0e0;
    padding: 0 24px;
    flex-shrink: 0;
    z-index: 2;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: var(--belmont-blue);
}

.tab-btn.active {
    color: var(--belmont-blue);
    border-bottom-color: var(--belmont-blue);
}

/* ── Content Area ── */
#content-area {
    flex: 1;
    min-height: 0;
    margin: 10px 5% 16px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    position: relative;
}

/* ── Tab Panels ── */
.tab-panel {
    display: none;
    height: 100%;
}

.tab-panel.active {
    display: block;
}

/* ── Main View Panel ── */
#main-panel {
    height: 100%;
}

/* ── Panoramic View ── */
#view {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 4px;
    background-color: var(--text-color);
}

/* ── Church UI Overlays ── */
.ui {
    display: flex;
    box-shadow: var(--card-shadow);
    border-radius: 4px;
    position: absolute;
    top: 16px;
    right: 16px;
    background-repeat: no-repeat;
    z-index: 2;
    overflow: auto;
    cursor: default;
    pointer-events: auto;
}

/* ── Play Button ── */
#play {
    position: fixed;
    z-index: 4;
    background-color: var(--belmont-blue);
    color: var(--text-color-white);
    font-size: 72px;
    width: 80px;
    height: 80px;
    border: none;
    outline: none;
    border-radius: 50%;
    box-shadow: var(--card-shadow);
    bottom: 20px;
    right: 24px;
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.25s ease;
}

#play:hover {
    background-color: var(--maincolor2);
}

#play.playing {
    background-color: var(--maincolor2);
}

.material-icons:hover {
    color: var(--maincolor) !important;
}

/* ── Error Message ── */
#error {
    position: absolute;
    width: 300px;
    height: 50px;
    top: 48%;
    left: 50%;
    margin-left: -150px;
    margin-top: -25px;
    display: none;
    text-align: center;
    color: var(--maincolor2);
    font-size: 18px;
    font-family: var(--font);
    font-weight: lighter;
}

/* ── About / Instructions Panels ── */
#about-panel, #instructions-panel {
    overflow-y: auto;
    background-color: #fff;
    padding: 36px 48px;
    box-sizing: border-box;
}

.info-section {
    max-width: 820px;
    margin: 0 auto 40px;
}

.info-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--belmont-blue);
    border-bottom: 2px solid var(--buttoncolor1);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.info-section p, .info-section li {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    text-align: justify;
}

.info-section ol, .info-section ul {
    padding-left: 24px;
}

.info-section li {
    margin-bottom: 10px;
}

.church-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.church-card {
    background: #f8f9fc;
    border: 1px solid #e0e4ef;
    border-radius: 8px;
    padding: 20px;
}

.church-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--belmont-blue);
    margin: 0 0 8px;
}

.church-card p {
    font-size: 13px;
    color: #555;
    margin: 0;
    line-height: 1.5;
    text-align: justify;
}

/* ── Church Info Button (in view, top-left, below Pannellum controls) ── */
#church-info-btn {
    position: absolute;
    top: 5px;
    left: 35px;
    z-index: 2;
    background-color: rgba(0, 32, 91, 0.85);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 22px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: var(--card-shadow);
    transition: background-color 0.2s;
    backdrop-filter: blur(4px);
}

#church-info-btn:hover {
    background-color: rgba(0, 32, 91, 1);
}

#church-info-btn .material-icons {
    font-size: 22px;
    color: #fff;
}

/* ── Church Info Modal ── */
#church-info-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#church-info-modal.open {
    display: flex;
}

#church-info-inner {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: min(720px, 95%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#church-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e0e0e0;
    gap: 16px;
    background: linear-gradient(135deg, #001540 0%, #00205b 100%);
    color: #fff;
}

#church-info-header-text h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

#church-info-header-text p {
    margin: 2px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}

#church-info-header .modal-close-btn {
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

#church-info-header .modal-close-btn:hover {
    color: #fff;
}

#church-info-body {
    overflow-y: auto;
    flex: 1;
    padding: 24px;
}

.church-info-history {
    margin-bottom: 24px;
}

.church-info-history p {
    font-size: 14px;
    line-height: 1.75;
    color: #333;
    margin: 0 0 12px;
    text-align: justify;
}

.church-info-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 500px) {
    .church-info-data { grid-template-columns: 1fr; }
}

.church-info-table-section h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--belmont-blue);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e4ef;
}

.church-info-table {
    width: 100%;
    border-collapse: collapse;
}

.church-info-table td {
    padding: 5px 0;
    font-size: 13px;
    color: #333;
    vertical-align: top;
    border-bottom: 1px solid #f0f0f0;
}

.church-info-table td:first-child {
    color: #666;
    padding-right: 12px;
}

/* ── About — Equipment Grid ── */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.equipment-card {
    background: #f8f9fc;
    border: 1px solid #e0e4ef;
    border-radius: 8px;
    padding: 20px;
}

.equipment-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--belmont-blue);
    margin: 0 0 12px;
}

.equipment-card ul {
    margin: 0;
    padding-left: 18px;
}

.equipment-card li {
    font-size: 13px;
    color: #444;
    line-height: 1.6;
    margin-bottom: 6px;
    text-align: justify;
}

/* ── About — Church Card meta line ── */
.church-meta {
    font-size: 12px;
    color: var(--belmont-blue);
    font-weight: 500;
    margin: 0 0 8px !important;
}

/* ── Source File Modal ── */
#source-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

#source-modal.open {
    display: flex;
}

#source-modal-inner {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    min-width: 320px;
    max-width: 480px;
    width: 90%;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    overflow: hidden;
}

#source-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

#source-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--belmont-blue);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--maincolor2);
}

#source-file-list {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}

.source-file-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}

.source-file-item:hover {
    background-color: #f0f4ff;
    color: var(--belmont-blue);
}

#source-modal-footer {
    border-top: 1px solid #e0e0e0;
    padding: 12px 20px;
}

.modal-browse-btn {
    background: none;
    border: 1px solid var(--belmont-blue);
    color: var(--belmont-blue);
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s;
}

.modal-browse-btn:hover {
    background-color: var(--belmont-blue);
    color: #fff;
}

/* ── Church diagram dimensions ── */
#BridgeCommunityChurchui {
    width: 287px;
    height: 214px;
    background-image: url("../Images/Bridge Community Church/Bridge Community Church Diagram.png");
    background-size: 287px 214px;
}

#ChristChurchCathedralui {
    width: 282px;
    height: 275px;
    background-image: url("../Images/Christ Church Cathedral/Christ Church Cathedral Diagram.png");
    background-size: 282px 275px;
}

#DowntownPresbyterianChurchui {
    width: 255px;
    height: 270px;
    background-image: url("../Images/Downtown Presbyterian Church/Downtown Presbyterian Church Diagram.png");
    background-size: 255px 270px;
}

#FirstBaptistChurchCapitolHillui {
    width: 371px;
    height: 173px;
    background-image: url("../Images/First Baptist Church Capitol Hill/First Baptist Church Diagram.png");
    background-size: 371px 173px;
}

#HolyTrinityEpiscopalChurchui {
    width: 166px;
    height: 395px;
    background-image: url("../Images/Holy Trinity Episcopal Church/Holy Trinity Episcopal Church Diagram.png");
    background-size: 166px 395px;
}

#UnitedMethodistChurchui {
    width: 206px;
    height: 302px;
    background-image: url("../Images/Church Street United Methodist Church, Knoxville/United Methodist Church Diagram.png");
    background-size: 206px 302px;
}
