/* --- 1. Global Reset & Variables --- */
:root {
    --br: 3px;
    --bc: #babfc4;
    --card-width: 350px;
    --gap: 20px;
    --primary-color: #f7ece7;
    --accent-color: #007bff;
    --success-color: #27ae60;
    --dark-bg: #2c3e50;
}

* { 
    padding: 0; 
    margin: 0; 
    box-sizing: border-box; 
}

body, html {
    font-family: 'Segoe UI', -apple-system, system-ui, Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    background: #f0f2f5;
}

/* --- 2. Navigation Bar --- */
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0.8rem 1%; 
    background-color: #ffffff; /* Default bright, sticky nav */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-menu { 
    display: flex; 
    list-style: none; 
    gap: 1rem; 
    align-items: center; 
}

.nav-link { 
    color: #000; 
    text-decoration: none; 
    font-size: 0.95rem; 
    font-weight: 500;
    padding: 5px 26px;
    border: 1px solid #00000036;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: #8686864a;
}

.nav-link:hover { 
    background-color: #f0f2f5; 
    border-color: #007bff;
}

.hamburger { 
    display: none; 
    cursor: pointer; 
    border: none; 
    background: none; 
}

.bar { 
    display: block; 
    width: 25px; 
    height: 3px; 
    margin: 5px auto; 
    background-color: #333; 
    transition: 0.5s; 
}

/* --- 3. Hero Banner & Containers --- */
.hero-banner { 
    background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('assets/ReadingRoomPublication.jpeg'); 
    height: 60vh; 
    background-position: center; 
    background-repeat: no-repeat; 
    background-size: cover; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    color: #F7F0FF; 
    width: 100%;
}

.hero-text h2 { 
    font-size: clamp(1.5rem, 5vw, 2.5rem); 
    padding: 0 20px; 
}

.container { 
    width: 95%;
    max-width: 1400px; 
    margin: 20px auto;
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 20px; 
    padding: 20px 0;
}

.smart-box, .feed { 
    width: 95%; 
    max-width: 800px; 
    margin: 20px auto; 
    padding: 20px; 
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- 4. Product/Book Cards --- */
.product-card { 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
}

.book-cover { 
    width: 100%; 
    height: 350px; 
    background: #eee;  
    overflow: hidden; 
}

.book-cover img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    display: block; 
}

.book-details { 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
}

.book-details h1 { margin: 0; color: #222; font-size: 20px; }
.book-details h2 { margin: 5px 0 15px; color: #666; font-size: 15px; font-weight: 400; }

.info-grid { 
    display: grid; 
    grid-template-columns: 100px 1fr; 
    gap: 5px; 
    font-size: 13px; 
    margin-bottom: 15px; 
}

.label { font-weight: bold; color: #777; }
.price-tag { font-size: 20px; color: var(--success-color); font-weight: bold; margin-top: auto; }
.shipping { font-size: 13px; color: #000000;  }

.buy-btn { 
    width: 100%; 
    background: var(--dark-bg); 
    color: white; 
    border: none; 
    padding: 12px; 
    margin-top: 15px; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: 0.3s; 
}
.buy-btn:hover { background: #34495e; }

/* --- 5. Editor & Forms --- */
.editor-container { border: 1px solid var(--bc); border-radius: var(--br); background: #fff; width: 100%; }
.toolbar { display: flex; padding: 8px; border-bottom: 1px solid #e3e6e8; gap: 10px; background: #f1f2f3; }
.btn-group { display: flex; gap: 4px; border-right: 1px solid var(--bc); padding-right: 8px; }
.s-btn { background: none; border: none; padding: 4px 8px; cursor: pointer; border-radius: 3px; color: #525960; }
.s-btn:hover { background: #d6d9dc; }
.editable-area { min-height: 200px; padding: 12px; outline: none; }

textarea, input[type="text"], input[type="email"] { 
    width: 100%; 
    border: 1px solid #ddd; 
    border-radius: 10px;
    padding: 12px; 
}

.btn, .submit-btn { 
    background: #0095ff; 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    border-radius: 20px;
    cursor: pointer; 
    font-weight: bold; 
    margin-top: 10px;
}

/* --- 6. Tables --- */
.table-container { width: 100%; overflow-x: auto; margin: 25px 0; box-shadow: 0 0 20px rgba(0, 0, 0, 0.15); border-radius: 8px;}
.styled-table { border-collapse: collapse; width: 100%; font-size: 1.2em; white-space: nowrap;}
.styled-table thead tr { background-color: #ffffff; color: #ffffff; text-align: left; }
.styled-table th, .styled-table td { padding: 12px 15px; border: 1px solid #dddddd; }
.styled-table tbody tr:nth-of-type(even) { background-color: #f3f3f3; }

/* --- 7. Modals --- */
#paymentModal {
    display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.7); z-index:2000; 
    justify-content:center; align-items:center;
}
.modal-content { background:white; padding:30px; border-radius:10px; width:90%; max-width:400px; text-align:center; }

/* --- 8. Responsive Design --- */
/* --- 8. Responsive Design --- */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%; /* Changed from -50% to fully hide it */
        top: 55px;   /* Adjusted to match navbar height */
        flex-direction: column;
        background-color: #ffffffde; /* Removed transparency for better readability */
        width: 126px; /* Specific width is cleaner than 40% */
        height: 100vh;
        transition: 0.3s;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        
        /* FIXES START HERE */
        padding: 20px;       /* Adds padding inside the menu */
        gap: 0;              /* Removes flex gap to use item margins instead */
        align-items: flex-start; /* Aligns items to the left */
    }

    .nav-menu.active {
        left: 0; 
    }

    .nav-item {
        margin: 5px 0;       /* REDUCED GAP: Vertical space between buttons */
        width: 100%;         /* Allows button to span full width of menu */
    }

    .nav-link {
        display: block;      /* Makes the link fill the width */
        width: 100%;
        text-align: center;    /* ALIGN LEFT: Ensures text stays left */
        padding: 12px 15px;  /* Better touch targets for mobile */
    }

    .hamburger {
        display: block;
        cursor: pointer;
    }
    
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}
