/* Reset default browser styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    margin: 0;
    display: flex;
    flex-direction: row;
}

/* Side Menu */
.side-menu {
    width: 250px;
    background-color: #007bff;
    height: 100vh;
    color: white;
    padding-top: 20px;
    position: fixed;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

.side-menu ul {
    list-style: none;
    padding: 0;
}

.side-menu ul li {
    padding: 15px;
    text-align: left;
}

.side-menu ul li a {
    color: white;
    text-decoration: none;
    font-size: 18px;
}

.side-menu ul li:hover {
    background-color: #0056b3;
    cursor: pointer;
}

.side-menu .dropdown {
    display: none;
    background-color: #0056b3;
}

.side-menu ul li:hover .dropdown {
    display: block;
}

.side-menu .dropdown li {
    padding-left: 30px;
}

/* Main Content Area */
.main-content {
    margin-left: 250px;
    padding: 20px;
    width: 100%;
    transition: margin-left 0.3s;
}

/* Book Shelf Container */
.book-shelf {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Book Item */
.book-item {
    background-color: white;
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
    max-width: 250px;
    width: 100%;
    box-sizing: border-box;
}

.book-item:hover {
    transform: scale(1.05);
}

/* Book Cover */
.book-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.414; /* A4 aspect ratio */
    object-fit: cover;
    border-radius: 5px;
}

/* Book Name */
.book-name {
    font-size: 1.2em;
    margin: 10px 0;
    font-weight: bold;
}

/* Book Price */
.book-price {
    font-size: 1.1em;
    color: #2e8b57;
    margin-bottom: 10px;
}

/* Add to Cart Button */
.add-to-cart-btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.add-to-cart-btn:hover {
    background-color: #0056b3;
}

/* Cart Section */
#cart {
    margin-top: 20%;
    display: none;
    padding: 20px;
    background-color: #fff;
    border-top: 1px solid #ddd;
}

#cartItems {
    margin-bottom: 20%;
}
#cart {
    width: 250px;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 20px;
    right: 20px;
    border-radius: 8px;
    z-index: 1000;
}

#cartItems {
    margin-bottom: 20px;
}

#cartItems .cart-item {
    margin: 5px 0;
}

#totalPrice {
    font-weight: bold;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Sidebar */
    .side-menu {
        width: 200px;
        padding-top: 10vh;
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }

    .side-menu ul li a {
        font-size: 16px;
    }

    /* Dropdown in sidebar */
    .side-menu .dropdown {
        background-color: #007bff;
    }

    .side-menu ul li:hover .dropdown {
        display: block;
    }

    /* Book Shelf */
    .book-shelf {
        gap: 15px;
        padding: 30px;
    }

    /* Book Item */
    .book-item {
        max-width: 200px;
    }

    /* Cart */
    #cart {
        width: 200px;
        top: 15px;
        right: 15px;
    }
}

/* Header styling */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #007bff; /* Blue background */
    color: white; /* White text */
    padding: 15px 20px; /* Add some padding for spacing */
    font-size: 1.5em; /* Adjust font size */
    font-weight: bold; /* Make the text bold */
    text-align: center; /* Center the text horizontally */
    z-index: 1000; /* Ensure it appears above other content */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Add shadow for better visibility */
}

/* Ensure content starts below the header */
.main-content {
    margin-top: 70px; /* Adjust this value to match the height of the header */
}

.site-header .logo {
    font-size: 1.5em;
    font-weight: bold;
}

.header-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.header-nav ul li {
    margin: 0 15px;
}

.header-nav ul li a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: color 0.3s;
}

.header-nav ul li a:hover {
    color: #ffdd57;
}

/* Ensure content starts below header */
.main-content {
    margin-top: 60px; /* Adjust this height to match the header's height */
}

/* Ensure content starts below header */
.main-content {
    margin-top: 70px; /* Adjust this value to match the height of the header */
}

#closebut {
    font-size: 25px;
    border-width: 5px;
    border-color: #333;
}

#sidemenubut {
    margin-left: -300px;
    display: flexbox;
}

