html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

:root {
    /* Modern Vibrant Palette */
    --primary-color: #6C63FF;       /* Electric Indigo */
    --secondary-color: #1C1F2A;     /* Deep Charcoal Navy */
    --accent-color: #2E3655;        /* Subtle Dark Indigo */
    --light-color: #E6E9F5;         /* Soft Lavender Gray */
    --dark-color: #12141C;          /* Near Black */
    --text-color: #F8F9FD;          /* Off-White */
    --text-dark: #B3B8C6;           /* Muted Gray-Blue */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    --transition: all 0.3s ease;

    /* Accent Variants for Hover & Highlights */
    --primary-hover: #7C75FF;       
    --danger-color: #FF5C8D;        
    --success-color: #00C896;       
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background-color: var(--dark-color);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-color);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    background: none;
    border: none;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    height: 80vh;
    display: flex;
    align-items: center;
    text-align: center;
    color: white;
    margin-top: 70px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Tool Sections */
.tool-section {
    padding: 80px 0;
    border-bottom: 1px solid var(--accent-color);
}

.tool-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-container {
    background-color: var(--dark-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.upload-area {
    border: 2px dashed var(--accent-color);
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.upload-area:hover {
    border-color: var(--primary-color);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-area p {
    margin-bottom: 0;
    word-break: break-word;
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.preview-area {
    min-height: 100px;
    border: 1px solid var(--accent-color);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #b01030;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Split Options */
.split-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: var(--accent-color);
    border-radius: 4px;
    flex: 1;
    min-width: 200px;
    box-sizing: border-box;
}

.option input[type="text"],
.option input[type="number"],
.page-selector input,
.insert-options input {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--accent-color);
    background-color: var(--dark-color);
    color: var(--text-color);
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

.page-selector,
.insert-options {
    margin-bottom: 20px;
}

.page-selector label,
.insert-options label {
    display: block;
    margin-bottom: 8px;
}

/* Arrange Pages */
.sortable-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
}

.page-thumbnail {
    width: 100px;
    height: 140px;
    background-color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: move;
    position: relative;
    flex-shrink: 0;
}

.page-thumbnail::after {
    content: attr(data-page-number);
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* Features Section */
.features-section {
    padding: 80px 0;
    background-color: var(--dark-color);
}

.features-section h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature {
    background-color: var(--secondary-color);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    padding: 50px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    word-break: break-word;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--accent-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--dark-color);
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
    background: none;
    border: none;
}

.close-modal:hover {
    color: var(--primary-color);
}

.modal h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.modal-body {
    text-align: center;
}

.preview-area {
    min-height: 100px;
    border: 1px solid var(--accent-color);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    background-color: var(--dark-color);
    overflow: auto;
}

.preview-area ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.preview-area li {
    padding: 8px 0;
    border-bottom: 1px solid var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-area li:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.file-icon {
    color: var(--primary-color);
    flex-shrink: 0;
}

.file-remove {
    color: #ff6b6b;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1rem;
    flex-shrink: 0;
}

.file-remove:hover {
    color: #ff3b3b;
}

.page-thumbnail {
    width: 100px;
    height: 140px;
    background-color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: move;
    position: relative;
    margin: 5px;
}

.page-thumbnail::after {
    content: attr(data-page-number);
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.sortable-ghost {
    opacity: 0.5;
    background: var(--primary-color);
}

/* Compression Options */
.compression-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.compression-options .option {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background-color: var(--accent-color);
    border-radius: 4px;
}

.compression-options select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--accent-color);
    background-color: var(--dark-color);
    color: var(--text-color);
    width: 100%;
}

.compression-options input[type="range"] {
    width: 100%;
    margin: 10px 0;
}

.compression-options input[type="checkbox"] {
    margin-right: 8px;
}

#quality-value {
    font-weight: bold;
    color: var(--primary-color);
    margin-left: 10px;
}

/* Responsive adjustments for compression options */
@media (max-width: 768px) {
    .compression-options .option {
        min-width: 100%;
    }
}

/* أنماط جديدة لتحسين عرض الملفات */
.file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: var(--accent-color);
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: move;
    width: 100%;
    box-sizing: border-box;
}

.file-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.page-count {
    margin-left: auto;
    padding: 2px 8px;
    background-color: var(--primary-color);
    border-radius: 12px;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
    white-space: nowrap;
}

.drag-handle {
    padding: 0 10px;
    cursor: grab;
    color: var(--text-color);
    opacity: 0.5;
    transition: var(--transition);
    flex-shrink: 0;
}

.drag-handle:hover {
    opacity: 1;
}

.file-remove {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
    flex-shrink: 0;
}

.file-remove:hover {
    color: #ff3b3b;
}

.sortable-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.sortable-ghost {
    opacity: 0.5;
    background: var(--primary-color);
}

.page-thumbnail {
    width: 100px;
    height: 140px;
    background-color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: move;
    position: relative;
    margin: 5px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.page-thumbnail:hover {
    transform: scale(1.05);
}

.page-thumbnail::after {
    content: attr(data-page-number);
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.page-thumbnail::before {
    content: "Original: " attr(data-original-page);
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.6rem;
    white-space: nowrap;
    max-width: calc(100% - 10px);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background-color: var(--dark-color);
        flex-direction: column;
        padding: 20px;
        transition: var(--transition);
        z-index: 999;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }

    .nav.active {
        right: 0;
    }

    .nav ul {
        flex-direction: column;
        gap: 15px;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .tool-section {
        padding: 50px 0;
    }

    .upload-area {
        padding: 30px 20px;
    }

    .split-options {
        flex-direction: column;
    }

    .option {
        width: 100%;
    }

    .tool-container {
        padding: 20px;
    }

    .page-thumbnail {
        width: 80px;
        height: 112px;
    }

    .file-name {
        max-width: 180px;
    }
}

@media (max-width: 480px) {
    .logo span {
        font-size: 1.2rem;
    }

    .hero {
        height: 70vh;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .tool-section h2 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .upload-area {
        padding: 20px 15px;
    }

    .file-item {
        flex-wrap: nowrap;
    }

    .file-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    .page-thumbnail {
        width: 70px;
        height: 98px;
    }

    .page-thumbnail::after,
    .page-thumbnail::before {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
}

/* أنماط جديدة لعرض معلومات الملف */
.loading-files {
    text-align: center;
    padding: 20px;
    color: var(--text-color);
}

.error-message {
    color: #ff6b6b;
    text-align: center;
    padding: 20px;
}

.file-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    margin-left: 10px;
}

.file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.8rem;
    color: var(--text-dark);
    margin-top: 3px;
}

.file-remove {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    flex-shrink: 0;
}

.drag-handle {
    padding: 0 10px;
    cursor: grab;
    color: var(--text-color);
    opacity: 0.7;
    transition: var(--transition);
    flex-shrink: 0;
}

.drag-handle:hover {
    opacity: 1;
}

/* Images to PDF Styles */
.sortable-images {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
}

.image-thumbnail {
    position: relative;
    width: 150px;
    height: 200px;
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--dark-color);
    border: 1px solid var(--accent-color);
    cursor: move;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.image-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.image-thumbnail img {
    width: 100%;
    height: calc(100% - 30px);
    object-fit: contain;
    background-color: white;
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.image-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 0.7rem;
}

.image-remove:hover {
    background-color: rgba(255, 0, 0, 0.9);
}

.pdf-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.pdf-options .option {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background-color: var(--accent-color);
    border-radius: 4px;
}

.pdf-options select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--accent-color);
    background-color: var(--dark-color);
    color: var(--text-color);
    width: 100%;
}

/* Responsive adjustments for images */
@media (max-width: 768px) {
    .image-thumbnail {
        width: 120px;
        height: 160px;
    }
}

@media (max-width: 480px) {
    .image-thumbnail {
        width: 100px;
        height: 140px;
    }

    .image-info {
        font-size: 0.7rem;
    }

    .pdf-options .option {
        min-width: 100%;
    }
}
/* Compression Info */
.compression-info {
    background-color: var(--accent-color);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.compression-info i {
    color: var(--primary-color);
    margin-right: 8px;
}

.compression-info p {
    margin: 0;
    font-size: 0.9rem;
}

