body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    direction: rtl;
}
header {
    background-color: #007bff; color: white; padding: 1rem; text-align: center; border-radius: 8px; margin-bottom: 20px; position: relative;
}
#auth-status {
    position: absolute; top: 5px; left: 10px; background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 12px; font-size: 12px;
}
.form-container {
    background: white; padding: 20px; margin-bottom: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.view-book-link {
    text-align: center; margin-bottom: 20px; padding: 15px; background: #e9ecef; border-radius: 8px;
}
.view-book-link a {
    font-size: 18px; font-weight: bold; text-decoration: none; color: #007bff;
}
label { display: block; margin-bottom: 5px; font-weight: bold; }
input, textarea {
    width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box;
}
button {
    background-color: #28a745; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px;
}
button:hover { background-color: #218838; }
hr { margin: 30px 0; border: 0; border-top: 1px solid #ccc; }
#uploadStatus { margin-top: 15px; font-weight: bold; color: #007bff; }

/* ======== STYLÊN لاپەرا پەرتووکێ ======== */
.book-body {
    padding: 0; background-color: #333; overflow: hidden;
}
#book-container {
    position: relative; width: 100vw; height: 100vh; margin: 0; background: #333; display: flex; justify-content: center; align-items: center;
}
#book-view {
    display: flex; align-items: stretch; width: 100%; height: 100%; overflow: hidden; font-size: 0;
}
#book-view img {
    width: 100%; height: 100%; object-fit: cover; /* گۆڕدرا بۆ cover بۆ پڕکردنەوەی شاشە */
    box-sizing: border-box;
    cursor: zoom-in; /* زیادکرا بۆ ئاماژەی زووم */
}

/* بۆ دۆخی ئاسۆیی یان شاشەی پان */
@media (orientation: landscape), (min-width: 768px) {
    #book-view img {
        width: 50%;
    }
}

/* ======== STYLÊN KONTROLÊN SEREVÊ (NUU) ======== */
#top-controls {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: rgba(30, 30, 30, 0.7);
    padding: 8px 15px;
    border-radius: 25px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    user-select: none;
}
#book-container:hover #top-controls {
    opacity: 1;
}

.nav-btn {
    position: static; /* لابرا absolute */
    transform: none; /* لابرا */
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;  /* قەبارە بچووک کرایەوە */
    height: 40px; /* قەبارە بچووک کرایەوە */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px; /* فۆنت بچووک کرایەوە */
    font-weight: bold;
    transition: background-color 0.2s;
}
.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
}
.nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

#search-container {
    position: static; transform: none; background-color: transparent; padding: 0;
}
#search-form { display: flex; align-items: center; }
#search-input {
    border: none; background: transparent; color: white;
    padding: 5px 10px; width: 150px; outline: none; direction: ltr; text-align: center;
}
#search-input::placeholder { color: #ccc; }
#search-input::-webkit-outer-spin-button,
#search-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#search-input[type=number] { -moz-appearance: textfield; }
#search-form button {
    background-color: #007bff; color: white; border: none;
    border-radius: 20px; padding: 5px 15px; cursor: pointer;
    font-size: 14px;
}

/* دوگمەکانی خوارەوە */
.control-btn {
    position: absolute; background-color: rgba(30, 30, 30, 0.5); color: white; border: none; cursor: pointer; z-index: 10; border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; user-select: none; opacity: 0; transition: opacity 0.3s ease-in-out;
}
#book-container:hover .control-btn { opacity: 1; }

#fullscreen-btn {
    bottom: 20px; right: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 2h-2v3h-3v2h5v-5zm-3-4V5h-3v2h3v3z"/></svg>'); background-repeat: no-repeat; background-position: center; background-size: 24px;
}
body:fullscreen #fullscreen-btn {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/></svg>');
}
.loading-text {
    color: white; font-size: 20px; margin: auto;
}

#install-pwa-btn {
    bottom: 20px; left: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 3L1 9l11 6 9-4.91V17h2V9L12 3zm0 8.48L5.53 8.35 12 5l6.47 3.35L12 11.48zM17 15.32V12l-5 2.73L7 12v3.32L12 18l5-2.68z"/></svg>');
    background-repeat: no-repeat; background-position: center; background-size: 24px;
    opacity: 0.7;
}
#book-container:hover #install-pwa-btn { opacity: 1; }

/* ======== STYLÊN PARASTINA DÎMENÊ (SCREENSHOT) ======== */
#screenshot-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: black; color: white; z-index: 9999;
    display: none; justify-content: center; align-items: center; text-align: center; font-size: 24px;
}

/* ======== STYLÊN PARASTINÊ (BERÊ) ======== */
.secure-content {
    -webkit-user-select: none; user-select: none;
}
@media print {
  body.secure-content * { display: none !important; }
}

/* ======== STYLÊN ZOOMKIRINA WÊNEYAN (NUU) ======== */
.zoom-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 10000; cursor: zoom-out;
    -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.zoom-overlay img {
    max-width: 95%; max-height: 95%;
    object-fit: contain; /* لێرە contain بەکاردێت بۆ ئەوەی هەموو وێنەکە لە زوومدا ببینرێت */
    cursor: default;
}