.sidemenubut {
    width: 20px;
    height: 4px;
    background-color: rgb(255, 255, 255);
    margin: 6px 0;
}

#mainmenubut {
    display: flexbox;
    width: 5%;
    height: 30px;
}

#mainmenubut:hover {
    cursor: pointer;
    background-color: #ddd;
}

.sidemenubut:hover {
    cursor: pointer;
}

.announcement {
    margin: 30px;
    margin-left: 200px;
    font-family: 'Times New Roman', Times, serif;
    font-weight: 800;
    font-size: 32px;
}





/* Mobile Sidebar Toggle */
@media (max-width: 768px) {
    .side-menu {
        /* This part is only for mobile devices */
        display: none;
    }

    .announcement {
        margin: 30px;
        margin-left: 20px;
        font-family: 'Times New Roman', Times, serif;
        font-weight: 800;
        font-size: 24px;
    }
    
    .site-header {
        font-size: 16px;
    }

}




/* Promo Code Section */
.promo-code-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 15px;
    padding: 5px;
    border: none; /* Remove border */
    width: 100%;
    max-width: 250px; /* Smaller width */
}

.promo-code-section input {
    padding: 6px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 8px;
    width: 100%; /* Adjust to fit container */
}

.promo-code-section input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 3px rgba(0, 123, 255, 0.4);
}

.promo-code-section button {
    padding: 5px 10px; /* Smaller button */
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.promo-code-section button:hover {
    background-color: #0056b3;
}

#discountDisplay {
    font-size: 14px;
    margin-top: 5px;
    font-weight: bold;
}



/* New Year Design - Right Side Image */
.new-year-design {
    position: fixed; /* Keeps the image fixed as you scroll */
    right: 0; /* Align to the right edge */
    top: 0; /* Start at the top */
    width: 20%; /* Default width for larger screens */
    height: 100%; /* Stretch vertically */
    z-index: -1; /* Place behind other content */
    display: flex; /* Ensure image fits well */
    justify-content: center; /* Center image horizontally */
    align-items: center; /* Center image vertically */
}

.new-year-design img {
    width: 100%; /* Fill container width */
    height: auto; /* Maintain aspect ratio */
    max-height: 100%; /* Prevent stretching beyond container */
    object-fit: contain; /* Ensure the whole image is visible */
}

/* Responsive Design for Smaller Screens */
@media (max-width: 768px) {
    .new-year-design {
        width: 40%; /* Increase width to 40% for better visibility on small screens */
    }
}

@media (max-width: 480px) {
    .new-year-design {
        width: 50%; /* Increase width further to 50% for very small devices */
    }
}

@media (max-width: 768px) {
    .promo-code-section {
        max-width: 100%; /* Allow it to span the full container width */
    }
}








/* New Year Particles Canvas */
#newYearParticles {
    position: fixed;
    top: 0; /* Start from the top */
    left: 0; /* Start from the left edge */
    width: 100%; /* Full width */
    height: 100%; /* Full page height */
    pointer-events: none; /* Allows interaction with content above */
    z-index: -1; /* Place behind other elements */
}


/* Search Container */
.search-container {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.search-container input {
    padding: 8px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 200px;
    transition: width 0.3s ease;
}

.search-container input:focus {
    width: 300px; /* Expand when focused */
    outline: none;
    border-color: #007bff;
}


@media (max-width: 768px) {
    .search-container {
        position: absolute;
        right: -15%;
        top: 70%;
        transform: translateY(-50%);
    }
    
    .search-container input {
        padding: 8px 15px;
        font-size: 16px;
        border: 1px solid #ddd;
        border-radius: 5px;
        width: 40%;
        transition: width 0.3s ease;
    }
    
    .search-container input:focus {
        width: 300px; /* Expand when focused */
        outline: none;
        border-color: #007bff;
    }
    
    #headertext {
        margin-right: 25%;
    }
    
}

/* Modal background */
.modal {
  display: none; 
  position: fixed; 
  z-index: 2000; 
  padding-top: 60px; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.9); 
}

/* Modal Image */
.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}

/* Close button */
.modal .close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}
