/* Import Vazirmatn Fonts */
@font-face {
    font-family: 'Vazirmatn-Regular';
    src: url('fonts/Vazirmatn-RD-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn-Medium';
    src: url('fonts/Vazirmatn-RD-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn-SemiBold';
    src: url('fonts/Vazirmatn-RD-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn-Thin';
    src: url('fonts/Vazirmatn-RD-Thin.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn-Regular', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: right;
    background: linear-gradient(135deg, #FFF7F2 0%, #FFEDE0 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Header */
.main-header {
    text-align: center;
    padding: 15px 0;
    margin-bottom: 15px;
}

.main-header h1 {
    font-family: 'Vazirmatn-SemiBold';
    font-size: 26px;
    color: #333;
    text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

/* Main Container */
.main-container {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
    max-width: 1900px;
    margin: 0 auto;
    padding: 0 15px 40px;
    min-height: calc(100vh - 100px);
}

/* Card Base Styles */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    margin-bottom: 18px;
    border: none;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.card h3 {
    font-family: 'Vazirmatn-SemiBold';
    font-size: 18px;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}

/* Left Column - Upload Cards */
.left-column {
    display: flex;
    flex-direction: column;
}

.upload-card .upload-group {
    margin-bottom: 18px;
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-family: 'Vazirmatn-Medium';
    font-size: 15px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    background: #E67E22;
}

.upload-btn:hover {
    background: #D35400;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.3);
}

.upload-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Batch Processing Card */
.batch-card {
    margin-top: 0;
}

.file-name {
    display: block;
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    text-align: center;
    line-height: 1.3;
}

.batch-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.btn {
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: 'Vazirmatn-Medium';
    font-size: 13px;
    transition: all 0.3s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-success {
    background: #D9D9D9;
    color: #333;
}

.btn-success:hover:not(:disabled) {
    background: #C0C0C0;
}

.btn-primary {
    background: #D9D9D9;
    color: #333;
}

.btn-primary:hover:not(:disabled) {
    background: #C0C0C0;
}

/* Progress Bar Styles */
.progress-container {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.progress-container.hidden {
    display: none;
}

.progress-info {
    text-align: center;
    margin-bottom: 10px;
    font-family: 'Vazirmatn-Medium';
    font-size: 14px;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #27AE60, #2ECC71);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-fill.completed {
    background: linear-gradient(90deg, #2ECC71, #27AE60);
    box-shadow: 0 2px 4px rgba(46, 204, 113, 0.3);
}

/* Template Management Card */
.template-mgmt-card {
    margin-top: 0;
}

.template-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.template-mgmt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-family: 'Vazirmatn-Medium';
    font-size: 15px;
    color: white;
    transition: all 0.3s ease;
}

.template-mgmt-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.save-file-btn {
    background: #27AE60;
}

.save-file-btn:hover {
    background: #219A52;
}

.load-file-btn {
    background: #3498DB;
}

.load-file-btn:hover {
    background: #2980B9;
}

.saved-templates-section {
    border-top: 1px solid #EEE;
    padding-top: 14px;
}

.saved-templates-section h4 {
    font-family: 'Vazirmatn-Medium';
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
}

.saved-templates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.saved-templates-header h4 {
    margin-bottom: 0;
}

.sync-btn {
    background: none;
    border: 1px solid #DDD;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.sync-btn:hover {
    background: #F0F0F0;
}

.sync-btn.syncing {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.saved-templates-list {
    max-height: 200px;
    overflow-y: auto;
}

.no-templates {
    font-size: 13px;
    color: #999;
    text-align: center;
    padding: 10px;
}

.saved-template-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #F8F9FA;
    border-radius: 8px;
    border: 1px solid #E9ECEF;
    transition: all 0.2s ease;
}

.saved-template-item:hover {
    background: #E9ECEF;
}

.template-item-info {
    flex: 1;
    cursor: pointer;
}

.template-item-name {
    font-family: 'Vazirmatn-Medium';
    font-size: 13px;
    color: #333;
    margin-bottom: 2px;
}

.template-item-date {
    font-size: 11px;
    color: #999;
}

.template-item-actions {
    display: flex;
    gap: 6px;
}

.template-item-btn {
    padding: 5px 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-family: 'Vazirmatn-Medium';
    transition: all 0.2s ease;
}

.template-load-btn {
    background: #3498DB;
    color: white;
}

.template-load-btn:hover {
    background: #2980B9;
}

.template-delete-btn {
    background: #E74C3C;
    color: white;
}

.template-delete-btn:hover {
    background: #C0392B;
}

.template-rename-btn {
    background: #F39C12;
    color: white;
}

.template-rename-btn:hover {
    background: #E67E22;
}

.template-edit-btn {
    background: #9B59B6;
    color: white;
}

.template-edit-btn:hover {
    background: #8E44AD;
}

.template-rename-input {
    width: 100%;
    padding: 2px 6px;
    border: 2px solid #3498DB;
    border-radius: 4px;
    font-family: 'Vazirmatn-Medium';
    font-size: 13px;
    color: #333;
    background: white;
    outline: none;
    box-sizing: border-box;
}

.template-item-name {
    cursor: pointer;
}

.template-item-name:hover {
    color: #3498DB;
}

/* Center Column - Design Area */
.center-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.design-card {
    width: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

#design-area {
    width: 100%;
    height: 750px;
    border: 2px dashed #FF8C42;
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FAFAFA;
    overflow: hidden;
}

.design-placeholder {
    font-family: 'Vazirmatn-Regular';
    font-size: 16px;
    color: #999;
    text-align: center;
    pointer-events: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: none;
}

#design-area:empty .design-placeholder {
    display: block;
}

#main-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    background: white;
    border: 2px solid #E9ECEF;
    display: block;
    margin: 0 auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
}

/* Image Container and Dragging */
#image-container {
    position: absolute;
    cursor: move;
    border: 2px dashed transparent;
    border-radius: 8px;
    background: transparent;
    transition: border-color 0.2s, background 0.2s;
}

#image-container:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

#image-container.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

#draggable-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    pointer-events: none;
}

/* Resize Handles */
.resize-handles {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    pointer-events: none;
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #667eea;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    opacity: 0;
    transition: opacity 0.2s;
}

#image-container:hover .resize-handle {
    opacity: 1;
}

.resize-nw { top: -5px; left: -5px; cursor: nw-resize; }
.resize-ne { top: -5px; right: -5px; cursor: ne-resize; }
.resize-sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-se { bottom: -5px; right: -5px; cursor: se-resize; }

/* Text Elements */
.text-container {
    position: absolute;
    cursor: move;
    min-width: 20px;
    min-height: 20px;
}

.text-container:hover {
    outline: 2px dashed #667eea;
    outline-offset: 2px;
}

.draggable-text {
    padding: 0px;
    border: 2px dashed #667eea;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-width: auto;
    min-height: 20px;
    display: inline-block;
    text-align: left;
}

.draggable-text:focus {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.15);
}

/* Text Resize Handles */
.text-resize-handles {
    position: absolute;
    top: -5px;
    right: -5px;
    bottom: -5px;
    left: -5px;
    pointer-events: none;
}

.text-resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #667eea;
    border: 1px solid white;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    opacity: 0;
    transition: opacity 0.2s;
}

.text-container:hover .text-resize-handle {
    opacity: 1;
}

.text-resize-se { bottom: -4px; right: -4px; cursor: se-resize; }
.text-resize-sw { bottom: -4px; left: -4px; cursor: sw-resize; }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: 12px;
    border: 2px solid #E9ECEF;
    cursor: pointer;
    font-family: 'Vazirmatn-Medium';
    font-size: 16px;
    color: #333;
    background: white;
    transition: all 0.3s ease;
    min-width: 160px;
    justify-content: center;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.save-btn:hover:not(:disabled) {
    background: #F8F9FA;
    border-color: #8E44AD;
    transform: translateY(-1px);
}

.download-btn:hover:not(:disabled) {
    background: #F8F9FA;
    border-color: #27AE60;
    transform: translateY(-1px);
}

.preview-btn:hover:not(:disabled) {
    background: #F8F9FA;
    border-color: #3498DB;
    transform: translateY(-1px);
}

.action-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Right Column - Controls */
.right-column {
    display: flex;
    flex-direction: column;
}

/* Corner Radius Card */
.radius-card .control-group {
    margin-bottom: 20px;
}

#corner-radius {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #A1A1A1 !important;
    outline: none;
    cursor: pointer;
    margin-bottom: 15px;
    accent-color: #E67E22;
}

#corner-radius::-webkit-slider-track {
    background: #A1A1A1 !important;
    height: 6px;
    border-radius: 3px;
    -webkit-appearance: none;
}

