﻿:root {
    --primary: #0ea5e9;
    --primary-dark: #0369a1;
    --primary-light: #7dd3fc;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    min-height: 100vh;
    background: var(--dark);
    color: var(--dark);
    direction: rtl;
}

.app-container {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

#canvas-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.6;
}

.gradient-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 0% 0%, rgba(14, 165, 233, 0.15) 0%, transparent 50%), radial-gradient(circle at 100% 100%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
    filter: blur(80px);
    z-index: 2;
}

.main-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 3;
}

.header-logos {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
}

.main-content {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(0px);
    border-radius: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 100px 24px 80px 24px;
    min-height: calc(100vh - 300px);
    padding: 32px;
    position: relative;
    z-index: 3;
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.footer {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 5px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 14px;
    z-index: 10;
}

.kfsc-logo {
    height: 90px;
    width: auto;
    opacity: 0.9;
}

/* Navigation Styles */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
}

.nav-item.dropdown {
    position: relative;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-toggle::after {
    content: '';
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 240px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 20;
}

    .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.dropdown-item {
    padding: 0.8rem 1rem;
    color: var(--dark);
    text-decoration: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.2s ease;
    margin: 0.2rem 0;
    font-size: 0.95rem;
}

    .dropdown-item:hover {
        background: #f8f9fa;
        transform: translateX(-5px);
    }

.dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-circle {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .btn-circle:hover {
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
        transform: translateY(-2px);
    }

.navbar-toggler {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* Responsive Styles */
@media (max-width: 991px) {
    .navbar-toggler {
        display: block;
    }

    .navbar-collapse {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: white;
        padding: 1rem;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        display: none;
    }

        .navbar-collapse.show {
            display: block;
        }

    .navbar-nav {
        flex-direction: column;
    }

    .nav-link {
        color: var(--dark);
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    .header-logos {
        padding: 16px;
    }

    .main-content {
        margin: 120px 16px 80px 16px;
        padding: 24px;
    }

    .kfsc-logo {
        height: 60px;
    }
}

@media (max-width: 480px) {
    .main-content {
        margin: 100px 12px 80px 12px;
        padding: 16px;
    }
}

/* Alert and Validation Styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-info {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.text-danger {
    color: #dc2626;
}

.validation-summary-errors {
    color: #dc2626;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

    .validation-summary-errors ul {
        margin: 0;
        padding-right: 1.5rem;
    }




/* Content.css - Styles for view content */

/* Card Containers */
.content-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Headers and Titles */
.content-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    text-align: center;
    background: linear-gradient(45deg, #fff, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.content-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Form Elements */
.form-container {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    position: relative;
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

    .form-control:focus {
        background: rgba(255, 255, 255, 0.15);
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
        outline: none;
    }

    .form-control::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    color: white;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    }

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
    }

/* Validation and Messages */
.validation-summary {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #fecaca;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.text-danger {
    color: #fda4af;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.content-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    .content-table th,
    .content-table td {
        padding: 1rem;
        color: white;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .content-table th {
        background: rgba(255, 255, 255, 0.1);
        font-weight: 600;
        text-align: right;
    }

    .content-table tr:hover td {
        background: rgba(255, 255, 255, 0.05);
    }

/* Grid Layout */
.grid-container {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    margin-bottom: 1.5rem;
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .content-card {
        padding: 1.5rem;
    }

    .action-buttons {
        flex-direction: column-reverse;
    }

        .action-buttons .btn {
            width: 100%;
        }

    .grid-container {
        grid-template-columns: 1fr;
    }
}

/* Helper Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}



/* Tables */
.table-responsive {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: rgba(255, 255, 255, 0.9);
}

    .table th {
        background: rgba(255, 255, 255, 0.1);
        padding: 1rem;
        font-weight: 600;
        text-align: right;
        border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    }

    .table td {
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .table tbody tr:hover {
        background: rgba(255, 255, 255, 0.05);
    }

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.action-btn {
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .action-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }

    .action-btn.edit {
        color: #60a5fa;
    }

    .action-btn.delete {
        color: #f87171;
    }

    .action-btn.view {
        color: #34d399;
    }

/* Select Dropdowns */
.form-select {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.1) url("data:image/svg+xml,...") no-repeat left 1rem center;
    background-size: 16px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    appearance: none;
}

    .form-select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    }

/* Checkboxes and Radios */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1.2em;
    height: 1.2em;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
}

    .form-check-input:checked {
        background-color: var(--primary);
        border-color: var(--primary);
    }

.form-check-label {
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

/* Search Input */
.search-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.page-item {
    list-style: none;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

    .page-link:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }

.page-item.active .page-link {
    background: var(--primary);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
}

/* Modal/Dialog */
.modal-content {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
}

.modal-title {
    color: white;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
}

.info-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.info-card-title {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.info-card-body {
    color: rgba(255, 255, 255, 0.8);
}

/* Tabs */
.tab-container {
    margin-bottom: 2rem;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.nav-tab {
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .nav-tab:hover {
        color: white;
    }

    .nav-tab.active {
        color: var(--primary);
        border-bottom-color: var(--primary);
    }

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-primary {
    background: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

    [data-tooltip]:before {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        padding: 0.5rem 1rem;
        background: rgba(0, 0, 0, 0.8);
        color: white;
        border-radius: 4px;
        font-size: 0.875rem;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
    }

    [data-tooltip]:hover:before {
        opacity: 1;
        transform: translateX(-50%) translateY(-8px);
    }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .table-responsive {
        padding: 0.5rem;
    }

    .table th,
    .table td {
        padding: 0.75rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .nav-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
    }
}



/* Enhanced Mobile Layout */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
        gap: 20px;
        padding: 16px;
        padding-top: 80px;
        align-items: stretch;
    }

    .info-section {
        padding: 16px;
        text-align: center;
    }

    .main-title {
        font-size: 28px;
        margin-bottom: 12px;
    }

    .main-description {
        font-size: 14px;
        margin-bottom: 24px;
    }

    /* Improve feature slider for mobile */
    .feature-slider {
        height: 140px;
    }

    .feature-card {
        padding: 16px;
        border-radius: 12px;
    }

    .feature-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        margin-bottom: 8px;
    }

    .feature-title {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .feature-description {
        font-size: 12px;
        line-height: 1.4;
    }

    /* Enhanced login section for mobile */
    .login-section {
        width: 100%;
        padding: 0;
    }

    .login-card {
        border-radius: 16px;
        padding: 24px 16px;
        margin: 0;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }

    .form-header {
        margin-bottom: 24px;
    }

    .login-options {
        gap: 8px;
        margin-bottom: 20px;
    }

    .login-option {
        padding: 12px 8px;
        font-size: 14px;
    }

        .login-option img {
            width: 20px;
            height: 20px;
        }

    .input-group {
        margin-bottom: 16px;
    }

    .form-input {
        padding: 14px 40px 14px 16px;
        font-size: 14px;
        border-radius: 12px;
    }
}

/* Additional improvements for very small screens */
@media (max-width: 360px) {
    .main-title {
        font-size: 24px;
    }

    .main-description {
        font-size: 13px;
    }

    .login-card {
        padding: 20px 12px;
    }

    .form-header {
        margin-bottom: 20px;
    }

    .form-title {
        font-size: 20px;
    }

    .form-subtitle {
        font-size: 13px;
    }

    .login-option {
        padding: 10px 6px;
        font-size: 13px;
    }

    .input-group {
        margin-bottom: 12px;
    }

    .form-input {
        padding: 12px 36px 12px 12px;
    }

    .submit-button {
        padding: 12px;
        font-size: 14px;
    }
}

/* Improve touch targets for mobile */
@media (hover: none) {
    .login-option,
    .submit-button,
    .form-input {
        min-height: 44px;
    }

    .dot {
        width: 12px;
        height: 12px;
        margin: 0 6px;
    }
}

/* Fix layout shifts during loading */
.main-wrapper {
    min-height: calc(100vh - 100px);
    margin-bottom: 0;
}

/* Improve form accessibility */
.form-input:focus {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

/* Smooth scrolling for better mobile experience */
html {
    scroll-behavior: smooth;
}

/* Prevent content overflow */
* {
    max-width: 100%;
    overflow-wrap: break-word;
}








/* Message Template Container */
.model-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

/* Template Title */
.template-title {
    font-size: 1.25rem;
    color: #1f2937;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: right;
}

/* Fill in the Blank Container */
.fill-in-the-blank {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
    position: relative;
    transition: all 0.3s ease;
}

    .fill-in-the-blank:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }

/* Message Content */
.template-preview {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    direction: rtl;
}

.template-text {
    color: #475569;
    line-height: 1.8;
    font-size: 1.1rem;
    white-space: pre-wrap;
}

/* Template Input Fields */
.template-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    position: relative;
}

    .input-group input {
        width: 100%;
        padding: 0.875rem 1rem;
        background: #ffffff;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        color: #1f2937;
        font-size: 1rem;
        transition: all 0.3s ease;
        direction: rtl;
    }

        .input-group input:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
            outline: none;
        }

        .input-group input::placeholder {
            color: #94a3b8;
        }

/* Variable Highlighting */
.template-variable {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    margin: 0 0.25rem;
}

/* Active State */
.fill-in-the-blank.active {
    border-color: #3b82f6;
    background: #f0f9ff;
}

/* Error State */
.input-group.error input {
    border-color: #ef4444;
    background: #fef2f2;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .model-content {
        padding: 1.5rem;
    }

    .fill-in-the-blank {
        padding: 1.25rem;
    }

    .template-preview {
        padding: 1rem;
    }

    .template-text {
        font-size: 1rem;
    }
}

/* Success State */
.input-group.success input {
    border-color: #10b981;
    background: #f0fdf4;
}

/* Input Counter */
.input-counter {
    position: absolute;
    bottom: -1.25rem;
    left: 0;
    font-size: 0.75rem;
    color: #64748b;
}

/* Template Status */
.template-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    background: #f8fafc;
}

.status-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.status-text {
    font-size: 0.875rem;
    color: #475569;
}

.message-counter-wrapper {
    text-align: left;
    margin-top: 10px;
    padding: 5px;
}

.message-counter {
    font-size: 0.875rem;
    color: #666;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

    .message-counter.warning {
        color: #f59e0b;
        background: #fff7ed;
    }

    .message-counter.danger {
        color: #dc2626;
        background: #fee2e2;
    }

.template-preview {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.template-text {
    white-space: pre-wrap;
    font-size: 1rem;
    line-height: 1.5;
}

.template-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    position: relative;
}

    .input-group input {
        width: 100%;
        padding: 0.75rem 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        font-size: 1rem;
        direction: rtl;
        transition: all 0.2s;
    }

        .input-group input:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

    .input-group.error input {
        border-color: #dc2626;
        background: #fee2e2;
    }

.template-variable {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    margin: 0 0.25rem;
}






.total-char-counter {
    text-align: left;
    padding: 8px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.3s ease;
}

    .total-char-counter.warning {
        color: #f59e0b;
        background: #fff7ed;
    }

    .total-char-counter.danger {
        color: #dc2626;
        background: #fee2e2;
        animation: pulse 1s infinite;
    }

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.template-preview {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    direction: rtl;
}

.template-variable {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    margin: 0 0.25rem;
}


#message {
    display: none; /* Hidden by default */
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

    #message:not(:empty) {
        display: block; /* Show when has content */
    }