/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo h1 {
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.8;
}

nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

.login-btn {
    background-color: #3498db;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-left: auto;
}

/* Button Styles */
.btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn.secondary {
    background-color: #7f8c8d;
}

.btn.secondary:hover {
    background-color: #95a5a6;
}

.btn.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Edition Cards */
.edition-card {
    display: flex;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.edition-thumbnail {
    flex: 0 0 40%;
}

.edition-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edition-info {
    flex: 1;
    padding: 1.5rem;
}

.edition-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.edition-info .date {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Edition Grid */
.edition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.edition-item {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.edition-item:hover {
    transform: translateY(-5px);
}

.edition-item .thumbnail {
    height: 180px;
    overflow: hidden;
}

.edition-item .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edition-item h3 {
    font-size: 1.1rem;
    padding: 0.8rem 1rem 0;
}

.edition-item .date {
    color: #7f8c8d;
    font-size: 0.8rem;
    padding: 0 1rem;
    margin: 0.5rem 0;
}

.edition-item .btn {
    margin: 0.5rem 1rem 1rem;
    display: inline-block;
}

.view-all {
    display: block;
    text-align: center;
    margin: 2rem auto;
    width: 200px;
}

/* Reader Styles */
.reader-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin: 2rem auto;
}

.reader-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.reader-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.edition-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.reader-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

#pdf-viewer {
    width: 100%;
    overflow: auto;
    margin: 1rem 0;
    border: 1px solid #eee;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.reader-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

/* Footer Styles */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 2rem;
}

/* Admin Styles */
.admin-header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.5rem;
}

.admin-header nav {
    display: flex;
    gap: 1rem;
}

.admin-header nav a {
    color: white;
    text-decoration: none;
}

.admin-container {
    padding: 2rem;
}

.stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex: 1;
    text-align: center;
}

.stat-card h3 {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

table th, table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

table tr:hover {
    background-color: #f9f9f9;
}

table a {
    color: #3498db;
    text-decoration: none;
    margin-right: 0.5rem;
}

table a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .edition-card {
        flex-direction: column;
    }
    
    .edition-thumbnail {
        flex: 0 0 auto;
        height: 200px;
    }
    
    nav {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .login-btn {
        margin-left: 0;
    }
    
    .reader-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .reader-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .reader-actions .btn {
        width: 100%;
        text-align: center;
    }
}