/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', Arial, sans-serif;
    direction: rtl;
    background-color: #f5f5f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header Styles - MS Word like */
.header {
    background: #2b5797;
    color: white;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-height: 36px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
}

.logo i {
    margin-left: 6px;
    font-size: 16px;
}

.header-controls {
    display: flex;
    gap: 4px;
}

.btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
}

.btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

/* MS Word Style Ribbon */
.ribbon-tabs {
    background: #f1f1f1;
    border-bottom: 1px solid #d1d1d1;
    display: flex;
    padding: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.tab-item {
    padding: 6px 12px;
    cursor: pointer;
    color: #444;
    font-weight: 400;
    font-size: 11px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
}

.tab-item:hover {
    background: #e5e5e5;
    color: #333;
}

.tab-item.active {
    background: white;
    border-bottom-color: #0078d4;
    color: #0078d4;
    font-weight: 500;
}

.ribbon-content {
    background: white;
    border-bottom: 1px solid #d1d1d1;
    min-height: 75px;
    position: relative;
    overflow-x: auto;
}

.ribbon-panel {
    display: none;
    padding: 4px 8px;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: nowrap;
    min-width: fit-content;
}

.ribbon-panel.active {
    display: flex;
}

.ribbon-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: fit-content;
    padding: 6px 8px;
    border-right: 1px solid #e1e1e1;
    background: transparent;
    position: relative;
    flex-shrink: 0;
    gap: 4px;
}

.group-header {
    font-size: 9px;
    color: #666;
    font-weight: 400;
    margin-right: 6px;
    text-align: right;
    white-space: nowrap;
    position: static;
}

.ribbon-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    font-size: 10px;
    margin: 0.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ribbon-btn:hover {
    background: #f0f0f0;
    border-color: #d1d1d1;
}

.ribbon-btn.large {
    width: 32px;
    height: 32px;
    padding: 4px;
}

.ribbon-btn.large i {
    font-size: 16px;
    color: #333;
}

.ribbon-btn.large span {
    display: none;
}

.ribbon-btn:not(.large) {
    width: 20px;
    height: 20px;
    padding: 1px;
}

.ribbon-btn:not(.large) i {
    font-size: 11px;
    color: #495057;
}

.ribbon-btn.small {
    width: 18px;
    height: 18px;
    padding: 1px;
}

.button-row {
    display: flex;
    gap: 2px;
    margin: 0;
}

/* Custom Font Styles */
.custom-font-option {
    background-color: #e8f4fd;
    color: #0078d4;
    font-weight: 500;
}

.custom-font-option::after {
    content: ' (کسٹم)';
    font-size: 10px;
    opacity: 0.7;
}

#fontManagerModal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

#fontManagerModal table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#fontManagerModal th,
#fontManagerModal td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: right;
    font-size: 13px;
}

#fontManagerModal th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

#fontManagerModal .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    margin: 0 2px;
}

.font-upload-info {
    background: #f9f9f9;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
    font-size: 12px;
    line-height: 1.5;
}

