/* General Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1000px; /* Adjust as needed */
    text-align: center;
    overflow-x: auto; /* Add horizontal scroll if needed */
}

h2 {
    margin-bottom: 20px;
    color: #333;
}

form {
    display: flex;
    flex-direction: column;
}

input, select, button {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

button {
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
}

button:hover {
    background-color: #218838;
}

p {
    margin-top: 15px;
}

a {
    color: #28a745;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed; /* Ensure table respects width */
}

table, th, td {
    border: 1px solid #ccc;
}

th, td {
    padding: 10px;
    text-align: left;
    word-wrap: break-word; /* Break long words */
}

th {
    background-color: #f8f9fa;
}

/* Toggle Button Styles */
#toggle_state, #toggle_city {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

#toggle_state:hover, #toggle_city:hover {
    background-color: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 15px;
    }

    input, select, button {
        font-size: 14px;
    }

    table {
        font-size: 14px;
    }

    th, td {
        padding: 8px;
    }
}

/* Ultimate Professional Theme */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    padding: 30px 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

/* Close Button Styling */
.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-button:hover {
    background: #ff1a1a;
}

.sidebar h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #fff;
    text-align: center;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin: 20px 0;
}

.sidebar ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.sidebar ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar ul li a i {
    margin-right: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    margin: 20px;
}

.main-content h1 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

/* Form Styling */
.form-section {
    margin-bottom: 30px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.form-section h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #1abc9c;
    padding-bottom: 10px;
}

label {
    display: block;
    font-weight: 600;
    margin: 10px 0 5px;
    color: #555;
}

input[type="text"],
input[type="date"],
input[type="file"] {
    width: 100%;
    padding: 12px;
    margin: 5px 0 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="file"]:focus {
    border-color: #1abc9c;
    box-shadow: 0 0 8px rgba(26, 188, 156, 0.3);
    outline: none;
}

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #1abc9c, #16a085);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

button:hover {
    background: linear-gradient(135deg, #16a085, #1abc9c);
    transform: translateY(-2px);
}

/* Loading Animation */
.loading {
    display: none;
    margin-top: 20px;
    text-align: center;
}

.flipbook-loader {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    position: relative;
    perspective: 800px;
}

.flipbook-loader .page {
    width: 100%;
    height: 100%;
    position: absolute;
    background: #1abc9c;
    border: 2px solid #16a085;
    border-radius: 5px;
    transform-style: preserve-3d;
    animation: flip 2s infinite ease-in-out;
}

@keyframes flip {
    0% { transform: rotate3d(0, 1, 0, 0deg); }
    40% { transform: rotate3d(1, 0, 1, 180deg); }
    60% { transform: rotate3d(0, 1, 1, 180deg); }
    100% { transform: rotate3d(0, 1, 0, 360deg); }
}

/* Success Message */
.success-message {
    margin-top: 20px;
    padding: 20px;
    background: #e8f5e9;
    border-left: 5px solid #4CAF50;
    color: #2e7d32;
    font-size: 16px;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.success-message a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
}

.success-message a:hover {
    text-decoration: underline;
}

/* Table Styling */
.uploaded-books {
    margin-top: 30px;
}

.uploaded-books table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.uploaded-books th,
.uploaded-books td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.uploaded-books th {
    background: linear-gradient(135deg, #1abc9c, #16a085);
    color: #fff;
}

.uploaded-books tr:hover {
    background: #f9f9f9;
}

.uploaded-books td a {
    color: #1abc9c;
    text-decoration: none;
    font-weight: bold;
}

.uploaded-books td a:hover {
    text-decoration: underline;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.qr-code {
    margin: 20px auto;
    padding: 10px;
    background: white;
    max-width: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.qr-code img {
    width: 100%;
    height: auto;
}

.download-qr {
    display: block;
    margin-top: 10px;
    color: #1abc9c;
    text-decoration: none;
    font-weight: bold;
}

.download-qr:hover {
    text-decoration: underline;
}

.modal-buttons {
    margin-top: 20px;
}

.modal-buttons button {
    margin: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.modal-buttons button:hover {
    opacity: 0.9;
}

.modal-buttons .view {
    background: #1abc9c;
    color: #fff;
}

.modal-buttons .share {
    background: #3498db;
    color: #fff;
}

.modal-buttons .edit {
    background: #f1c40f;
    color: #fff;
}

/* New Flipbook Loading Animation */
.flipbook-loader {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    position: relative;
    perspective: 800px;
}

.flipbook-loader .page {
    width: 100%;
    height: 100%;
    position: absolute;
    background: #1abc9c;
    border: 2px solid #16a085;
    border-radius: 5px;
    transform-style: preserve-3d;
    animation: flip 2s infinite ease-in-out;
}

@keyframes flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}