#corner-radius::-moz-range-track {
    background: #A1A1A1 !important;
    height: 6px;
    border-radius: 3px;
    border: none;
}



#corner-radius::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #E67E22;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

#corner-radius::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #E67E22;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}



.radius-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #F8F9FA;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #E9ECEF;
}

.radius-display svg {
    opacity: 0.6;
}

#radius-value {
    font-family: 'Vazirmatn-SemiBold';
    font-size: 14px;
    color: #333;
    background: transparent;
    border: none;
    text-align: center;
    width: 40px;
    outline: none;
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    direction: rtl;
}

#radius-value:focus {
    background: white;
    box-shadow: 0 0 0 2px rgba(255, 107, 26, 0.2);
}

.radius-unit {
    font-family: 'Vazirmatn-SemiBold';
    font-size: 14px;
    color: #666;
}

/* Size Section */
.size-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #EEE;
}

.size-section h4 {
    font-family: 'Vazirmatn-Medium';
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.size-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.size-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.size-input-group label {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.size-input-group input {
    padding: 12px 14px;
    border: 1px solid #DDD;
    border-radius: 8px;
    text-align: center;
    font-family: 'Vazirmatn-Regular';
    font-size: 15px;
}

.size-input-group input:focus {
    outline: none;
    border-color: #FF6B1A;
    box-shadow: 0 0 0 2px rgba(255, 107, 26, 0.2);
}

.size-section small {
    display: block;
    text-align: center;
    font-size: 11px;
    color: #999;
}

.aspect-ratio-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.aspect-ratio-control input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #E67E22;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    border: 2px solid #A1A1A1;
    border-radius: 4px;
    position: relative;
}

.aspect-ratio-control input[type="checkbox"]:checked {
    background: #E67E22;
    border-color: #E67E22;
}

.aspect-ratio-control input[type="checkbox"]:checked::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
}

