/* Global Styles */
:root {
    --primary-color: #003366;
    --secondary-color: #e74c3c;
    --accent-color: #f39c12;
    --light-color: #f5f5f5;
    --dark-color: #333;
    --text-color: #444;
    --border-radius: 5px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--secondary-color);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #002244;
}

/* Header Styles */
header {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo img {
    height: 50px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

nav ul li a.active {
    color: var(--secondary-color);
}

nav ul li a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s;
}

nav ul li a:hover:after,
nav ul li a.active:after {
    width: 100%;
}

/* Handbook Header */
.handbook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.handbook-header h1 {
    color: var(--primary-color);
    font-size: 2.2rem;
}

.actions {
    display: flex;
    gap: 15px;
}

.download-btn, .view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.download-btn {
    background-color: var(--secondary-color);
    color: white;
}

.download-btn:hover {
    background-color: #c0392b;
}

.view-btn {
    background-color: var(--accent-color);
    color: white;
}

.view-btn:hover {
    background-color: #e67e22;
}

/* PDF Viewer Styles */
.handbook-container {
    margin: 30px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.pdf-viewer {
    width: 100%;
    height: 80vh;
    border: none;
}

/* Book View Styles */
.book-container {
    margin: 30px 0;
    display: none;
}

.book {
    display: flex;
    perspective: 1500px;
    margin-bottom: 30px;
}

.page {
    flex: 1;
    padding: 30px;
    background-color: white;
    box-shadow: var(--box-shadow);
    position: relative;
    overflow-y: auto;
    height: 70vh;
}

.left-page {
    border-radius: 5px 0 0 5px;
    border-right: 1px solid #eee;
}

.right-page {
    border-radius: 0 5px 5px 0;
}

.page-content {
    height: 100%;
    overflow-y: auto;
    padding: 15px;
}

.page-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.page-content h3 {
    color: var(--secondary-color);
    margin: 15px 0;
}

.toc {
    list-style: none;
}

.toc li {
    margin-bottom: 10px;
}

.toc a {
    display: block;
    padding: 8px 10px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
}

.toc a:hover {
    background-color: #f0f0f0;
}

.handbook-cover {
    margin-top: 30px;
    text-align: center;
}

.handbook-cover img {
    max-width: 80%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.page-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.page-btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s;
}

.page-btn:hover {
    background-color: #002244;
}

#page-indicator {
    font-weight: 500;
    color: var(--dark-color);
}

/* Footer Styles */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-section p, .footer-section a {
    color: #ccc;
    margin-bottom: 10px;
    display: block;
}

.footer-section a:hover {
    color: white;
}

.footer-section i {
    margin-right: 10px;
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    font-size: 0.9rem;
    color: #aaa;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
    }
    
    nav ul {
        margin-top: 15px;
    }
    
    nav ul li {
        margin: 0 10px;
    }
    
    .handbook-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .actions {
        width: 100%;
        flex-direction: column;
    }
    
    .book {
        flex-direction: column;
    }
    
    .page {
        height: auto;
        min-height: 50vh;
    }
    
    .left-page {
        border-radius: 5px 5px 0 0;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .right-page {
        border-radius: 0 0 5px 5px;
    }
}