* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    direction: rtl;
    font-size: 14px;
    color: #333;
}

.main-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    margin: 0 5px;
}

.breadcrumb span {
    color: #999;
    margin: 0 2px;
}

/* Content Container */
.content-container {
    padding: 20px 30px 30px;
}

/* Header Row */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.preview-btn, .save-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-btn:hover {
    background-color: #f5f5f5;
}

.save-btn {
    background-color: #1e88e5;
    border-color: #1e88e5;
    color: white;
}

.save-btn:hover {
    background-color: #1976d2;
    border-color: #1976d2;
}

.preview-btn i, .save-btn i {
    margin-left: 5px;
    font-size: 14px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.1);
}

/* Editor Styles */
.editor-container {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 25px;
}

.editor-toolbar {
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.toolbar-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: transparent;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background-color: #eee;
}

.toolbar-btn.active {
    background-color: #e3f2fd;
    color: #1e88e5;
}

.editor-content {
    min-height: 300px;
    padding: 15px;
    outline: none;
    font-size: 14px;
    line-height: 1.6;
}

/* Additional Options Section */
.additional-options {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.additional-options h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.options-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.options-row:last-child {
    margin-bottom: 0;
}

.option-group {
    flex: 1;
}

.option-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Select Dropdown */
.select-container {
    position: relative;
}

.form-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.select-arrow {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}

/* Date Input */
.date-input {
    position: relative;
}

.date-input i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.date-input input {
    padding-left: 40px;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.cancel-btn {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #666;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background-color: #f5f5f5;
}

.delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid #f44336;
    background-color: #fff;
    color: #f44336;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    background-color: #ffebee;
}

.delete-btn i {
    margin-left: 5px;
    font-size: 14px;
}

/* Responsive Design */

/* Large Tablets - 992px to 1199px */
@media (max-width: 1199px) and (min-width: 992px) {
    .main-container {
        max-width: 960px;
        margin: 0 16px;
    }
    
    .content-container {
        padding: 24px;
    }
    
    .breadcrumb {
        padding: 12px 16px;
    }
}

/* Small Tablets - 768px to 991px */
@media (max-width: 991px) and (min-width: 768px) {
    .main-container {
        max-width: 720px;
        margin: 0 12px;
        border-radius: 8px;
    }
    
    .content-container {
        padding: 20px;
    }
    
    .breadcrumb {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 20px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
    }
    
    .preview-btn, .save-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .options-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .editor-toolbar {
        padding: 8px 12px;
        gap: 4px;
    }
    
    .toolbar-btn {
        width: 32px;
        height: 32px;
    }
    
    .editor-content {
        min-height: 250px;
        padding: 12px;
    }
    
    .additional-options {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .form-actions {
        flex-direction: row;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* Large Mobile - 576px to 767px */
@media (max-width: 767px) and (min-width: 576px) {
    .main-container {
        max-width: 540px;
        margin: 0 8px;
        border-radius: 6px;
    }
    
    .content-container {
        padding: 16px;
    }
    
    .breadcrumb {
        padding: 8px 12px;
        font-size: 11px;
        flex-wrap: wrap;
    }
    
    .page-title {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .header-actions {
        display: flex;
        width: 100%;
        gap: 8px;
    }
    
    .preview-btn, .save-btn {
        flex: 1;
        padding: 12px;
        font-size: 13px;
        justify-content: center;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-control {
        padding: 12px;
        font-size: 14px;
        border-radius: 4px;
    }
    
    .editor-container {
        margin-bottom: 20px;
        border-radius: 4px;
    }
    
    .editor-toolbar {
        padding: 6px 8px;
        gap: 3px;
        flex-wrap: wrap;
    }
    
    .toolbar-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .editor-content {
        min-height: 200px;
        padding: 10px;
        font-size: 13px;
    }
    
    .additional-options {
        padding: 12px;
        margin-bottom: 16px;
        border-radius: 4px;
    }
    
    .additional-options h3 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .options-row {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .option-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .form-select, .form-control {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .date-input input {
        padding-left: 36px;
        font-size: 13px;
    }
    
    .date-input i {
        left: 12px;
        font-size: 13px;
    }
    
    .select-arrow {
        left: 12px;
        font-size: 11px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 20px;
    }
    
    .cancel-btn, .delete-btn, .save-btn {
        width: 100%;
        padding: 12px;
        font-size: 13px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Small Mobile - Less than 576px */
@media (max-width: 575px) {
    .main-container {
        width: 100%;
        margin: 0 4px;
        border-radius: 0;
        box-shadow: none;
    }
    
    .content-container {
        padding: 12px;
    }
    
    .breadcrumb {
        padding: 6px 8px;
        font-size: 10px;
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .breadcrumb a, .breadcrumb span {
        margin: 0 1px;
    }
    
    .page-title {
        font-size: 18px;
        margin-bottom: 6px;
        text-align: center;
    }
    
    .header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .header-actions {
        display: flex;
        width: 100%;
        gap: 6px;
    }
    
    .preview-btn, .save-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 12px;
        justify-content: center;
    }
    
    .preview-btn i, .save-btn i {
        margin-left: 3px;
        font-size: 12px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .form-control {
        padding: 10px;
        font-size: 13px;
        border-radius: 3px;
    }
    
    .editor-container {
        margin-bottom: 16px;
        border-radius: 3px;
    }
    
    .editor-toolbar {
        padding: 4px 6px;
        gap: 2px;
        flex-wrap: wrap;
    }
    
    .toolbar-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
        border-radius: 2px;
    }
    
    .editor-content {
        min-height: 180px;
        padding: 8px;
        font-size: 12px;
        line-height: 1.5;
    }
    
    .additional-options {
        padding: 10px;
        margin-bottom: 12px;
        border-radius: 3px;
    }
    
    .additional-options h3 {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .options-row {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .option-group label {
        font-size: 11px;
        margin-bottom: 3px;
    }
    
    .form-select, .option-group .form-control {
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 3px;
    }
    
    .date-input input {
        padding: 8px 32px 8px 10px;
        font-size: 12px;
    }
    
    .date-input i {
        left: 10px;
        font-size: 12px;
    }
    
    .select-arrow {
        left: 10px;
        font-size: 10px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 6px;
        margin-top: 16px;
    }
    
    .cancel-btn, .delete-btn, .save-btn {
        width: 100%;
        padding: 10px;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 3px;
    }
    
    .delete-btn i {
        margin-left: 3px;
        font-size: 12px;
    }
}

/* Extra Small Mobile - Less than 400px */
@media (max-width: 399px) {
    .main-container {
        margin: 0 2px;
    }
    
    .content-container {
        padding: 8px;
    }
    
    .breadcrumb {
        padding: 4px 6px;
        font-size: 9px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .header-actions {
        gap: 4px;
    }
    
    .preview-btn, .save-btn {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    .form-control {
        padding: 8px;
        font-size: 12px;
    }
    
    .editor-toolbar {
        padding: 3px 4px;
        gap: 1px;
    }
    
    .toolbar-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .editor-content {
        min-height: 150px;
        padding: 6px;
        font-size: 11px;
    }
    
    .additional-options {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .additional-options h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .options-row {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .option-group label {
        font-size: 10px;
        margin-bottom: 2px;
    }
    
    .form-select, .option-group .form-control {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .date-input input {
        padding: 6px 28px 6px 8px;
        font-size: 11px;
    }
    
    .date-input i {
        left: 8px;
        font-size: 11px;
    }
    
    .form-actions {
        gap: 4px;
        margin-top: 12px;
    }
    
    .cancel-btn, .delete-btn, .save-btn {
        padding: 8px;
        font-size: 11px;
    }
}

/* Touch Device Optimizations */
@media (pointer: coarse) {
    .form-control,
    .form-select,
    .preview-btn,
    .save-btn,
    .cancel-btn,
    .delete-btn,
    .toolbar-btn {
        min-height: 44px;
    }
    
    .toolbar-btn {
        min-width: 44px;
    }
}

/* Landscape Orientation on Mobile */
@media (max-width: 991px) and (orientation: landscape) and (max-height: 500px) {
    .content-container {
        padding: 12px;
    }
    
    .header-row {
        margin-bottom: 12px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .editor-content {
        min-height: 120px;
    }
    
    .additional-options {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .form-actions {
        margin-top: 12px;
    }
}
