
/* public/style.css */

:root {
    --primary-red: #e5322d;
    --dark-red: #c1211d;
    --border-color: #e0e0e0;
    --text-color-light: #5f6368;
    --text-color-dark: #202124;
    --background-lite-white: #f8f9fa;
    --white: #ffffff;
    --dark-blue-button: #1A237E;
}

/* --- General Styles --- */
body, html { 
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; 
    margin: 0; 
    background-color: var(--background-lite-white); 
    color: var(--text-color-light); 
    font-size: 15px; 
    line-height: 1.6; 
    overflow-x: hidden; 
}
#page-container { 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    width: 100%; 
    position: relative;
    overflow-x: hidden;
}
main { flex-grow: 1; }
.hidden { display: none !important; }

h1 { font-size: 2.0em; color: var(--text-color-dark); font-weight: 700; margin: 0 0 15px 0; line-height: 1.2; }
h2 { font-size: 1.8em; color: var(--text-color-dark); margin-bottom: 25px; }
h3 { font-size: 1.3em; margin-bottom: 10px; color: var(--text-color-dark); }
.faq-item h3 { font-size: 1.1em; }
a { color: var(--primary-red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ... (Keep Navigation, Language Switcher, and Mobile Menu styles the same) ... */
.main-nav { background-color: var(--white); width: 100%; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.nav-container { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 10px 20px; }
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.header-logo-png { height: 30px; }
.logo-text { font-size: 18px; font-weight: 700; color: var(--text-color-dark); }
.desktop-nav-links { display: none; }
@media (min-width: 768px) { .desktop-nav-links { display: flex; gap: 25px; } .desktop-nav-links a { color: var(--text-color-light); font-weight: 500; } .desktop-nav-links a:hover { color: var(--primary-red); text-decoration: none; } }
.nav-right { display: flex; align-items: center; gap: 15px; }
.lang-switcher { position: relative; }
.lang-btn { background-color: var(--white); border: 1px solid var(--border-color); border-radius: 12px; cursor: pointer; padding: 10px 18px; display: flex; align-items: center; gap: 10px; transition: background-color 0.2s, box-shadow 0.2s; font-size: 1.05em; font-weight: 500; color: var(--text-color-dark); }
.lang-btn:hover { background-color: var(--background-lite-white); }
.lang-btn .lang-arrow { width: 24px; height: 24px; fill: var(--text-color-dark); }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; background-color: var(--white); border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.12); border: 1px solid var(--border-color); width: 180px; z-index: 1100; padding: 5px 0; max-height: 40vh; overflow-y: auto; }
.lang-option { display: block; padding: 12px 20px; color: var(--text-color-dark); text-decoration: none; font-size: 1em; }
.lang-option:hover { background-color: #f1f1f1; text-decoration: none; }
.hamburger-btn { flex-direction: column; justify-content: space-around; width: 28px; height: 24px; background: transparent; border: none; cursor: pointer; padding: 0; z-index: 1001; display: flex;}
.hamburger-btn span { width: 100%; height: 3px; background: var(--text-color-dark); border-radius: 10px; transition: all 0.3s; }
@media (min-width: 768px) { .hamburger-btn { display: none; } }
.mobile-menu-overlay { position: fixed; top: 0; right: 0; width: 100%; height: 100%; background-color: var(--white); z-index: 5000; transform: translateX(100%); transition: transform 0.3s ease-in-out; display: flex; flex-direction: column; }
.mobile-menu-overlay.is-active { transform: translateX(0); }
.mobile-menu-header { display: flex; justify-content: flex-end; padding: 10px 20px; }
.close-menu-btn { font-size: 40px; font-weight: 300; color: var(--text-color-light); background: none; border: none; cursor: pointer; }
.mobile-menu-links { display: flex; flex-direction: column; padding: 20px 40px; }
.mobile-menu-links a { color: var(--text-color-dark); font-size: 18px; padding: 15px 0; border-bottom: 1px solid #f0f0f0; }

/* --- Upload Area --- */
#initial-view { padding: 20px; text-align: center; }
#initial-view h1 { font-size: 2.4em; }
@media (max-width: 600px) { #initial-view h1 { font-size: 1.7em; } }
.main-header { padding: 40px 20px 20px 20px; text-align: center; }
.main-header p { font-size: 0.95em; }
@media (max-width: 600px) { .main-header p { font-size: 0.9em; } }
.upload-container-wrapper { padding: 20px; }
.upload-container { border: 2px dashed var(--border-color); border-radius: 16px; padding: 40px; max-width: 700px; margin: auto; text-align: center; }
.upload-container.drag-over { border-color: var(--primary-red); background-color: #fee; }
.select-button-container { position: relative; display: inline-flex; white-space: nowrap; }
.select-button { background-color: var(--dark-blue-button); color: var(--white); border: none; cursor: pointer; padding: 15px 30px; font-size: 1.1em; font-weight: 600; border-radius: 8px 0 0 8px; transition: background-color 0.2s; }
.select-button:hover { background-color: #111954; }
.expand-button { background-color: var(--dark-blue-button); color: var(--white); border: none; border-left: 1px solid rgba(255, 255, 255, 0.3); cursor: pointer; padding: 15px; border-radius: 0 8px 8px 0; transition: background-color 0.2s; display: flex; align-items: center; }
.expand-button:hover { background-color: #111954; }
.chevron-icon { width: 24px; height: 24px; transition: transform 0.3s ease; }
.select-button-container.menu-open .chevron-icon { transform: rotate(180deg); }
.more-options-menu { position: absolute; top: calc(100% + 5px); left: 0; background: var(--white); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 10; overflow: hidden; width: 100%; text-align: left;}
.more-options-menu .option-item { display: block; padding: 12px 20px; color: var(--text-color-dark); }
.more-options-menu .option-item.disabled { color: #aaa; cursor: not-allowed; }
.more-options-menu .option-item:not(.disabled):hover { background-color: #f1f1f1; }
.upload-note { color: var(--text-color-light); margin-top: 20px; }

/* --- Workspace & Sidebar --- */
#workspace { flex-grow: 1; display: flex; flex-wrap: wrap; align-content: flex-start; position: relative; overflow: hidden; }
.file-list-container { flex-grow: 1; overflow-y: auto; padding: 20px 30px 100px 30px; box-sizing: border-box; }
.task-sidebar { width: 320px; background: var(--white); border-left: 1px solid var(--border-color); display: flex; flex-direction: column; z-index: 2; transition: transform 0.3s ease; }
@media (max-width: 992px) { .task-sidebar { position: fixed; top: 0; right: 0; height: 100%; transform: translateX(100%); box-shadow: -5px 0 15px rgba(0,0,0,0.1); } .task-sidebar.active { transform: translateX(0); } }
/* ... (keep settings panel styles the same) ... */

/* --- Sidebar Icons (Visible on Desktop) --- */
.task-sidebar-icons { display: flex; position: absolute; top: 20px; right: 20px; flex-direction: column; gap: 10px; background: var(--white); padding: 10px; border-radius: 8px; box-shadow: -2px 2px 5px rgba(0,0,0,0.1); z-index: 3; }
@media (max-width: 992px) { .task-sidebar-icons { position: fixed; top: 50%; right: 0; transform: translateY(-50%); border-radius: 8px 0 0 8px; } }
.sidebar-icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-color); background-color: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; }
.sidebar-icon-btn svg { width: 24px; height: 24px; color: var(--text-color-dark); }
.file-count { position: absolute; top: -5px; right: -5px; background-color: var(--primary-red); color: white; font-size: 12px; font-weight: bold; min-width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* --- File Thumbnails (NEW & MODIFIED) --- */
.file-list { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.file-item { position: relative; width: 180px; height: 220px; background-color: var(--white); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; flex-direction: column; align-items: center; padding: 10px; box-sizing: border-box; }
.file-item-img-wrapper { width: 100%; height: 150px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; overflow: hidden; position: relative; }
.file-item-info { font-size: 13px; color: var(--text-color-dark); width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
    transition: transform 0.3s ease; 
    /* Prevent image selection and context menu on long-press */
    user-select: none;
    -webkit-user-select: none; 
    touch-action: none;
    -webkit-touch-callout: none;
}
.sortable-ghost { opacity: 0.4; background-color: #e5e5e5; }
.file-item.sortable-drag {
    outline: 2px dotted var(--primary-red);
    outline-offset: 3px;
    opacity: 0.8;
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.file-item-controls-top, .file-item-controls-top-left {
    position: absolute;
    display: flex;
    gap: 8px;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}
.file-item:hover .file-item-controls-top,
.file-item:hover .file-item-controls-top-left,
.file-item.show-controls .file-item-controls-top,
.file-item.show-controls .file-item-controls-top-left {
    opacity: 1;
    pointer-events: auto;
}
.file-item-controls-top { top: 8px; right: 8px; }
.file-item-controls-top-left { top: 8px; left: 8px; }
.control-btn-rotate, .control-btn-top {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 0;
}
.control-btn-rotate:hover, .control-btn-top:hover { background-color: var(--primary-red); }
.control-btn-rotate {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z'/%3E%3C/svg%3E");
    background-size: 20px 20px;
    background-repeat: no-repeat;
    background-position: center;
}
.control-btn-top { font-size: 24px; line-height: 1; }

/* ... (Keep Content Sections, Social Share, AdSense, Footer, and Overlay styles the same) ... */
.content-section { padding: 40px 20px; text-align: center; }
.steps-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.step-item { background: var(--white); padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.step-image { max-width: 100%; height: 150px; object-fit: contain; margin-bottom: 15px; border-radius: 8px; background: #f1f1f1; }
.faq-section { text-align: left; }
.faq-item { background-color: #fff; border-radius: 12px; padding: 20px; margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.social-icons { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.social-icon { width: 50px; height: 50px; border-radius: 50%; background-size: 60%; background-position: center; background-repeat: no-repeat; transition: transform 0.2s; border: none; cursor: pointer; }
.social-icon:hover { transform: scale(1.1); }
.social-icon.twitter { background-color: #000000; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E"); }
.social-icon.facebook { background-color: #1877F2; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9.198 21.5h4v-8.01h3.604l.396-3.98h-4V7.5a1 1 0 0 1 1-1h3v-4h-3a4 4 0 0 0-4 4v2.01h-2v3.98h2v8.01Z'/%3E%3C/svg%3E"); }
.social-icon.telegram { background-color: #2AABEE; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.1l15.97-6.16c.73-.3 1.34.22 1.14.99l-2.28 10.74c-.22.92-1.01 1.15-1.74.72l-4.52-3.32-2.12 2.05c-.24.24-.45.46-.9.46z'/%3E%3C/svg%3E"); }
.social-icon.whatsapp { background-color: #25D366; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12.04 2c-5.46 0-9.91 4.45-9.91 9.91 0 1.75.46 3.38 1.25 4.82l-1.34 4.92 5.05-1.32c1.4.74 2.98 1.18 4.6 1.18h.01c5.46 0 9.91-4.45 9.91-9.91s-4.45-9.91-9.91-9.91zm0 18.16c-1.47 0-2.89-.33-4.18-.95l-.3-.18-3.11.81.83-3.04-.2-.31c-.68-1.05-1.04-2.27-1.04-3.53 0-4.54 3.69-8.23 8.24-8.23 4.54 0 8.23 3.69 8.23 8.23s-3.69 8.23-8.23 8.23zm4.51-6.15c-.25-.12-1.47-.72-1.7-.81-.22-.08-.38-.12-.54.12-.16.25-.64.81-.79.97-.14.16-.29.18-.54.06-.25-.12-1.05-.39-2-1.23-.74-.66-1.23-1.48-1.38-1.73-.14-.25-.02-.38.11-.5.12-.11.25-.29.38-.43.12-.14.16-.25.25-.41.08-.16.04-.3-.02-.43s-.54-1.3-.74-1.78c-.2-.48-.4-.42-.55-.42h-.48c-.16 0-.41.06-.64.3.22.25-.86 1.03-.86 2.5 0 1.47.88 2.89 1 3.1s1.75 2.67 4.23 3.73c.59.25 1.05.4 1.41.51.59.18 1.13.16 1.56.1.48-.07 1.47-.6 1.68-1.18.2-.58.2-1.08.14-1.18-.05-.1-.2-.16-.44-.28z'/%3E%3C/svg%3E"); }
.social-icon.copy-link { background-color: #6c757d; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E"); }
.ad-container { display: flex; justify-content: center; align-items: center; text-align: center; margin: 0 auto 25px auto; width: 100%; max-width: 728px; min-height: 90px; overflow: hidden; padding: 0 15px; box-sizing: border-box; background-color: #f7f7f7; }
.ad-container-workspace { flex-basis: 100%; order: -1; margin: 15px auto 0 auto; min-height: 70px; }
.ad-container .adsbygoogle[data-ad-status="filled"] { background-color: transparent; }
footer { width: 100%; margin-top: auto; background-color: var(--white); border-top: 1px solid var(--border-color); padding: 20px; box-sizing: border-box; text-align: center; }
.footer-container { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-bottom: 15px; }
.copyright-bar { font-size: 0.9em; }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(248, 249, 250, 0.95); display: flex; z-index: 2000; padding: 20px; box-sizing: border-box; }
#progress-overlay { flex-direction: column; justify-content: center; align-items: center; }
.progress-box { text-align: center; width: 100%; max-width: 400px; }
.progress-box p { font-size: 1.2em; color: var(--text-color-dark); font-weight: 500; margin-bottom: 15px; }
.progress-bar-container { width: 100%; background-color: #e0e0e0; border-radius: 5px; height: 10px; overflow: hidden; }
.progress-bar-fill { width: 0%; height: 100%; background-color: var(--primary-red); border-radius: 5px; transition: width 0.1s linear; }
#download-overlay { align-items: flex-start; justify-content: center; padding-top: 10vh; }
.download-container { text-align: center; width: 100%; max-width: 500px; }
.download-title { font-size: 1.8em; margin-bottom: 25px; color: var(--text-color-dark); font-weight: 600; }
.download-box-wrapper { background-color: var(--white); padding: 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); border: 2px solid #000; }
.download-button { text-decoration: none; background-color: var(--dark-red); color: white; border: none; border-radius: 8px; padding: 15px 20px; font-size: 1.2em; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; transition: background-color 0.2s; box-sizing: border-box; }
.download-button:hover { background-color: #a11b17; }
.download-actions { display: flex; flex-direction: column; align-items: center; gap: 15px; margin-top: 25px; }
.back-btn-wrapper { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.action-btn-icon { background: none; border: none; padding: 5px; color: var(--text-color-light); }
.back-btn-text { font-size: 0.8em; color: var(--text-color-light); }
.restart-btn { background-color: var(--dark-blue-button); color: white; border: none; border-radius: 6px; padding: 10px 18px; font-weight: 500; cursor: pointer; transition: background-color 0.2s; font-size: 0.9em; }
.restart-btn:hover { background-color: #111954; }
.content-wrapper { max-width: 800px; margin: 0 auto; background: var(--white); padding: 30px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); text-align: left; }
.error-page-btn { display: inline-block; margin-top: 20px; padding: 12px 25px; background-color: var(--primary-red); color: var(--white); border-radius: 8px; text-decoration: none; font-weight: 600; transition: background-color 0.2s; }
.error-page-btn:hover { background-color: var(--dark-red); text-decoration: none; }