body {
    font-family: Arial, sans-serif;
    direction: rtl;
    background-color: #f4f4f4;
    margin: 0;
    display: flex;
    justify-content: center;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 16px;
    min-height: 100vh;
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 700px;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

body.dark-mode {
    background-color: #222;
    color: #eee;
}

body.dark-mode .container {
    background-color: #333;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

h1,
h2 {
    text-align: center;
    color: #2c3e50;
    transition: color 0.3s ease;
}

body.dark-mode h1,
body.dark-mode h2 {
    color: #eee;
}

textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 2px solid #ddd;
    box-sizing: border-box;
    resize: vertical;
    font-size: 16px;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body.dark-mode textarea {
    background-color: #444;
    border-color: #666;
    color: #eee;
}

body.dark-mode input[type="file"] {
    background-color: #444;
    border-color: #666;
    color: #eee;
}

body.dark-mode #savedTextInfo div,
body.dark-mode textarea,
body.dark-mode input[type="file"] {
    color: #eee;
}

#savedTextInfo div {
    border: none;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
}

body.dark-mode #savedTextInfo div {
    background-color: #333;
}

button {
    background-color: #3498db;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 16px;
}

button:hover {
    background-color: #2980b9;
    transform: scale(1.08);
}

#savedInfo {
    margin-top: 30px;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    background-color: #f9f9f9;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#savedInfo img,
#savedImageInfo div img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

body.dark-mode #savedInfo {
    background-color: #444;
    border-color: #666;
}

#savedImageInfo div img,
#savedVideoInfo div video {
    max-width: 100%;
    height: auto;
}

.navigation {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
}

.navigation button {
    flex: 1;
    margin: 5px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 18px;
    transition: background-color 0.4s ease, color 0.4s ease, transform 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    background-color: #5dade2;
    color: white;
}

.navigation button:hover {
    background-color: #2e86c1;
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

.container > button {
    display: inline-block;
    margin: 5px;
}

#savedFileInfo div,
#savedTextInfo div,
#savedImageInfo div,
#savedVideoInfo div {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 10px;
    background-color: #f0f8ff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

#savedFileInfo div:hover,
#savedTextInfo div:hover,
#savedImageInfo div:hover,
#savedVideoInfo div:hover {
    background-color: #e1f5fe;
}

#savedFileInfo div button,
#savedTextInfo div button,
#savedImageInfo div button,
#savedVideoInfo div button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#savedFileInfo div button:hover,
#savedTextInfo div button:hover,
#savedImageInfo div button:hover,
#savedVideoInfo div button:hover {
    background-color: #388E3C;
    transform: scale(1.05);
}

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

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    width: 80%;
    max-width: 600px;
}

.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 2px solid #ddd;
    box-sizing: border-box;
    resize: vertical;
    font-size: 16px;
}

.modal-buttons {
    display: flex;
    justify-content: space-around;
}

.modal-buttons button {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.saveModal {
    background-color: #4CAF50;
    color: white;
}

.cancelModal {
    background-color: #f44336;
    color: white;
}

input[type="file"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: 2px solid #ddd;
    box-sizing: border-box;
    font-size: 16px;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    background-color: #f9f9f9;
    color: #333;
}

body.dark-mode input[type="file"] {
    background-color: #444;
    border-color: #666;
    color: #eee;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        width: 95%;
        max-width: none;
        padding: 20px;
    }

    button {
        width: 100%;
        margin-bottom: 10px;
    }

    .container > button {
        display: block;
        margin: 10px auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 24px;
    }

    button {
        font-size: 14px;
        padding: 8px 16px;
    }

    textarea,
    input[type="file"] {
        font-size: 14px;
        padding: 10px;
    }
}

/* Adjustments for larger screens */
@media (min-width: 769px) {
    .container {
        max-width: 800px;
    }
}

/* Mobile-specific adjustments */
@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 20px;
    }

    .navigation {
        flex-direction: column;
    }

    .navigation button {
        margin: 5px 0;
        width: 100%;
        padding: 10px;
        font-size: 16px;
    }

    #savedFileInfo div,
    #savedTextInfo div,
    #savedImageInfo div {
        padding: 10px;
        margin-bottom: 15px;
    }

    #savedFileInfo div button,
    #savedTextInfo div button,
    #savedImageInfo div button {
        font-size: 14px;
        padding: 6px 10px;
    }
}