.aspect-ratio-control label {
    font-size: 15px;
    color: #666;
    cursor: pointer;
}

/* Special Texts Card */
.placeholder-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: #F8F9FA;
    border-radius: 12px;
}

.placeholder-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: 'Vazirmatn-Medium';
    font-size: 15px;
    color: white;
    transition: all 0.3s ease;
    min-width: 100px;
    justify-content: center;
}

.x-btn {
    background: #E67E22;
}

.x-btn:hover {
    background: #D35400;
    transform: translateY(-1px);
}

.y-btn {
    background: #E67E22;
}

.y-btn:hover {
    background: #D35400;
    transform: translateY(-1px);
}

.placeholder-label {
    font-family: 'Vazirmatn-Medium';
    font-size: 16px;
    color: #666;
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #DDD;
    flex: 1;
    text-align: center;
}

/* Font Section */
.font-section {
    position: relative;
    margin-bottom: 16px;
}

.font-section label {
    display: block;
    font-size: 15px;
    color: #666;
    margin-bottom: 10px;
}

.font-dropdown {
    width: 100%;
    padding: 14px 40px 14px 16px;
    border: 1px solid #DDD;
    border-radius: 10px;
    font-family: 'Vazirmatn-Regular';
    font-size: 15px;
    background: white;
    appearance: none;
    cursor: pointer;
}

.font-dropdown:focus {
    outline: none;
    border-color: #FF6B1A;
    box-shadow: 0 0 0 2px rgba(255, 107, 26, 0.2);
}

.dropdown-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    margin-top: 10px;
}

.placeholders-card small {
    display: block;
    font-size: 11px;
    color: #999;
    text-align: center;
    line-height: 1.4;
}

/* Custom Placeholders Styling */
.default-placeholders {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E8E8E8;
}

.add-custom-section {
    margin: 16px 0;
    text-align: center;
}

.custom-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #FF8C42;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Vazirmatn-Medium';
    justify-content: center;
}

.custom-add-btn:hover {
    background: #FF8C42;
    transform: translateY(-1px);
}

.custom-placeholders {
    margin-top: 16px;
}

.custom-placeholder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #F0F8FF;
    border-radius: 10px;
    border: 1px solid #D4E6F8;
}

.custom-placeholder-info {
    flex: 1;
}

.custom-placeholder-text {
    font-family: 'Vazirmatn-Medium';
    font-size: 14px;
    color: #2C5282;
    margin-bottom: 4px;
}

.custom-placeholder-column {
    font-size: 12px;
    color: #718096;
}

.custom-placeholder-actions {
    display: flex;
    gap: 8px;
}