.font-upload-info h4 {
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.font-upload-info p {
    margin: 5px 0;
    color: #666;
}

.font-test-preview {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 5px 0;
    background: #fff;
    text-align: right;
    direction: rtl;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.uploading-font {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.uploading-font::after {
    content: 'اپ لوڈ ہو رہا ہے...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
}
    flex-wrap: nowrap;
    align-items: center;
}

.ribbon-select {
    margin: 0.5px;
    padding: 1px 3px;
    border: 1px solid #ced4da;
    border-radius: 2px;
    font-size: 9px;
    background: white;
    min-width: 60px;
    max-width: 70px;
    font-family: inherit;
    height: 18px;
}

.color-input {
    width: 28px;
    height: 20px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    cursor: pointer;
    margin: 1px;
    padding: 0;
    background: none;
}

.zoom-display {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    margin-top: 8px;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 4px;
}

/* MS Word Style Tooltips */
[title] {
    position: relative;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease-in;
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.3;
    max-width: 300px;
    white-space: normal;
}

[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease-in;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Disable default browser tooltips */
[title] {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Modal Base Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    border-radius: 8px;
    width: 80%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    background: #0078d4;
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-family: 'Noto Nastaliq Urdu', Arial, sans-serif;
    direction: rtl;
    text-align: right;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.close {
    color: #fff;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.close:hover {
    opacity: 1;
}

/* Symbols Categories */

.symbols-categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.symbol-category-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
    font-family: 'Noto Nastaliq Urdu', Arial, sans-serif;
    direction: rtl;
}

.symbol-category-btn:hover {
    background: #e9ecef;
}

.symbol-category-btn.active {
    background: #0078d4;
    color: white;
    border-color: #0078d4;
}

.symbols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 5px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    background: #fafafa;
}

.symbol-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    font-family: 'Traditional Arabic', 'Noto Nastaliq Urdu', Arial, sans-serif;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.symbol-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.symbol-item:active {
    transform: scale(0.95);
    background: #1976d2;
    color: white;
}

.symbol-item:active,
.symbol-item.dragging {
    cursor: grabbing;
    opacity: 0.8;
    transform: rotate(5deg) scale(1.1);
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Modal backdrop */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.modal.show {
    display: block;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Drop zone styling */
.editor.drop-zone {
    outline: 3px dashed #2196f3;
    outline-offset: -3px;
    background: rgba(33, 150, 243, 0.05);
}

.editor.drop-zone::after {
    content: 'یہاں علامت چھوڑیں';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(33, 150, 243, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: 'Noto Nastaliq Urdu', Arial, sans-serif;
    font-size: 16px;
    pointer-events: none;
    z-index: 1000;
}

/* Responsive Ribbon Styles for Horizontal Layout */
@media screen and (max-width: 1200px) {
    .ribbon-group {
        min-width: fit-content;
        padding: 4px 6px;
        gap: 3px;
    }
    
    .group-header {
        font-size: 8px;
        margin-right: 4px;
    }
    
    .ribbon-btn.large {
        width: 28px;
        height: 28px;
        padding: 3px;
    }
    
    .ribbon-btn.large i {
        font-size: 14px;
    }
    
    .ribbon-select {
        min-width: 50px;
        max-width: 60px;
        font-size: 8px;
        height: 16px;
    }
    
    .color-input {
        width: 24px;
        height: 18px;
    }
}

@media screen and (max-width: 900px) {
    .ribbon-panel {
        gap: 4px;
        padding: 3px 6px;
    }
    
    .ribbon-group {
        min-width: fit-content;
        padding: 3px 4px;
        gap: 2px;
    }
    
    .group-header {
        font-size: 7px;
        margin-right: 3px;
    }
    
    .ribbon-btn.large {
        width: 24px;
        height: 24px;
        padding: 2px;
    }
    
    .ribbon-btn.large i {
        font-size: 12px;
    }
    
    .ribbon-btn:not(.large) {
        width: 18px;
        height: 18px;
        padding: 1px;
    }
    
    .ribbon-btn:not(.large) i {
        font-size: 10px;
    }
    
    .ribbon-select {
        min-width: 40px;
        max-width: 50px;
        font-size: 7px;
        height: 14px;
        padding: 0px 2px;
    }
    
    .color-input {
        width: 20px;
        height: 16px;
    }
}

/* Horizontal scrolling for ribbon content */
.ribbon-content::-webkit-scrollbar {
    height: 8px;
}

.ribbon-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ribbon-content::-webkit-scrollbar-thumb {
    background: #0078d4;
    border-radius: 4px;
}

.ribbon-content::-webkit-scrollbar-thumb:hover {
    background: #106ebe;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 5px;
    border-left: 1px solid #e0e0e0;
    padding-left: 15px;
}

.toolbar-group:first-child {
    border-left: none;
    padding-left: 0;
}

.toolbar-btn {
    background: none;
    border: 1px solid transparent;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    color: #333;
    font-size: 14px;
}

.toolbar-btn:hover {
    background: #f0f0f0;
    border-color: #d0d0d0;
}

.toolbar-btn.active {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
}

.toolbar-select {
    border: 1px solid #d0d0d0;
    padding: 6px 10px;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-family: inherit;
    min-width: 120px;
}

.color-picker {
    width: 35px;
    height: 35px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.zoom-level {
    font-size: 12px;
    color: #666;
    margin-right: 10px;
}

/* Pages Navigation */
.pages-navigation {
    background: #f0f0f0;
    border-bottom: 1px solid #d0d0d0;
    padding: 4px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 32px;
}

.pages-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-btn {
    background: #ffffff;
    border: 1px solid #d0d0d0;
    padding: 3px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    color: #333;
    font-size: 11px;
}

.page-btn:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.page-counter {
    font-size: 12px;
    color: #666;
    margin-right: 15px;
}

.pages-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    max-width: 500px;
}

.page-tab {
    background: #e8e8e8;
    border: 1px solid #d0d0d0;
    padding: 3px 8px;
    border-radius: 3px 3px 0 0;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 60px;
    font-size: 10px;
    color: #333;
}

.page-tab.active {
    background: #2196f3;
    color: white;
    border-color: #1976d2;
}

.page-tab:hover:not(.active) {
    background: #f5f5f5;
}

.page-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: background-color 0.3s;
}

.page-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.page-tab.active .page-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Pages Container */
.pages-container {
    position: relative;
    width: 794px;
    min-height: 1123px;
    margin: 0 auto;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Landscape mode support */
.pages-container.landscape {
    width: 1123px;
    min-height: 794px;
}

.page-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 1123px;
    background: white;
    padding: 40px 50px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', Arial, sans-serif;
    display: none;
    transition: opacity 0.3s ease;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Landscape page content */
.pages-container.landscape .page-content {
    min-height: 794px;
    padding: 30px 40px;
}

.page-content.active {
    display: block;
    opacity: 1;
}

.page-content:focus {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* Editor Container */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    overflow: hidden;
    min-height: 0; /* Important for flex child */
}

/* UI Hide/Show States */
.ui-hidden .header,
.ui-hidden .ribbon-tabs,
.ui-hidden .ribbon-content {
    display: none !important;
}

.ui-hidden .pages-navigation {
    padding: 4px 8px;
}

.ui-hidden .editor-container {
    margin-top: 0;
}

/* Responsive Design for Ribbon */
@media (max-width: 1200px) {
    .ribbon-group {
        min-width: 50px;
        padding: 4px;
    }
    
    .group-header {
        font-size: 8px;
    }
    
    .ribbon-btn.large {
        width: 36px;
        height: 36px;
    }
    
    .ribbon-btn.large span {
        font-size: 7px;
    }
}

.ruler {
    height: 18px;
    background: #e8e8e8;
    border-bottom: 1px solid #d0d0d0;
    position: relative;
    overflow: hidden;
}

.editor-wrapper {
    flex: 1;
    display: flex;
    background: #f5f5f5;
    overflow-y: auto;
    overflow-x: auto;
    padding: 20px 0;
    justify-content: center;
    scroll-behavior: smooth;
    min-width: 0; /* Allow shrinking for flex */
}

.page-margin {
    width: 50px;
    background: #f0f0f0;
    border-right: 1px solid #e0e0e0;
}

.editor {
    width: 794px; /* A4 width in pixels at 96 DPI */
    min-height: 1123px; /* A4 height in pixels at 96 DPI */
    background: white;
    padding: 40px 50px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', Arial, sans-serif;
}

.editor:focus {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.editor p {
    margin-bottom: 10px;
}

.editor h1, .editor h2, .editor h3, .editor h4, .editor h5, .editor h6 {
    margin: 20px 0 10px 0;
    font-weight: bold;
}

.editor ul, .editor ol {
    margin: 10px 0 10px 30px;
    padding-right: 20px;
}

.editor table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
}

.editor table th, .editor table td {
    border: 1px solid #d0d0d0;
    padding: 8px 12px;
    text-align: right;
}

.editor table th {
    background: #f5f5f5;
    font-weight: bold;
}

.editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
}

.editor a {
    color: #2196f3;
    text-decoration: underline;
}

/* Status Bar */
.status-bar {
    background: #f0f0f0;
    border-top: 1px solid #d0d0d0;
    padding: 4px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #666;
    min-height: 24px;
}

.status-left, .status-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.status-btn {
    background: none;
    border: 1px solid transparent;
    color: #666;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.status-btn:hover {
    background: #e0e0e0;
    border-color: #ccc;
    color: #333;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    direction: rtl;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: right;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-body label {
    font-weight: bold;
    color: #555;
}

.modal-body input {
    padding: 8px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-family: inherit;
    direction: rtl;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 20px;
}

.btn-primary {
    background: #2196f3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #d0d0d0;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
}

.close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    left: 15px;
}

.close:hover {
    color: #000;
}

/* Symbol Picker */
.symbol-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    width: 500px;
    max-height: 400px;
    direction: rtl;
}

.symbol-header {
    background: #f5f5f5;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.symbol-header h4 {
    margin: 0;
    color: #333;
}

.close-symbol {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.symbol-categories {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.symbol-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: #f9f9f9;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: inherit;
    border-left: 1px solid #e0e0e0;
}

.symbol-tab:first-child {
    border-left: none;
}

.symbol-tab.active {
    background: white;
    border-bottom: 2px solid #2196f3;
}

.symbol-grid {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    max-height: 250px;
    overflow-y: auto;
}

.symbol-item {
    width: 35px;
    height: 35px;
    border: 1px solid #e0e0e0;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s;
    border-radius: 4px;
}

.symbol-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

/* Virtual Keyboard */
.virtual-keyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid #2196f3;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    z-index: 1001;
    direction: rtl;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.keyboard-header {
    background: #f5f5f5;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.keyboard-header h4 {
    margin: 0;
    color: #333;
}

.close-keyboard {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
}

.keyboard-layout {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 3px;
}

.keyboard-key {
    min-width: 45px;
    height: 45px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', Arial, sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 500;
    color: #333;
}

.keyboard-key:hover {
    background: linear-gradient(145deg, #e3f2fd, #bbdefb);
    border-color: #2196f3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.keyboard-key:active {
    background: linear-gradient(145deg, #bbdefb, #90caf9);
    transform: translateY(0) scale(0.95);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.keyboard-key.wide {
    min-width: 80px;
}

/* Special key styling */
.diacritic-key {
    background: linear-gradient(145deg, #fff3e0, #ffe0b2);
    color: #e65100;
    font-weight: bold;
}

.diacritic-key:hover {
    background: linear-gradient(145deg, #ffcc02, #ffb300);
    color: #bf360c;
}

.number-key {
    background: linear-gradient(145deg, #f3e5f5, #e1bee7);
    color: #4a148c;
    font-weight: bold;
}

.number-key:hover {
    background: linear-gradient(145deg, #ce93d8, #ba68c8);
    color: #4a148c;
}

.punctuation-key {
    background: linear-gradient(145deg, #e8f5e8, #c8e6c9);
    color: #1b5e20;
    font-weight: bold;
}

.punctuation-key:hover {
    background: linear-gradient(145deg, #a5d6a7, #81c784);
    color: #1b5e20;
}

.keyboard-controls {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.keyboard-btn {
    padding: 10px 20px;
    background: linear-gradient(145deg, #2196f3, #1976d2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
    min-width: 80px;
}

.keyboard-btn:hover {
    background: linear-gradient(145deg, #1976d2, #1565c0);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4);
}

.keyboard-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(33, 150, 243, 0.3);
}

.keyboard-btn.special {
    background: linear-gradient(145deg, #4caf50, #388e3c);
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.keyboard-btn.special:hover {
    background: linear-gradient(145deg, #388e3c, #2e7d32);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.keyboard-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    background: linear-gradient(145deg, #2196f3, #1976d2);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.5);
    z-index: 1002;
    transition: all 0.3s;
    font-size: 28px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}

.keyboard-toggle:hover {
    background: #1976d2;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
}

.keyboard-toggle.active {
    background: #4caf50;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(76, 175, 80, 0.8); }
    100% { box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4); }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Right-to-Left Direction Support */
[dir="rtl"] {
    text-align: right;
}

[dir="ltr"] {
    text-align: left;
}

/* Print Styles */
@media print {
    .header, .toolbar, .secondary-toolbar, .status-bar, .keyboard-toggle {
        display: none !important;
    }
    
    .editor-wrapper {
        padding: 0;
    }
    
    .page-margin {
        display: none;
    }
    
    .editor {
        box-shadow: none;
        margin: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ribbon-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .ribbon-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-item {
        padding: 8px 12px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    .ribbon-panel {
        padding: 8px;
        gap: 10px;
    }
    
    .ribbon-group {
        min-width: 45px;
        padding: 3px;
    }
    
    .ribbon-btn.large {
        width: 30px;
        height: 30px;
        padding: 2px;
    }
    
    .ribbon-btn.large i {
        font-size: 12px;
    }
    
    .ribbon-btn.large span {
        font-size: 6px;
    }
    
    .pages-navigation {
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
    }
    
    .pages-controls {
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .pages-tabs {
        justify-content: center;
        max-width: 100%;
    }
    
    .page-tab {
        min-width: 60px;
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .editor, .page-content {
        width: 100%;
        padding: 20px;
    }
    
    .pages-container {
        width: 100%;
    }
    
    .page-margin {
        display: none;
    }
    
    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
    
    .symbol-picker {
        width: 90%;
    }
    
    .status-bar {
        font-size: 10px;
        padding: 6px 10px;
    }
    
    .status-left, .status-right {
        gap: 10px;
    }
}

/* Text Selection */
::selection {
    background: rgba(33, 150, 243, 0.3);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

::-webkit-scrollbar-corner {
    background: #f1f1f1;
}

/* Editor specific scrollbar */
.editor-wrapper::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

.editor-wrapper::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 0;
}

.editor-wrapper::-webkit-scrollbar-thumb {
    background: #0078d4;
    border: 2px solid #f5f5f5;
    border-radius: 6px;
}

.editor-wrapper::-webkit-scrollbar-thumb:hover {
    background: #106ebe;
    border: 2px solid #f0f0f0;
}

.editor-wrapper::-webkit-scrollbar-corner {
    background: #f5f5f5;
}

/* Force horizontal scrollbar visibility in landscape mode */
.pages-container.landscape {
    overflow-x: auto;
    overflow-y: visible;
}

/* Ensure editor wrapper shows horizontal scroll when needed */
.editor-wrapper {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

/* SaaS License System Styles */
.license-badge {
    background: #28a745;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: bold;
}

.license-badge.pro {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #333;
}

.license-badge.premium {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.btn-pro {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #333;
    border: none;
    font-weight: bold;
}

.btn-pro:hover {
    background: linear-gradient(135deg, #ffb700, #ff9500);
    transform: translateY(-1px);
}

/* Pro Features Styling */
.pro-feature {
    position: relative;
}

.pro-feature::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 215, 0, 0.1);
    border: 1px dashed #ffd700;
    border-radius: 4px;
    pointer-events: none;
}

.pro-label {
    background: #ffd700;
    color: #333;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 3px;
    position: absolute;
    top: -2px;
    right: -2px;
    font-weight: bold;
    line-height: 1;
}

/* Attractive License Modal Styles */
.license-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
    max-width: 1000px;
    width: 95vw;
    max-height: 90vh;
    animation: modalSlideIn 0.4s ease-out;
}

/* Animated Background Elements */
.modal-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.1);
    font-size: 60px;
    animation: float 6s ease-in-out infinite;
}

.floating-icon.icon-1 {
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.floating-icon.icon-2 {
    bottom: 20%;
    left: 15%;
    animation-delay: 1.5s;
    font-size: 40px;
}

.floating-icon.icon-3 {
    top: 60%;
    right: 5%;
    animation-delay: 3s;
    font-size: 45px;
}

.floating-icon.icon-4 {
    top: 30%;
    left: 5%;
    animation-delay: 4.5s;
    font-size: 35px;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.1; }
    50% { transform: translateY(-20px) rotate(5deg); opacity: 0.2; }
}

/* Modal Header Redesign */
.modal-title-section {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.title-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ffd700, #ffb347);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
    animation: pulse 2s infinite;
}

.title-crown {
    font-size: 40px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.modal-title {
    font-size: 28px;
    color: #fff;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.modal-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin: 0;
    font-weight: 400;
}

/* License Plans Redesign */
.license-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
}

.plan-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e0e0e0, #f5f5f5);
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Free Plan Styling */
.free-card::before {
    background: linear-gradient(90deg, #9e9e9e, #bdbdbd);
}

.free-card:hover {
    border-color: #9e9e9e;
}

/* PRO Plan Styling - Popular */
.pro-card {
    border: 3px solid #ff6b6b;
    transform: scale(1.05);
}

.pro-card::before {
    background: linear-gradient(90deg, #ff6b6b, #ffa500);
}

.popular-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    animation: bounce 2s infinite;
}

/* Premium Plan Styling */
.premium-card::before {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.premium-card:hover {
    border-color: #9b59b6;
}

/* Plan Header */
.plan-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.plan-icon {
    width: 60px;
    height: 60px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
    color: #6c757d;
}

.pro-icon {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #fff;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.premium-icon {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #fff;
    box-shadow: 0 8px 20px rgba(155, 89, 182, 0.3);
}

.plan-header h4 {
    font-size: 24px;
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-weight: 700;
}

.plan-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.free-badge {
    background: #e9ecef;
    color: #6c757d;
}

.pro-badge {
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
}

.premium-badge {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

/* Price Section */
.price-section {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.price {
    font-size: 36px;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 5px;
}

.price-note {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

/* Features List */
.features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}

.features-list li {
    padding: 8px 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-included i {
    color: #28a745;
    font-weight: bold;
}

.feature-limited i {
    color: #ffc107;
}

.feature-excluded i {
    color: #dc3545;
    opacity: 0.6;
}

.feature-excluded {
    opacity: 0.6;
}

/* License Buttons */
.btn-license {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.current-btn {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.pro-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

.pro-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(255, 107, 107, 0.4);
}

.premium-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    box-shadow: 0 8px 20px rgba(155, 89, 182, 0.3);
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(155, 89, 182, 0.4);
}

/* Activation Form Styles */
.activation-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
}

.form-header {
    text-align: center;
    margin-bottom: 25px;
}

.form-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4285f4, #34a853);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
    color: white;
    box-shadow: 0 8px 20px rgba(66, 133, 244, 0.3);
    animation: pulse 2s infinite;
}

.form-header h4 {
    font-size: 24px;
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.form-subtitle {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

/* Demo Keys Info */
.demo-keys-info {
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    border: 1px solid #d4edda;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
}

.demo-keys-info h5 {
    color: #155724;
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
}

.demo-key-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.demo-key-item code {
    background: #fff;
    border: 1px solid #28a745;
    color: #155724;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.demo-key-item code:hover {
    background: #28a745;
    color: white;
    transform: scale(1.02);
}

.demo-label {
    background: #17a2b8;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

/* Modern Input Styling */
.modern-input {
    position: relative;
    margin-bottom: 25px;
}

.modern-input label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-input input {
    width: 100%;
    padding: 15px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    background: #fff;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modern-input input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
    transform: translateY(-2px);
}

.input-underline {
    height: 2px;
    background: linear-gradient(90deg, #4285f4, #34a853);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.3s ease;
    margin-top: -2px;
}

.modern-input input:focus + .input-underline {
    transform: scaleX(1);
}

/* Modern Buttons */
.license-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.modern-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-activate {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    box-shadow: 0 8px 20px rgba(66, 133, 244, 0.3);
}

.btn-activate:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(66, 133, 244, 0.4);
}

.btn-purchase.secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
}

.btn-purchase.secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(108, 117, 125, 0.4);
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.modern-btn:hover .btn-shine {
    left: 100%;
}

/* Modern Contact Info */
.modern-contact {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.contact-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #495057;
}

.contact-details {
    display: grid;
    gap: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #6c757d;
    font-size: 14px;
}

.contact-item i {
    width: 16px;
    color: #4285f4;
}

/* Animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-100px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .license-plans {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 15px;
    }
    
    .pro-card {
        transform: none;
    }
    
    .license-buttons {
        grid-template-columns: 1fr;
    }
    
    .popular-badge {
        top: -5px;
        right: 10px;
        padding: 6px 15px;
        font-size: 10px;
    }
    
    .modal-title {
        font-size: 22px;
    }
    
    .activation-form {
        padding: 20px;
    }
}

/* License Modal Styles */
.license-modal {
    max-width: 1000px;
    width: 95%;
    min-width: 600px;
    min-height: 400px;
    position: relative;
}

/* Draggable Modal Styles */
.draggable-modal {
    position: fixed !important;
    margin: 0 !important;
    top: 50px;
    left: 50px;
    resize: both;
    overflow: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.2);
}

.draggable-header {
    cursor: move;
    user-select: none;
    position: relative;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    transition: all 0.3s ease;
}

.draggable-header:hover {
    background: linear-gradient(135deg, #7c8cef 0%, #8556a7 100%) !important;
    transform: translateY(-1px);
}

/* Drag Indicator */
.drag-indicator {
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 16px;
    color: rgba(255,255,255,0.7);
    letter-spacing: 2px;
    transform: rotate(90deg);
    cursor: grab;
    transition: all 0.3s ease;
    z-index: 1001;
}

.drag-indicator:active,
.draggable-header.dragging .drag-indicator {
    cursor: grabbing;
    color: rgba(255,255,255,1);
    transform: rotate(90deg) scale(1.2);
}

/* Header Controls */
.header-controls-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 1001;
}

.modal-control {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}

.modal-control:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.minimize-btn:hover {
    background: rgba(255, 193, 7, 0.8);
}

.maximize-btn:hover {
    background: rgba(40, 167, 69, 0.8);
}

.close-btn:hover {
    background: rgba(220, 53, 69, 0.8);
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    z-index: 1000;
    background: rgba(255,255,255,0.1);
    transition: background 0.2s ease;
}

.resize-handle:hover {
    background: rgba(255,255,255,0.3);
}

.resize-handle-n {
    top: 0;
    left: 10px;
    right: 10px;
    height: 6px;
    cursor: n-resize;
}

.resize-handle-s {
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 6px;
    cursor: s-resize;
}

.resize-handle-e {
    top: 10px;
    right: 0;
    bottom: 10px;
    width: 6px;
    cursor: e-resize;
}

.resize-handle-w {
    top: 10px;
    left: 0;
    bottom: 10px;
    width: 6px;
    cursor: w-resize;
}

.resize-handle-ne {
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    cursor: ne-resize;
}

.resize-handle-nw {
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    cursor: nw-resize;
}

.resize-handle-se {
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    cursor: se-resize;
}

.resize-handle-sw {
    bottom: 0;
    left: 0;
    width: 12px;
    height: 12px;
    cursor: sw-resize;
}

/* Dragging States */
.draggable-modal.being-dragged {
    transform: scale(1.02) !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4) !important;
    border: 2px solid rgba(255,255,255,0.5);
}

.draggable-header.dragging {
    background: linear-gradient(135deg, #8c9eff 0%, #9564b8 100%) !important;
    backdrop-filter: blur(10px);
}

/* Modal body adjustments for draggable */
.draggable-modal .modal-body {
    max-height: calc(100% - 60px);
    overflow-y: auto;
}

.draggable-modal .modal-header h3 {
    margin: 0;
    padding-right: 150px; /* Space for controls */
    padding-left: 50px; /* Space for drag indicator */
}

/* Drag Tooltip */
.drag-tooltip {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.drag-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.drag-tooltip::before {
    content: '👆';
    margin-right: 6px;
}

/* Mobile Responsive Improvements for Draggable Modal */
@media (max-width: 768px) {
    .draggable-modal {
        min-width: 320px !important;
        min-height: 400px !important;
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 20px) !important;
        max-width: none !important;
        top: 10px !important;
        left: 10px !important;
    }
    
    .draggable-header {
        padding: 15px;
    }
    
    .draggable-modal .modal-header h3 {
        font-size: 1.2em;
        padding-right: 100px;
        padding-left: 40px;
    }
    
    .header-controls-modal {
        top: 10px;
        right: 15px;
        gap: 6px;
    }
    
    .modal-control {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
    
    /* Mobile timed ads adjustments */
    .main-container {
        flex-direction: column;
    }
    
    .timed-ad-container {
        width: 100%;
        height: 200px;
        order: 2;
        max-height: 200px;
    }
    
    .timed-ad-container.right-side {
        order: 2;
    }
    
    .timed-ad-content {
        padding: 10px;
    }
    
    .ad-placeholder-box {
        padding: 10px;
    }
    
    .ad-timer-status {
        bottom: 10px;
        right: 10px;
        font-size: 10px;
        padding: 5px 10px;
    }
}

/* Print Styles - Hide UI elements during printing */
@media print {
    /* Hide all UI elements */
    .header,
    .ribbon-tabs,
    .ribbon-content,
    .pages-navigation,
    .status-bar,
    .timed-ad-container,
    .ad-timer-status,
    .keyboard-toggle,
    .free-watermark,
    .virtual-keyboard,
    .modal,
    button,
    .ruler {
        display: none !important;
    }
    
    /* Show only the editor content */
    body {
        background: white !important;
        color: black !important;
        font-family: 'Noto Nastaliq Urdu', Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    
    .main-container {
        display: block !important;
    }
    
    .editor-main {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .editor-container {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    
    .editor-wrapper {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 20px !important;
        overflow: visible !important;
    }
    
    .page-margin {
        display: none !important;
    }
    
    .pages-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .page-content {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 20px !important;
        width: 100% !important;
        min-height: auto !important;
        overflow: visible !important;
        page-break-inside: avoid;
    }
    
    /* Ensure proper text formatting for print */
    .page-content p,
    .page-content div,
    .page-content span {
        color: black !important;
        background: transparent !important;
    }
    
    /* Handle page breaks */
    .page-content.landscape {
        page-break-before: always;
        width: 100% !important;
    }
    
    /* Print-specific font adjustments */
    .page-content {
        font-size: 14pt !important;
        line-height: 1.6 !important;
    }
    
    /* Remove any visual effects for print */
    * {
        box-shadow: none !important;
        border-radius: 0 !important;
        background-image: none !important;
    }
}
    .drag-indicator {
        font-size: 14px;
        top: 8px;
        left: 15px;
    }
    
    .resize-handle {
        background: rgba(255,255,255,0.3) !important;
    }
    
    /* Hide some resize handles on mobile for better usability */
    .resize-handle-n,
    .resize-handle-w,
    .resize-handle-nw,
    .resize-handle-ne {
        display: none;
    }
    
    .drag-tooltip {
        font-size: 12px;
        padding: 6px 12px;
        top: 15px;
    }
}

.license-plans {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.plan-card {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    position: relative;
    background: white;
    transition: all 0.3s ease;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.plan-card.pro-plan {
    border-color: #ffd700;
    background: linear-gradient(145deg, #fff9e6, #ffffff);
}

.plan-card.premium-plan {
    border-color: #ff6b6b;
    background: linear-gradient(145deg, #fff0f0, #ffffff);
}

.plan-card h4 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: bold;
}

.plan-card .price {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #2c3e50;
}

.plan-card .lifetime {
    font-size: 12px;
    display: block;
    color: #7f8c8d;
    margin-top: 5px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: right;
    direction: rtl;
}

.features-list li {
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.features-list i.fa-check {
    color: #27ae60;
}

.features-list i.fa-times {
    color: #e74c3c;
}

.text-muted {
    opacity: 0.5;
}

.btn-license {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.btn-license.current {
    background: #95a5a6;
    color: white;
}

.btn-license.pro {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #333;
}

.btn-license.pro:hover {
    background: linear-gradient(135deg, #ffb700, #ff9500);
    transform: translateY(-2px);
}

.btn-license.premium {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.btn-license.premium:hover {
    background: linear-gradient(135deg, #ee5a24, #d63031);
    transform: translateY(-2px);
}

/* Activation Form */
.activation-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.activation-form h4 {
    margin: 0 0 20px 0;
    text-align: center;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    text-align: right;
    direction: rtl;
}

.form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
    direction: ltr;
    text-align: left;
}

.license-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 25px 0;
}

.btn-activate {
    background: #28a745;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-activate:hover {
    background: #218838;
}

.btn-purchase {
    background: #007bff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-purchase:hover {
    background: #0056b3;
}

.contact-info {
    text-align: center;
    background: #e9ecef;
    padding: 20px;
    border-radius: 5px;
    margin-top: 20px;
    direction: rtl;
}

.contact-info p {
    margin: 5px 0;
}

.contact-info .small {
    font-size: 12px;
    color: #6c757d;
}

/* Free Version Limitations */
.free-limitation {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 215, 0, 0.9);
    color: #333;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.free-limitation.show {
    display: block;
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Main Container Layout */
.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Main Container Layout */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Timed Ad Container (Right Side) */
.timed-ad-container {
    width: 250px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
    animation: slideInRight 0.5s ease-in-out;
    z-index: 100;
}

.timed-ad-container.right-side {
    order: 2;
}

/* Ad Timer Header */
.ad-timer-header {
    background: rgba(0,0,0,0.2);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.ad-timer-text {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.ad-skip-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ad-skip-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* Timed Ad Content */
.timed-ad-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.ad-placeholder-box {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

/* Ad Demo Content */
.ad-demo-content h3 {
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
    font-size: 16px;
}

.ad-features {
    margin: 15px 0;
}

.ad-features p {
    color: #f1f2f6;
    font-size: 12px;
    margin: 8px 0;
    padding: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
}

.ad-cta {
    text-align: center;
    margin-top: 15px;
}

.price-highlight {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
    display: inline-block;
}

.ad-upgrade-btn {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s ease;
    width: 100%;
}

.ad-upgrade-btn:hover {
    background: linear-gradient(135deg, #00a085, #00b7b8);
    transform: scale(1.05);
}

/* External Ad Space */
.external-ad-space {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    text-align: center;
}

.ad-note {
    color: #ddd;
    font-size: 10px;
    margin: 5px 0;
    font-style: italic;
}

/* Ad Timer Status */
.ad-timer-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
    z-index: 1000;
    animation: pulse 2s infinite;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(108, 92, 231, 0.6);
    }
    100% {
        box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
    }
}


.ad-content h3, .ad-content h4 {
    color: #2d3436;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
}

.ad-content p {
    color: #636e72;
    margin-bottom: 10px;
    font-size: 12px;
}

.upgrade-btn {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s ease;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #00a085, #00b7b8);
    transform: scale(1.05);
}

.upgrade-btn.premium {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.upgrade-btn.premium:hover {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
}

.mini-upgrade-btn {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    font-size: 10px;
    transition: all 0.3s ease;
}

.mini-upgrade-btn:hover {
    background: linear-gradient(135deg, #5f3dc4, #9775fa);
    transform: scale(1.05);
}

/* Pro Feature Styling */
.pro-feature {
    position: relative;
    opacity: 1;
}

.pro-feature::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 215, 0, 0.1) 50%, transparent 60%);
    border-radius: 4px;
    pointer-events: none;
}

.pro-label {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    font-size: 6px;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Stats Grid for Word Count Modal */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.stat-label {
    font-weight: 500;
    color: #495057;
    font-size: 12px;
}

.stat-value {
    font-weight: bold;
    color: #2d3436;
    font-size: 14px;
}

/* Transliteration Features */
.translit-result {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 5px;
    padding: 10px;
    margin-top: 10px;
    font-size: 18px;
    color: #1565c0;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* License Badge Styles */
.license-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: bold;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.license-badge.pro {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.license-badge.premium {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

/* Free Version Watermark */
.free-watermark {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 215, 0, 0.8);
    color: #333;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.free-watermark.hidden {
    display: none;
}

/* Focus Styles */
button:focus, select:focus, input:focus {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

/* Loading Animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Error and Success Messages */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 5px;
    color: white;
    z-index: 1001;
    animation: slideIn 0.3s;
}

.message.success {
    background: #4caf50;
}

.message.error {
    background: #f44336;
}

.message.warning {
    background: #ff9800;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Urdu Font Specific Styles */
.urdu-text {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', Arial, sans-serif;
    direction: rtl;
    text-align: right;
    line-height: 1.8;
}

.nastaliq {
    font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', Arial, sans-serif;
}

.naskh {
    font-family: 'Noto Nastaliq Urdu', Arial, sans-serif;
}

/* Traditional Arabic Font Styles */
.traditional-arabic {
    font-family: 'Traditional Arabic', 'Arabic Typesetting', serif;
    direction: rtl;
    text-align: right;
    line-height: 2.0;
}

.arabic-typesetting {
    font-family: 'Arabic Typesetting', 'Traditional Arabic', serif;
    font-size: 110%; /* Traditional Arabic fonts often need larger size */
}

.amiri-font {
    font-family: 'Amiri', serif;
    direction: rtl;
    line-height: 1.9;
}

.scheherazade-font {
    font-family: 'Scheherazade New', serif;
    direction: rtl;
    line-height: 1.9;
}

.kufi-font {
    font-family: 'Reem Kufi', 'Noto Kufi Arabic', sans-serif;
    direction: rtl;
    font-weight: 400;
}

.ruqaa-font {
    font-family: 'Aref Ruqaa', cursive;
    direction: rtl;
    line-height: 2.2;
}

.harmattan-font {
    font-family: 'Harmattan', serif;
    direction: rtl;
    line-height: 1.8;
}

.lateef-font {
    font-family: 'Lateef', serif;
    direction: rtl;
    line-height: 1.9;
}

/* Additional Formatting Options */
.text-highlight {
    background-color: #ffff00;
}

.text-subscript {
    vertical-align: sub;
    font-size: smaller;
}

.text-superscript {
    vertical-align: super;
    font-size: smaller;
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.text-outline {
    -webkit-text-stroke: 1px #000000;
}

/* Table Styles */
.table-border-thin {
    border-collapse: collapse;
}

.table-border-thin td, .table-border-thin th {
    border: 1px solid #000;
}

.table-border-thick {
    border-collapse: collapse;
}

.table-border-thick td, .table-border-thick th {
    border: 2px solid #000;
}

.table-no-border {
    border-collapse: collapse;
}

.table-no-border td, .table-no-border th {
    border: none;
}

/* Page Break */
.page-break {
    page-break-before: always;
    break-before: page;
}

/* Margin and Padding Utilities */
.m-0 { margin: 0; }
.m-1 { margin: 5px; }
.m-2 { margin: 10px; }
.m-3 { margin: 15px; }
.m-4 { margin: 20px; }
.m-5 { margin: 25px; }

.p-0 { padding: 0; }
.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }
.p-5 { padding: 25px; }

/* Text Alignment Classes */
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-justify { text-align: justify; }

/* Font Weight Classes */
.font-thin { font-weight: 100; }
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

/* Dropdown Menu Styles for Traditional Arabic Features */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 250px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 4px;
    border: 1px solid #ddd;
    right: 0;
    top: 100%;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-family: inherit;
    font-size: 14px;
    direction: rtl;
    text-align: right;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-btn:hover {
    background-color: #e3f2fd !important;
}

/* Traditional Arabic specific styling */
.traditional-arabic-preview {
    font-family: 'Traditional Arabic', 'Arabic Typesetting', serif;
    font-size: 18px;
    line-height: 2.0;
    direction: rtl;
    text-align: right;
    margin: 10px 0;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.arabic-diacritics-helper {
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
    padding: 10px;
    margin: 10px 0;
    font-family: 'Amiri', serif;
    direction: rtl;
    text-align: right;
}

.kashida-example {
    font-family: 'Traditional Arabic', serif;
    font-size: 20px;
    letter-spacing: 2px;
    direction: rtl;
    text-align: center;
    padding: 15px;
    background: linear-gradient(45deg, #fff3e0, #ffe0b2);
    border-radius: 8px;
    margin: 10px 0;
}

/* Arabic Mode Indicator */
.arabic-mode-active {
    background: linear-gradient(45deg, #4caf50, #45a049) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

/* Font preview modal specific styles */
.font-preview-item {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.font-preview-item:hover {
    background: #f0f0f0;
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.font-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.font-sample {
    direction: rtl;
    text-align: right;
    line-height: 1.8;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #eee;
}
