:root {
    --primary-color: #007BFF;
    --secondary-color: #6c757d;
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --success-color: #28a745;
    --error-color: #dc3545;
    --font-family: 'Arial', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* h1 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-color);
} */

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--secondary-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    outline: none;
}


.feedback {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    display: none;
}

.feedback.success {
    color: var(--success-color);
}

.feedback.error {
    color: var(--error-color);
}

.body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    font-family: 'Arial', sans-serif;
    color: #fff;
}

.containerLogin {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    align-items: center;
}

/* .form-wrapper h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.form-wrapper p {
    margin-bottom: 20px;
} */

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    text-align: left;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    height: 45px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
}

.btn-submit {
    width: 100%;
    padding: 10px 20px;
    background: #ff5555;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-submit:hover {
    background: #587463;
}

.error-message {
    background: #ff5555;
    color: #fff;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 0.9em;
}


/* h1 {
    text-align: center;
    color: #444;
} */

.header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f1f1f1;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-buttons a {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    color: #fff;
    background-color: #007bff;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.header-buttons a:hover {
    background-color: #0056b3;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* was 160px */
    gap: 15px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.file-card {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 12px; /* slightly more padding */
    min-height: 320px;
}

.file-cover img {
    width: 100%;
    height: 160px; /* slightly taller */
    object-fit: cover;
    border-radius: 4px;
}

.file-details {
    padding: 10px 0;
    width: 100%;
}

.file-details h4 {
    font-size: 14px;
    margin: 6px 0 4px; /* Reduced bottom margin */
    color: #333;
    line-height: 1.2;
    height: auto; /* Let it grow naturally */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.file-type {
    font-size: 12px;
    color: #666;
    margin: 2px 0; /* Reduced margin to tighten spacing */
}


.file-actions {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    flex-wrap: nowrap; /* force single row */
}

.file-actions a {
    flex: 1 1 auto;
    font-size: 11px;
    padding: 6px 6px;
    border-radius: 4px;
    text-decoration: none;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.btn-view {
    background-color: #007bff;
}
.btn-view:hover {
    background-color: #0056b3;
}

.btn-update {
    background-color: #28a745;
}
.btn-update:hover {
    background-color: #1e7e34;
}

.btn-delete {
    background-color: #dc3545;
}
.btn-delete:hover {
    background-color: #c82333;
}


.btn-cancel {
    padding: 8px 12px;
    background-color: gray; /* Bootstrap Danger color */
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    text-decoration: none;
    border-width: 0;
}

.btn-cancel:hover {
    background-color: #c82333;
}


.audio-preview audio {
    width: 100%;
}

:root {
    --primary-color: #007BFF;
    --secondary-color: #6c757d;
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --success-color: #28a745;
    --error-color: #dc3545;
    --font-family: 'Arial', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.Uploadbody {
    /* font-family: var(--font-family); */
    background-color: var(--bg-color);
    color: var(--text-color);
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.containerUpload {
    display: flex;
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 600px;
    padding: 40px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* h1 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-color);
} */

p {
    text-align: center;
    margin-bottom: 20px;
    /* color: var(--secondary-color); */
}

.form-wrapper {
    width: 100%;
    align-self: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--secondary-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    outline: none;
}



.feedback {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    display: none;
}

.feedback.success {
    color: var(--success-color);
}

.feedback.error {
    color: var(--error-color);
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #ff6b6b;
    color: #fff;
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    justify-content: space-between;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.app-logo {
    /* width: 50px; */
    height: 50px;
}

.app-name {
    font-size: 20px;
    font-weight: bold;
}

.sidebar .anchor {
    padding: 15px 30px;
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s, transform 0.3s;
    font-weight: bold;
}

.sidebar .anchorSelected {
    padding: 15px 30px;
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s, transform 0.3s;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    /* Add default selected background */
    transform: translateX(10px);
    /* Keep the shifted position */
}

.sidebar .anchor:hover,
.sidebar .anchorSelected:hover {
    background: rgba(255, 255, 255, 0.4);
    /* Change background on hover */
    transform: translateX(15px);
    /* Slightly more shift on hover */
}


/* Main Content */
/* .main-content {
    flex: 1;
    padding: 20px;
    width: calc(100% - 250px);
    margin-left: 250px; 
    display: flex;
    flex-direction: column;
    align-items: center; 
} */

.header {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 50px;
}

.card {
    background: #587463;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    color: #fff;
    font-weight: bold;
}

.card:hover {
    transform: translateY(-15px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.cardText{
    color: #fff;
}

.logout {
    background: #fff;
    color: #ff6b6b;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    margin: 20px auto;
    width: 70%;
    font-size: 16px;
    text-decoration: none;
    text-align: center;
}

.logout:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.cards {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: none;
}

.card-title {
    font-weight: bold;
}

.table-container {
    overflow-x: auto;
}

table {
    margin-top: 20px;
}

.analytics-section {
    margin-bottom: 30px;
}

.audiobook-section {
    margin-top: 15px;
}

.audiobook-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    width: 100%;
}

.audiobook-card audio.custom-audio {
    flex: 1 1 300px;
    max-width: 300px;
}

.audiobook-details {
    flex: 1 1 calc(100% - 320px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 15px;
}


.audio-title {
    font-weight: bold;
    margin: 0;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #0066cc;
    text-decoration: none;
}

.btn-delete1 {
    background: none;
    border: none;
    color: red;
    font-size: 1.3rem;
    cursor: pointer;
    margin-left: 10px;
}

.btn-delete1:hover {
    color: darkred;
}
.btn-download i {
    margin-right: 5px;
}

.btn-download:hover {
    background: #e68900;
}

.container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    padding: 20px;
    width: calc(100% - 250px);
    margin-left: 250px; 
    align-items: center;
    justify-content: flex-start; 
    text-align: center;
}


/* Center the Library title */
h1 {
    text-align: center;
    font-size: 2rem;
    color: #333;
    margin-bottom: 20px;
}

/* Style the search bar */
.search-form {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    align-items: center;
}

.search-form input {
    width: 500px;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 20px;
    outline: none;
    font-size: 1rem;
}

.search-form button {
    padding: 10px 20px;
    margin-left: 10px;
    border: none;
    background: #007bff;
    color: white;
    font-size: 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form button:hover {
    background: #0056b3;
}

/* Center the pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding-bottom: 50px;
}

.pagination a {
    padding: 8px 15px;
    margin: 0 5px;
    border: 1px solid #007bff;
    color: #007bff;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.pagination a.active {
    background: #007bff;
    color: white;
    font-weight: bold;
}

.pagination a:hover {
    background: #0056b3;
    color: white;
}

.pagination a.disabled {
    pointer-events: none;
    opacity: 0.5;
    border-color: #ccc;
    color: #000000;
}


/* Modal styles */
/* Modal Container */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4); /* Black with opacity */
    transition: opacity 0.3s ease-in-out;
}

/* Modal Content */
.modal-content {
    background-color: #ffffff;
    margin: 15% auto;
    padding: 30px;
    border-radius: 8px; /* Rounded corners */
    width: 100%;
    max-width: 400px; /* Restrict max width */
    box-shadow: 0px 6px 18px rgba(0, 0, 0, 0.2); /* Subtle shadow */
    text-align: center;
}

/* Heading and Paragraph Styles */
h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
}

/* Button Container */
.modal-buttons {
    display: flex;
    justify-content: space-evenly;
    gap: 20px;
}

.modal.fade-in {
    display: block;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}



















.ebook-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px 20px;
    background-color: #f9f9f9;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    margin-top: 10px;
}

.ebook-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ebook-title {
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
    color: #333;
}

.ebook-actions {
    display: flex;
    gap: 10px;
}

.btn-download,
.btn-preview,
.btn-delete2 {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-download:hover {
    background-color: #e7f3ff;
    border-color: #007bff;
    color: #007bff;
}

.btn-preview:hover {
    background-color: #fff9e7;
    border-color: #ffc107;
    color: #ffc107;
}

.btn-delete2:hover {
    background-color: #ffe7e7;
    border-color: #dc3545;
    color: #dc3545;
}

.section-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #555;
}




.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-content2 {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    position: relative;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 10px #00000050;
}

.close-button2 {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}