/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --background: #ffffff;
    --background-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background-color: var(--background);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
header {
    background: var(--background);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--primary-color);
    cursor: pointer;
}

.logo-image {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    outline: none;
    width: 250px;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: var(--primary-color);
    width: 300px;
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-greeting {
    color: var(--text-dark);
    font-size: 0.95rem;
    white-space: nowrap;
}

.user-greeting strong {
    color: var(--primary-color);
}

.login-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.logout-btn {
    background: var(--text-light);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.settings-btn {
    background: #9C27B0;
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.settings-btn:hover {
    background: #7B1FA2;
    transform: scale(1.05);
}

.admin-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.admin-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.my-ebooks-btn {
    position: relative;
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.my-ebooks-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

.my-ebooks-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--warning-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.cart-btn {
    position: relative;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.cart-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5rem 0;
    margin-bottom: 4rem;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image i {
    font-size: 15rem;
    opacity: 0.2;
}

/* ===== Section Title ===== */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* ===== Categories Section ===== */
.categories {
    padding: 4rem 0;
    background: var(--background-light);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.category-card p {
    color: var(--text-light);
}

/* ===== Products Section ===== */
.products {
    padding: 4rem 0;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.7rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: var(--text-dark);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-image {
    transition: transform 0.3s ease;
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--success-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
}

.product-badge.bestseller {
    background: var(--warning-color);
}

.product-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.product-image i {
    font-size: 5rem;
    opacity: 0.3;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    object-position: center 15%;
    background-color: #f8f9fa;
}

.product-info {
    padding: 1.5rem;
}

.product-category {
    display: inline-block;
    background: var(--background-light);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.product-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--text-dark);
    min-height: 60px;
}

.product-info p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 60px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.product-rating i {
    color: var(--warning-color);
    font-size: 0.9rem;
}

.product-rating span {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-add-cart {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-add-cart:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ===== About Section ===== */
.about {
    padding: 4rem 0;
    background: var(--background-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-dark);
    font-weight: 500;
}

.feature i {
    color: var(--success-color);
    font-size: 1.2rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat h3 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== Footer ===== */
footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section p {
    color: #9ca3af;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    font-weight: 500;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.social-links a i {
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.7rem;
}

.footer-section ul li a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-section ul li i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
}

/* ===== Modal (Cart) ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-large {
    max-width: 900px;
}

.modal-auth {
    max-width: 450px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.cart-item-image {
    flex-shrink: 0;
}

.cart-item-image img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    color: var(--text-dark);
    margin-bottom: 0.3rem;
}

.cart-item-info span {
    color: var(--text-light);
    font-size: 0.9rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.cart-item-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.remove-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.remove-btn:hover {
    transform: scale(1.1);
    background: #be185d;
}

.empty-cart {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-cart i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cart-total span:last-child {
    color: var(--primary-color);
}

.btn-checkout {
    width: 100%;
    background: var(--success-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-checkout:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* ===== My Ebooks Items ===== */
.my-ebook-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s;
    gap: 1.5rem;
}

.my-ebook-item:hover {
    background: var(--background-light);
}

.my-ebook-item:last-child {
    border-bottom: none;
}

.my-ebook-cover {
    width: 80px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.my-ebook-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-ebook-info {
    flex: 1;
}

.my-ebook-info h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.my-ebook-info .ebook-category {
    display: inline-block;
    background: var(--background-light);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.my-ebook-info .purchase-date {
    color: var(--text-light);
    font-size: 0.85rem;
}

.my-ebook-actions {
    display: flex;
    gap: 0.8rem;
}

.btn-download,
.btn-view {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-download:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-view {
    background: var(--success-color);
}

.btn-view:hover {
    background: #059669;
    transform: translateY(-2px);
}

.empty-ebooks {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-light);
}

.empty-ebooks i {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
    color: var(--primary-color);
}

.empty-ebooks h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.empty-ebooks p {
    margin-bottom: 2rem;
}

.btn-browse {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-browse:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ===== Ebook Details Modal ===== */
.ebook-details-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    padding: 1rem;
}

.ebook-details-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.ebook-details-image i {
    font-size: 8rem;
    opacity: 0.3;
}

.ebook-details-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ebook-details-badge.bestseller {
    background: var(--warning-color);
}

.ebook-details-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ebook-details-category {
    display: inline-block;
    background: var(--background-light);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    width: fit-content;
}

.ebook-details-title {
    font-size: 2rem;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.2;
}

.ebook-details-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ebook-details-rating .stars {
    display: flex;
    gap: 0.3rem;
}

.ebook-details-rating i {
    color: var(--warning-color);
    font-size: 1.1rem;
}

.ebook-details-rating span {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-left: 0.5rem;
}

.ebook-details-description {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1rem;
}

.ebook-details-description h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.ebook-details-highlights {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.ebook-highlight {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-dark);
}

.ebook-highlight i {
    color: var(--success-color);
    font-size: 1.1rem;
}

.ebook-details-price-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: var(--background-light);
    border-radius: 15px;
    margin-top: auto;
}

.ebook-details-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-add-to-cart-large {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.btn-add-to-cart-large:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ===== Auth Forms ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary-color);
}

.form-group input {
    padding: 0.9rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-auth {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.btn-auth:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.auth-switch {
    text-align: center;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-switch a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== Responsive Design ===== */

/* Tablet (iPad) - 1024px */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .container {
        padding: 0 2rem;
    }
}

/* Large Tablet / Small Desktop - 992px */
@media (max-width: 992px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image {
        display: none;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile / Tablet - 768px */
@media (max-width: 768px) {
    /* Container */
    .container {
        padding: 0 1.5rem;
    }

    /* Header mobile */
    header {
        padding: 0.75rem 0;
    }

    header .container {
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: space-between;
    }

    .logo-image {
        height: 50px;
    }

    .logo h1 {
        font-size: 1.3rem;
    }

    .logo {
        order: 0;
    }

    .header-actions {
        order: 1;
        margin-left: auto;
    }

    nav {
        width: 100%;
        order: 2;
    }

    .nav-links {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        padding: 0.5rem 0;
    }

    .nav-links a {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .user-actions {
        gap: 1rem;
    }

    .login-btn {
        padding: 0.7rem 1.3rem;
        font-size: 0.95rem;
    }

    .cart-btn, .my-ebooks-btn, .settings-btn, .logout-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .cart-count, .my-ebooks-count {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
        top: -8px;
        right: -8px;
    }

    /* Hero */
    .hero {
        padding: 4rem 0;
    }

    .hero-content h2 {
        font-size: 2.2rem;
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    /* Sections */
    section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }

    .user-greeting {
        display: none;
    }

    .search-box {
        display: none;
    }

    /* Categories */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .category-card {
        padding: 1.5rem;
    }

    .category-card i {
        font-size: 2.5rem;
    }

    /* Products */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .product-card {
        max-width: 100%;
    }

    .filter-buttons {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* About */
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    /* Modals */
    .modal-content {
        max-width: 95%;
        max-height: 90vh;
        margin: 2rem auto;
    }

    .my-ebook-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem;
    }

    .my-ebook-cover {
        width: 100%;
        max-width: 200px;
        height: auto;
        margin: 0 auto;
    }

    .my-ebook-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-download,
    .btn-view {
        width: 100%;
        justify-content: center;
        padding: 0.9rem;
        font-size: 1rem;
    }

    /* Ebook Details */
    .ebook-details-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .ebook-details-image {
        height: 300px;
    }

    .ebook-details-price-section {
        flex-direction: column;
        gap: 1.5rem;
    }

    .btn-add-to-cart-large {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        font-size: 1.1rem;
    }

    /* Cart */
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .cart-item-image {
        width: 100%;
        max-width: 150px;
    }
}

/* Small Mobile - 480px */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 1rem;
    }

    /* Header */
    .logo h1 {
        font-size: 1.1rem;
    }

    .logo-image {
        height: 45px;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .cart-btn, .my-ebooks-btn, .settings-btn, .logout-btn {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    /* Hero */
    .hero {
        padding: 2.5rem 0;
    }

    .hero-content h2 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    /* Sections */
    section {
        padding: 2.5rem 0;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    /* Categories */
    .category-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .category-card {
        padding: 1.25rem;
    }

    .category-card i {
        font-size: 2.25rem;
    }

    .category-card h3 {
        font-size: 1.1rem;
    }

    /* Products */
    .filter-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .product-card {
        padding: 1rem;
    }

    .product-info h3 {
        font-size: 1.1rem;
    }

    .price {
        font-size: 1.5rem;
    }

    .btn-add-cart {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    /* About Stats */
    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Modals */
    .modal-content {
        max-width: 98%;
        margin: 1rem auto;
        padding: 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    /* My Ebooks */
    .my-ebook-cover {
        max-width: 180px;
    }

    .my-ebook-info h4 {
        font-size: 1rem;
    }

    .btn-download {
        font-size: 0.95rem;
        padding: 0.8rem;
    }

    /* Ebook Details */
    .ebook-details-image {
        height: 250px;
    }

    .ebook-details-content h2 {
        font-size: 1.5rem;
    }

    .price-current {
        font-size: 2rem;
    }

    /* Footer */
    .footer-content {
        gap: 1.5rem;
    }

    .footer-section h3 {
        font-size: 1.2rem;
    }

    .footer-section p,
    .footer-section ul li {
        font-size: 0.9rem;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.product-card {
    animation: fadeIn 0.5s ease-out;
}

/* ===== Hidden Class for Filtering ===== */
.product-card.hidden {
    display: none;
}
