* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0F172A;
    color: #fff;
    direction: rtl;
    padding: 20px;
}

.container {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.preview-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.settings-section {
    width: 350px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    opacity: 0.5;
    pointer-events: none;
}

.settings-section.active {
    opacity: 1;
    pointer-events: all;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.section-title i {
    color: #4CAF50;
}

.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 15px;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 600;
}

.mode-btn.active {
    background: #4CAF50;
}

.reels-preview {
    width: 360px;
    height: 640px;
    background: #000;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 1;
    transition: all 0.3s ease;
}

.video-container.split {
    flex-direction: column;
}

.video-slot {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: all 0.3s ease;
    text-align: center;
}

.video-slot:hover {
    background: rgba(255, 255, 255, 0.1);
}

.video-slot.has-video:hover::before {
    content: 'انقر لتغيير الفيديو';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 2;
}

.video-slot video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 20px;
}

.upload-icon {
    font-size: 40px;
    color: #4CAF50;
}

.upload-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.upload-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 10px;
    display: none;
    z-index: 3;
    text-align: center;
}

.settings-group {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-group-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.audio-option {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.audio-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.audio-option input[type="radio"] {
    display: none;
}

.audio-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    width: 100%;
}

.audio-option .radio-circle {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-option input[type="radio"]:checked + label .radio-circle {
    border-color: #4CAF50;
}

.audio-option input[type="radio"]:checked + label .radio-circle::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #4CAF50;
    border-radius: 50%;
}

.custom-audio-input {
    display: none;
    margin-top: 10px;
    width: 100%;
}

.custom-audio-input.active {
    display: block;
}

.process-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: #4CAF50;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.process-btn:disabled {
    background: rgba(76, 175, 80, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.processing-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.progress-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    position: relative;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-circle circle {
    fill: none;
    stroke-width: 8;
}

.progress-circle .bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.progress-circle .progress {
    stroke: #4CAF50;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
}

.processing-status {
    margin-top: 20px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        align-items: center;
    }

    .settings-section {
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 480px) {
    .reels-preview {
        width: 300px;
        height: 533px;
    }
}

.separator-settings {
    margin-bottom: 20px;
}

.text-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    margin-top: 10px;
}

.text-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.separator-preview {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    text-align: center;
}

.separator-text {
    color: rgba(255, 255, 255, 0.3);
    font-size: 16px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    padding: 20px 5px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    white-space: nowrap;
}

.separator-text.horizontal {
    writing-mode: horizontal-tb;
    padding: 5px 20px;
}

.color-picker {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: white;
}

.preview-separator {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: all 0.3s ease;
}

.preview-separator.vertical {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

.preview-separator.horizontal {
    top: 50%;
    left: 0;
    width: 100%;
    height: 40px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
}

.preview-separator-text {
    color: currentColor;
    font-size: 18px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    transition: all 0.3s ease;
}

.preview-separator.vertical .preview-separator-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.audio-upload-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    display: none;
}

.audio-upload-status.active {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-upload-status i {
    color: #4CAF50;
}

.audio-filename {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.remove-audio {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.remove-audio:hover {
    color: #F44336;
}

.custom-audio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-audio-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.custom-audio-btn i {
    font-size: 20px;
}

.error-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(244, 67, 54, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1100;
    max-width: 400px;
    width: 90%;
    display: none;
    text-align: center;
    backdrop-filter: blur(5px);
}

.error-modal .error-icon {
    font-size: 48px;
    color: white;
    margin-bottom: 15px;
}

.error-modal .error-message {
    color: white;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.error-modal .error-btn {
    background: white;
    color: #F44336;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.error-modal .error-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}