.custom-placeholder-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    font-family: 'Vazirmatn-Medium';
}

.add-custom-btn {
    background: #3182CE;
    color: white;
}

.add-custom-btn:hover {
    background: #2C5282;
}

.delete-custom-btn {
    background: #E53E3E;
    color: white;
}

.delete-custom-btn:hover {
    background: #C53030;
}

/* Add Text Card */
.text-input-group {
    margin-bottom: 16px;
}

#text-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #DDD;
    border-radius: 8px;
    font-family: 'Vazirmatn-Regular';
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

#text-input:focus {
    outline: none;
    border-color: #FF6B1A;
    box-shadow: 0 0 0 2px rgba(255, 107, 26, 0.2);
}

.add-text-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: 'Vazirmatn-Medium';
    font-size: 14px;
    color: white;
    background: #E67E22;
    transition: all 0.3s ease;
}

.add-text-btn:hover {
    background: #E67E22;
    transform: translateY(-1px);
}

.add-text-btn svg {
    width: 16px;
    height: 16px;
}

/* Text Controls Modal */
.text-controls {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 1000;
    min-width: 300px;
}

.text-controls h3 {
    margin-bottom: 20px;
    text-align: center;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.control-row label {
    min-width: 70px;
    font-size: 15px;
    color: #666;
}

.control-row input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #DDD;
    outline: none;
}

.control-row input[type="color"] {
    width: 50px;
    height: 38px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.control-row span {
    min-width: 60px;
    font-size: 15px;
    color: #666;
}

/* Preview Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 12px;
    padding: 20px;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    z-index: 2001;
}

.close:hover {
    color: #333;
}

#preview-image-display {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

/* Custom Placeholder Modal */
.custom-modal .modal-content {
    max-width: 500px;
    max-height: auto;
    padding: 0;
    direction: rtl;
}

.modal-header {
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #E8E8E8;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-family: 'Vazirmatn-SemiBold';
    font-size: 18px;
    color: #333;
    margin: 0;
    text-align: center;
    padding-bottom: 15px;
}

.modal-body {
    padding: 0 20px 20px 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: 'Vazirmatn-Medium';
    font-size: 15px;
    color: #555;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #DDD;
    border-radius: 10px;
    font-family: 'Vazirmatn-Regular';
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #FF6B1A;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
}

.form-group small {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    line-height: 1.3;
}

.form-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.form-buttons .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-family: 'Vazirmatn-Medium';
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.btn-secondary {
    background: #F8F9FA;
    color: #666;
    border: 1px solid #DDD;
}

.btn-secondary:hover {
    background: #E9ECEF;
    color: #495057;
}

.btn-primary {
    background: #FF6B1A;
    color: white;
}

.btn-primary:hover {
    background: #FF6B1A;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 1700px) {
    .main-container {
        grid-template-columns: 260px 1fr 260px;
        gap: 18px;
        max-width: 1700px;
    }
    
    #design-area {
        height: 700px;
    }
}

@media (max-width: 1500px) {
    .main-container {
        grid-template-columns: 240px 1fr 240px;
        gap: 16px;
        max-width: 1500px;
    }
    
    #design-area {
        height: 650px;
    }
}

@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 220px 1fr 220px;
        gap: 14px;
        max-width: 1200px;
    }
    
    #design-area {
        height: 600px;
    }
}

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 16px;
        max-width: 100%;
    }
    
    .left-column,
    .right-column {
        grid-column: 1;
    }
    
    .center-column {
        grid-row: 2;
    }
    
    .right-column {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 16px;
    }
    
    #design-area {
        height: 550px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 0 12px 20px;
    }
    
    .card {
        padding: 16px;
        border-radius: 14px;
        margin-bottom: 14px;
    }
    
    #design-area {
        height: 500px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-btn {
        min-width: auto;
        padding: 14px 18px;
        font-size: 14px;
    }
    
    .size-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .placeholder-buttons {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .main-header h1 {
        font-size: 22px;
        padding: 14px 0;
    }
    
    .main-header {
        margin-bottom: 12px;
    }
    
    .card {
        padding: 14px;
        margin-bottom: 12px;
    }
    
    #design-area {
        height: 450px;
    }
    
    .upload-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .action-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Keyboard Hint */
.keyboard-hint {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.keyboard-hint.show {
    opacity: 1;
}

.keyboard-hint p {
    margin: 0;
    font-family: 'Vazirmatn-Regular';
} 