@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@400;700&family=Changa:wght@400;700&family=Lateef&family=Noto+Naskh+Arabic:wght@400;700&family=Reem+Kufi:wght@400;700&family=Scheherazade+New:wght@400;700&display=swap');
/* Office Assistant Styles */
.office-container {
    padding: 20px;
    direction: rtl;
    animation: fadeIn 0.5s ease;
}

.office-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.office-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

.office-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.office-card i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.office-card.word i { color: #2b579a; }
.office-card.excel i { color: #217346; }
.office-card.pdf i { color: #f40f02; }
.office-card.ocr i { color: #ff9f1c; }

.office-card h3 {
    margin: 10px 0;
    color: #333;
    font-size: 1.2rem;
}

.office-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Editor UI */
.office-editor-container {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 80vh;
    overflow: hidden;
    border: 1px solid #ddd;
}

.office-editor-toolbar {
    background: #f8f9fa;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.office-editor-body {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f0f2f5;
    display: flex;
    justify-content: center;
}

.office-paper {
    background: #fff;
    width: 210mm; /* A4 width */
    min-height: 297mm;
    padding: 20mm;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    outline: none;
    font-size: 14pt;
    line-height: 1.6;
    color: #000;
    box-sizing: border-box;
    position: relative; /* Position relative for precise absolute overlays like borders */
}

.office-excel-grid {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.office-excel-grid td, .office-excel-grid th {
    border: 1px solid #ccc;
    padding: 8px;
    min-width: 100px;
    height: 25px;
    outline: none;
}

.office-excel-grid th {
    background: #f1f1f1;
    font-weight: bold;
    text-align: center;
}

/* OCR Upload Area */
.office-upload-area {
    border: 3px dashed #ccc;
    border-radius: 15px;
    padding: 50px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    background: #fafafa;
}

.office-upload-area:hover {
    border-color: var(--primary);
    background: #f0f7ff;
}

.office-upload-area i {
    font-size: 4rem;
    color: #666;
    margin-bottom: 20px;
}

.office-upload-area.dragging {
    border-color: var(--primary);
    background: #eef;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* New Office Assistant UI Enhancements */
.pro-btn {
    background: #fff;
    border: 1px solid #ddd;
    color: #444;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    min-width: 32px;
}

.pro-btn:hover {
    background: #e1e4e8;
    border-color: #bbb;
}

.pro-btn.small {
    padding: 2px 6px;
    font-size: 11px;
    min-width: 24px;
}

.pro-btn.small sup {
    font-size: 8px;
    margin-left: 1px;
}

.pro-select {
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    color: #333;
}

.ribbon-tab {
    padding: 8px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
}

.ribbon-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: #f3f2f1;
}

.ribbon-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.ribbon-panel.active {
    display: flex;
}

.office-content-area {
    font-family: 'Amiri', serif;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
    column-rule: 1px solid #ddd;
    transition: width 0.3s, padding 0.3s;
    box-sizing: border-box;
}

/* Custom Resize Handle Styling */
.office-content-area::-webkit-resizer {
    background-color: #2b579a;
    border: 1px solid white;
    border-radius: 2px;
}

/* Paper Borders */
#office-paper, .office-paper {
    transition: width 0.3s, height 0.3s, transform 0.3s;
}

/* Fix for tables inside multi-column layouts */
.office-content-area table {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* Iraqi Exam Paper custom styling and page-break controls */
.office-paper:has(.iraqi-exam-paper),
.office-paper.iraqi-exam-mode {
    overflow: hidden !important;
    transition: none !important;
    padding: 12mm 15mm 12mm 15mm !important; /* Elegant standard Iraqi Exam margins for optimal spacing and zero squeezing */
}
.iraqi-exam-paper {
    width: 100%;
    box-sizing: border-box;
}
.iraqi-exam-paper * {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
}
.iraqi-exam-paper table,
.iraqi-exam-paper .exam-questions-content > div {
    break-inside: avoid;
    page-break-inside: avoid;
}

