/* ==========================================
   TAWTHEEQ - Arabic Only (No Translate)
   ========================================== */

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

:root {
    --teal: #0f7c86;
    --teal-light: #5ec4cd;
    --teal-grad: linear-gradient(180deg, #5ec4cd 0%, #0f7c86 100%);
    --white: #fff;
    --border: #dee2e6;
    --black: #000;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Tajawal', Arial, sans-serif;
    background: var(--white);
    color: var(--black);
    line-height: 1.6;
    font-weight: 600;
    padding-bottom: 55px;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

/* ==========================================
   PAGE LAYOUT
   ========================================== */
.page {
    width: 100%;
    min-height: calc(100vh - 55px);
}

/* ==========================================
   HEADER - LOGO ONLY
   ========================================== */
.header {
    text-align: center;
    padding: 30px 20px 25px;
    background: var(--white);
}

.logo-box {
    display: inline-block;
}

.logo {
    width: 60px;
    height: auto;
    display: block;
    margin: 0 auto 8px;
}

.logo-text {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--teal);
    letter-spacing: 3px;
}

/* ==========================================
   CONTENT
   ========================================== */
.content {
    width: 100%;
    padding: 0 20px;
}

/* ==========================================
   PARTY TABLE
   ========================================== */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 12px;
}

.table-party {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.table-party td {
    padding: 15px 18px;
    border: 1px solid var(--border);
    text-align: right;
    font-size: 1rem;
    color: var(--black);
    font-weight: 600;
    background: var(--white);
}

.td-id {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    text-align: center !important;
    width: 10%;
    font-size: 1rem;
}

.td-label {
    font-weight: 600;
    width: 12%;
}

.td-name {
    font-weight: 700;
}

.td-name u {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.td-type {
    font-weight: 700;
    width: 10%;
}

/* ==========================================
   DETAILS TABLE
   ========================================== */
.table-details {
    width: 100%;
    border-collapse: collapse;
}

.table-details thead th {
    background: var(--teal-grad);
    color: var(--white);
    padding: 14px 12px;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    border: none;
}

.table-details thead th:first-child {
    border-radius: 0 6px 0 0;
}

.table-details thead th:last-child {
    border-radius: 6px 0 0 0;
}

.table-details tbody td {
    padding: 14px 12px;
    text-align: center;
    border: 1px solid var(--border);
    font-size: 1rem;
    color: var(--black);
    font-weight: 600;
    background: var(--white);
}

/* ==========================================
   EDITOR SECTION
   ========================================== */
.editor-box {
    width: 100%;
    margin: 18px 0;
}

.editor-title {
    background: var(--teal-grad);
    color: var(--white);
    padding: 12px 20px;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
}

.editor-content {
    border: 1px solid var(--border);
    border-top: none;
    padding: 20px 22px;
    background: var(--white);
}

.editor-content p {
    line-height: 1.9;
    text-align: right;
    font-size: 1rem;
    color: var(--black);
    font-weight: 600;
}

/* ==========================================
   NOTE
   ========================================== */
.note {
    text-align: center;
    color: var(--teal);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 20px 15px;
}

/* ==========================================
   BUTTON
   ========================================== */
.btn-box {
    text-align: center;
    padding: 5px 0 35px;
}

.view-btn {
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--border);
    padding: 12px 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: 0.3s;
}

.view-btn:hover {
    border-color: var(--teal);
    color: var(--teal);
}

/* ==========================================
   FOOTER - FIXED
   ========================================== */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--teal);
    color: var(--white);
    text-align: center;
    padding: 16px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 1000;
}

/* ==========================================
   PDF MODAL
   ========================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-box {
    width: 96%;
    max-width: 1200px;
    height: 94vh;
    background: #323639;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    animation: popIn 0.25s ease;
}

@keyframes popIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #3c4043;
    border-bottom: 1px solid #5f6368;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-left,
.modal-mid,
.modal-right {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e8eaed;
    font-weight: 600;
}

.m-icon {
    font-size: 1.2rem;
    cursor: pointer;
}

.pg-box {
    background: #202124;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    gap: 4px;
    font-weight: 600;
}

.zm-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

#zmVal {
    min-width: 42px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.m-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #9aa0a6;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.m-btn:hover {
    background: #5f6368;
    color: #fff;
}

.m-close:hover {
    background: #d93025 !important;
}

.modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: #525659;
}

.pdf-side {
    width: 130px;
    background: #3c4043;
    border-right: 1px solid #5f6368;
    padding: 12px;
    overflow-y: auto;
}

.thumb {
    background: #202124;
    padding: 6px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
}

.thumb.active {
    border-color: var(--teal);
}

.thumb-img {
    width: 100%;
    height: 90px;
    background: #fff;
    border-radius: 2px;
}

.thumb span {
    display: block;
    text-align: center;
    color: #9aa0a6;
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 600;
}

.pdf-main {
    flex: 1;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
}

#pdfFrame {
    width: 100%;
    height: 100%;
    max-width: 850px;
    border: none;
    background: #fff;
    box-shadow: 0 4px 25px rgba(0,0,0,0.4);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    body {
        padding-bottom: 50px;
    }
    
    .header {
        padding: 22px 15px 18px;
    }
    
    .logo {
        width: 50px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .content {
        padding: 0 12px;
    }
    
    .table-party td,
    .table-details th,
    .table-details td {
        padding: 10px 10px;
        font-size: 0.88rem;
    }
    
    .editor-title {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
    
    .editor-content {
        padding: 15px;
    }
    
    .editor-content p {
        font-size: 0.92rem;
        line-height: 1.8;
    }
    
    .view-btn {
        padding: 10px 40px;
        font-size: 0.95rem;
    }
    
    .footer {
        padding: 14px 15px;
        font-size: 0.9rem;
    }
    
    .modal-mid {
        display: none;
    }
    
    .pdf-side {
        display: none;
    }
    
    .modal-box {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

@media (max-width: 576px) {
    body {
        padding-bottom: 48px;
    }
    
    .header {
        padding: 18px 10px 14px;
    }
    
    .logo {
        width: 45px;
    }
    
    .logo-text {
        font-size: 1rem;
        letter-spacing: 2px;
    }
    
    .content {
        padding: 0 8px;
    }
    
    .table-party,
    .table-details {
        min-width: 600px;
    }
    
    .table-party td,
    .table-details th,
    .table-details td {
        padding: 8px 8px;
        font-size: 0.82rem;
        white-space: nowrap;
    }
    
    .editor-title {
        padding: 9px 12px;
        font-size: 0.9rem;
    }
    
    .editor-content {
        padding: 12px;
    }
    
    .editor-content p {
        font-size: 0.88rem;
        line-height: 1.75;
    }
    
    .note {
        font-size: 0.82rem;
        padding: 14px 10px;
    }
    
    .btn-box {
        padding: 5px 0 22px;
    }
    
    .view-btn {
        padding: 10px 32px;
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 12px 10px;
        font-size: 0.85rem;
    }
    
    .modal-top {
        padding: 8px 10px;
    }
    
    .m-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .logo {
        width: 40px;
    }
    
    .logo-text {
        font-size: 0.92rem;
    }
    
    .table-party,
    .table-details {
        min-width: 550px;
    }
    
    .view-btn {
        width: 80%;
        padding: 10px 20px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--teal);
    border-radius: 3px;
}

::-webkit-scrollbar-track {
    background: #eee;
}