/* =========================
   Root Variables
========================= */
:root {
    --primary: #2c3e50;
    --accent:  #3498db;
    --bg:      #ecf0f1;
}

/* =========================
   Global Styles
========================= */
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* =========================
   Sidebar
========================= */
.sidebar {
    width: 380px;
    background: #ffffff;
    padding: 25px;
    overflow-y: auto;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.sidebar h2 {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    margin-top: 0;
}

/* =========================
   Input Cards
========================= */
.input-card {
    background: #fdfdfd;
    border: 1px solid #eeeeee;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.input-card label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #555555;
}

.text-input,
.select-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #dddddd;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 14px;
}

/* =========================
   Style Tools
========================= */
.style-tools {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.style-tools select,
.style-tools input[type="number"],
.style-tools input[type="range"] {
    padding: 4px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 12px;
}

.btn-tool {
    padding: 4px 8px;
    border: 1px solid #dddddd;
    background: #ffffff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.btn-tool.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* =========================
   Preview Pane
========================= */
.preview-pane {
    flex-grow: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #bdc3c7;
    overflow: hidden;
    position: relative;
}

.scrollable-preview {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#page-render {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    padding: 20mm 25mm;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    margin-bottom: 40px;
}

/* =========================
   Visibility Helpers
========================= */
.logo-area,
.uni-title,
.dynamic-line,
.label-on,
.sub-info,
.table-member,
.date-footer {
    display: none;
    width: 100%;
    text-align: center;
}

.visible {
    display: block !important;
    visibility: visible !important;
}

/* =========================
   Logo Area
========================= */
.logo-area {
    height: 140px;
    margin-bottom: 15px;
    align-items: center;
    justify-content: center;
}

.logo-area.visible {
    display: flex !important;
}

.logo-area img {
    max-width: 100%;
    height: auto;
}

.logo-area #viewLogo {
    width: 110px;
}

#spacer-sem {
    margin-top: 15px;
    display: none;
}

/* =========================
   Member Section
========================= */
.member-entry {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.btn-remove {
    background: #e74c3c;
    color: #ffffff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
}

/* =========================
   Text Content
========================= */
.uni-title {
    font-weight: bold;
    margin-bottom: 5px;
}
#out-dept { 
    font-weight: bold; 
    margin-bottom: 5px; 
}

.dynamic-line {
    margin: 3px 0;
    line-height: 1.3;
    word-wrap: break-word;
}

.label-on {
    text-decoration: underline;
    font-weight: bold;
    margin: 20px 0 10px;
    font-size: 17px;
}

/* =========================
   Sub Information
========================= */
.sub-info {
    text-align: left;
    margin: 25px 0;
    font-size: 16px;
}

.sub-info div {
    margin: 8px 0;
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.sub-info span {
    display: inline-block;
}

/* =========================
   Member Table
========================= */
.table-member {
    border-collapse: collapse;
    margin-top: 15px;
    table-layout: fixed;
    display: none;
}

.table-member.visible {
    display: table !important;
    visibility: visible !important;
}

.table-member th,
.table-member td {
    border: 1.5px solid #000000;
    padding: 10px;
    text-align: left;
    font-weight: bold;
}

.table-member th:first-child {
    width: 65%;
}

/* =========================
   Footer
========================= */
.date-footer {
    text-align: left;
    margin-top: 25px;
    font-weight: bold;
}

.display-footer {
    padding: 10px 0;
    font-size: 11px;
    color: var(--primary);
    text-align: center;
    width: 100%;
    background: rgba(189, 195, 199, 0.9);
}

/* =========================
   Buttons
========================= */
.btn-add {
    background: var(--accent);
    color: #ffffff;
    border: none;
    padding: 8px;
    border-radius: 5px;
    width: 100%;
    cursor: pointer;
    margin-top: 5px;
}

.btn-dl {
    background: #27ae60;
    color: #ffffff;
    border: none;
    padding: 15px;
    width: 100%;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

/* =========================
   Mobile Responsive
========================= */
@media (max-width: 768px) {

    body {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px;
        box-shadow: none;
        box-sizing: border-box;
    }

    .preview-pane {
        width: 100%;
        height: auto;
        padding: 10px 0;
        overflow: visible;
    }

    .scrollable-preview {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    #page-render {
        width: 100%;
        height: auto;
        min-height: auto;
        padding: 15mm 10mm;
        transform: scale(1);
        transform-origin: top center;
        margin-bottom: 20px;
    }

    .style-tools {
        justify-content: space-between;
    }

    .btn-dl {
        position: sticky;
        bottom: 10px;
        z-index: 1000;
        width: 90%;
        margin-left: 5%;
    }
}
