/* Arabic Calligraphy Editor Styles */
:root {
    --sidebar-width: 380px;
    --editor-bg: #f8fafc;
    --sidebar-bg: #ffffff;
    --border-color: #e2e8f0;
    --accent-color: #00b894;
    --primary-color: #2d3436;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
}

.editor-page {
    background-color: var(--editor-bg);
}

/* Hero Section */
.hero-centered {
    padding: 6rem 0;
    text-align: center;
    background-color: var(--white);
    background-image: 
        linear-gradient(rgba(226, 232, 240, 0.8) 1.5px, transparent 1.5px),
        linear-gradient(90deg, rgba(226, 232, 240, 0.8) 1.5px, transparent 1.5px);
    background-size: 50px 50px;
    border-bottom: 1px solid var(--border-color);
}

.full-height-hero {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-centered .hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero-centered h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 700; /* Less bold */
    color: #000;
    line-height: 1.1;
    margin-bottom: 2rem;
    letter-spacing: -1px;
}

.hero-centered p {
    font-size: 1.25rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 3rem;
}

.hero-badges {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.badge {
    background: transparent;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #3b82f6;
    border: 1px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Main Container */
.editor-container {
    display: flex;
    height: auto;
    min-height: auto;
    border-top: 1px solid var(--border-color);
    background: var(--editor-bg);
}

/* Sidebar */
.editor-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 90; /* Below header z-index 100 */
    overflow-x: hidden;
    height: 800px;
    overflow-y: auto;
    position: sticky;
    top: 80px; /* Position below header when scrolling */
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.pro-badge {
    background: #1a1a1a;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-groups-wrapper {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.editor-group {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    width: 100% !important;
    box-sizing: border-box;
    display: block !important;
}

.editor-group-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #f8fafc;
    padding-bottom: 0.75rem;
    display: block !important;
}

.input-wrapper {
    margin-bottom: 1.5rem;
    width: 100%;
}

.input-wrapper label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.input-wrapper label span {
    color: var(--accent-color);
    font-family: monospace;
    font-weight: 600;
}

/* Base Field Styles */
#englishInput, #arabicTextArea, #fontFamilySelector, #canvasWidth, #canvasHeight {
    width: 100%;
    box-sizing: border-box;
    padding: 0.85rem 1rem;
    border: 1px solid #000;
    border-radius: 0;
    font-size: 0.95rem;
    background: #fff;
}

.translation-box {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.primary-btn {
    background: #fff;
    color: #2d3436;
    border: 1px solid #000;
    padding: 0.85rem 1.5rem;
    border-radius: 0;
    font-weight: 500;
    cursor: pointer;
}

.primary-btn:hover {
    border-color: #000;
    background: #f8fafc;
}

#arabicTextArea {
    height: 100px;
    font-family: 'Amiri', serif;
    font-size: 1.25rem;
    line-height: 1.4;
    resize: vertical;
}

.btn-row {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

/* Range Sliders */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #000;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid #fff;
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8fafc;
    width: 100%;
    box-sizing: border-box;
}

input[type="color"] {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.hex-val {
    font-family: monospace;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.preset-grid, .bg-options-grid, .scale-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
}

.preset-btn, .bg-opt-btn, .scale-btn, .secondary-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #000;
    background: #fff;
    border-radius: 0;
    cursor: pointer;
    text-align: center;
    color: #2d3436;
}

.preset-btn.active, .bg-opt-btn.active, .scale-btn.active {
    background: #2d3436;
    color: #fff;
    border-color: #2d3436;
}

.custom-size-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.custom-size-inputs input {
    width: 65px !important;
    text-align: center;
    padding: 0.5rem !important;
}

.custom-size-inputs span { font-weight: 500; color: #94a3b8; font-size: 0.8rem; }

/* Buttons */
.btn-full { width: 100%; padding: 0.9rem; font-size: 0.95rem; }

/* Preview Area */
.editor-preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background-color: #f1f5f9;
    height: 800px; /* Match sidebar height on desktop */
}

.preview-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.canvas-info {
    font-size: 0.85rem;
    background: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.zoom-control label { font-size: 0.8rem; font-weight: 500; }
.zoom-control input { width: 80px; }

/* Canvas Rendering */
.canvas-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 20px 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 400px;
}

.main-canvas {
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    position: relative;
    max-width: 100%;
}

.draggable-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: move;
    user-select: none;
    text-align: center !important;
    white-space: pre-wrap;
}

.preview-footer { padding-top: 1.5rem; text-align: center; }
.preview-footer p { font-size: 0.8rem; color: #64748b; font-weight: 500; }

/* Sections Below Editor */
.steps-section, .faq-section { padding: 4rem 1.5rem; background: #fff; }
.steps-section h2, .faq-section h2 { font-size: 2rem; font-weight: 700; text-align: center; }

@media (max-width: 1024px) {
    .editor-container {
        flex-direction: column-reverse; /* Preview on Top, Editor Sidebar on Bottom */
    }
    .editor-sidebar {
        width: 100%;
        border-right: none;
        border-top: 1px solid var(--border-color);
        height: auto; /* Remove fixed height on tablets/mobile */
        overflow-y: visible;
    }
    .editor-preview-area {
        padding: 1.5rem 1rem;
        height: auto; /* Remove fixed height on tablets/mobile */
    }
}

@media (max-width: 768px) {
    .hero-centered { padding: 4rem 0; }
    .hero-centered h1 { font-size: 2.25rem; }
    .hero-centered p { font-size: 1.1rem; }
    .badge { font-size: 0.85rem; padding: 6px 14px; }
    
    .preview-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .zoom-control {
        justify-content: space-between;
    }
    .zoom-control input {
        flex: 1;
        width: auto !important;
    }
    .custom-size-inputs { justify-content: center; }
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a1a;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* FAQ Accordion Styling */
.faq-section {
    padding: 5rem 0;
    background: #fff;
}

.faq-accordion {
    max-width: 800px;
    margin: 3rem auto 0;
}

.faq-item {
    background: #fff;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.faq-item:hover {
    border-color: #000;
}

.faq-question {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    user-select: none;
}

.faq-question i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #f8fafc;
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.faq-item.active {
    border-color: #000;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding-top: 0;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

/* Remove all animations/transitions */
* {
    transition: none; /* Resetting basic transitions to allow specific ones above */
}

.editor-sidebar, .editor-preview-area, .faq-item, .faq-answer, .faq-question i, .toast-notification {
    transition: all 0.3s ease !important; /* Re-enable only for these */
}

