/* =====================================================
   ONLINE BOOK STORE - CUSTOMER PORTAL STYLES
   Modern, Clean UI (Amazon/Flipkart inspired)
   ===================================================== */

/* =====================================================
   CSS VARIABLES
   ===================================================== */
:root {
    --primary-color: #2c3e50;
    --primary-dark: #1a252f;
    --accent-color: #e74c3c;
    --accent-hover: #c0392b;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --text-color: #333333;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

/* =====================================================
   BASE STYLES
   ===================================================== */
body.customer-portal {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
    line-height: 1.6;
}

/* =====================================================
   HEADER & NAVIGATION
   ===================================================== */
.customer-header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.customer-navbar {
    padding: 0.75rem 0;
}

.customer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.customer-logo:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.customer-logo i {
    color: var(--accent-color);
    margin-right: 8px;
}

.nav-menu .nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    position: relative;
}

.nav-menu .nav-link:hover,
.nav-menu .nav-link.active {
    color: var(--accent-color);
}

.nav-menu .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: var(--accent-color);
}

/* Search Bar */
.search-bar {
    position: relative;
    max-width: 400px;
}

.search-bar input {
    padding-left: 40px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.search-bar .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Cart Icon */
.cart-icon {
    position: relative;
    color: var(--text-color);
    font-size: 1.25rem;
    padding: 0.5rem;
}

.cart-icon:hover {
    color: var(--accent-color);
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* User Dropdown */
.user-dropdown .dropdown-toggle {
    color: var(--text-color);
    font-weight: 500;
}

.user-dropdown .dropdown-toggle::after {
    margin-left: 0.5rem;
}

.user-dropdown .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius);
    padding: 0.5rem 0;
}

.user-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.user-dropdown .dropdown-item:hover {
    background: var(--bg-light);
    color: var(--accent-color);
}

.user-dropdown .dropdown-item i {
    width: 20px;
    margin-right: 8px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary-custom {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary-custom:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-outline-custom {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-outline-custom:hover {
    background: var(--primary-color);
    color: white;
}

.btn-cart {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-cart:hover {
    background: #219a52;
    border-color: #219a52;
    color: white;
}

/* =====================================================
   HERO SECTION
   ===================================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><polygon fill="rgba(255,255,255,0.05)" points="100,0 100,100 50,100"/></svg>');
    background-size: cover;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-btn {
    background: var(--accent-color);
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 30px;
    transition: var(--transition);
}

.hero-btn:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* =====================================================
   PRODUCT CARDS
   ===================================================== */
.product-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.product-image-wrapper {
    position: relative;
    padding: 20px;
    background: var(--bg-light);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    transition: var(--transition);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
}

.product-badge.out-of-stock {
    background: var(--text-muted);
}

.product-info {
    padding: 15px 20px 20px;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 2.8em;
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-title a:hover {
    color: var(--accent-color);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-original {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.price-discount {
    font-size: 0.8rem;
    color: var(--success-color);
    font-weight: 600;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.product-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* =====================================================
   SECTION STYLES
   ===================================================== */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* =====================================================
   FEATURES SECTION
   ===================================================== */
.feature-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--accent-color), #ff6b6b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.75rem;
    color: white;
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.feature-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =====================================================
   CART PAGE
   ===================================================== */
.cart-item {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.cart-item:hover {
    box-shadow: var(--shadow-sm);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 10px;
}

.cart-item-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.quantity-control button {
    width: 35px;
    height: 35px;
    border: none;
    background: var(--bg-light);
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition);
}

.quantity-control button:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-control input {
    width: 50px;
    height: 35px;
    border: none;
    text-align: center;
    font-weight: 600;
}

.cart-summary {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    border: 1px solid var(--border-color);
}

/* Only make cart-summary sticky on cart page */
.cart-page .cart-summary {
    position: sticky;
    top: 100px;
}

.cart-summary-title {
    font-size: 1.25rem;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.cart-summary-row.total {
    border-top: 2px solid var(--border-color);
    margin-top: 15px;
    padding-top: 15px;
    font-weight: 700;
    font-size: 1.1rem;
}

.free-delivery-badge {
    background: #d4edda;
    color: var(--success-color);
    padding: 8px 15px;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    text-align: center;
    margin: 15px 0;
}

/* =====================================================
   ORDER HISTORY
   ===================================================== */
.order-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    transition: var(--transition);
}

.order-card:hover {
    box-shadow: var(--shadow-sm);
}

.order-header {
    background: var(--bg-light);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.order-id {
    font-weight: 700;
    color: var(--primary-color);
}

.order-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.order-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.order-status.pending { background: #fff3cd; color: #856404; }
.order-status.confirmed { background: #d1ecf1; color: #0c5460; }
.order-status.processing { background: #cce5ff; color: #004085; }
.order-status.shipped { background: #d4edda; color: #155724; }
.order-status.delivered { background: #d4edda; color: #155724; }
.order-status.cancelled { background: #f8d7da; color: #721c24; }

.order-body {
    padding: 20px;
}

.order-items-preview {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.order-item-thumb {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 5px;
}

.order-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* =====================================================
   AUTH MODAL
   ===================================================== */
.auth-modal .modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.auth-modal .modal-header {
    border: none;
    padding: 20px 25px 0;
}

.auth-modal .modal-body {
    padding: 25px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.auth-tab.active {
    color: var(--accent-color);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-color);
}

.auth-form .form-control {
    padding: 12px 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.auth-form .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.auth-form .form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* =====================================================
   FOOTER
   ===================================================== */
.customer-footer {
    background: var(--primary-color);
    color: white;
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-contact {
    color: rgba(255,255,255,0.7);
}

.footer-contact i {
    width: 20px;
    color: var(--accent-color);
    margin-right: 10px;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 40px;
    padding-top: 25px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

/* =====================================================
   BREADCRUMB
   ===================================================== */
.page-breadcrumb {
    background: var(--bg-white);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    margin-bottom: 0;
    background: none;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--accent-color);
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 500;
}

/* =====================================================
   FILTERS SIDEBAR
   ===================================================== */
.filter-sidebar {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.filter-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.filter-group .form-check {
    margin-bottom: 8px;
}

.filter-group .form-check-label {
    color: var(--text-muted);
    cursor: pointer;
}

.price-range-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-range-inputs input {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination-custom .page-link {
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    margin: 0 3px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.pagination-custom .page-link:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.pagination-custom .page-item.active .page-link {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
}

.toast-custom {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--success-color);
    padding: 15px 20px;
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: var(--transition);
}

.toast-custom.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-custom.error {
    border-left-color: var(--accent-color);
}

/* =====================================================
   LOADING SPINNER
   ===================================================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* =====================================================
   RESPONSIVE STYLES
   ===================================================== */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2rem;
    }

    .search-bar {
        margin: 15px 0;
        max-width: 100%;
    }

    .nav-icons {
        display: flex;
        gap: 15px;
        align-items: center;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 50px 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .product-card {
        margin-bottom: 20px;
    }

    .cart-item {
        flex-direction: column;
        text-align: center;
    }

    .cart-item-image {
        margin: 0 auto 15px;
    }

    .cart-summary {
        position: static;
        margin-top: 30px;
    }
}

/* =====================================================
   CONTACT PAGE ICONS
   ===================================================== */
.contact-icon-circle {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--accent-color);
    font-size: 1rem;
    flex-shrink: 0;
}

.social-icon-circle {
    text-decoration: none;
    font-size: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.social-icon-circle:hover {
    opacity: 0.85;
    transform: translateY(-2px);
    color: #fff;
}

/* =====================================================
   PRODUCT IMAGE MAGNIFIER
   ===================================================== */
.product-image-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 450px;
    overflow: hidden;
    background: #fff;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    cursor: zoom-in;
    padding: 10px;
}

.product-image-box > img {
    max-width: 100%;
    max-height: 430px;
    display: block;
    object-fit: contain;
}

/* =====================================================
   PRODUCT REVIEWS
   ===================================================== */

/* Star rating input (modal) */
.review-stars-input {
    display: inline-flex;
    gap: 6px;
}

.review-stars-input i {
    font-size: 1.75rem;
    color: #d4d4d4;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}

.review-stars-input i:hover {
    transform: scale(1.15);
}

.review-stars-input i.active.rating-1 {
    color: #e74c3c;
}

.review-stars-input i.active.rating-2,
.review-stars-input i.active.rating-3 {
    color: #e67e22;
}

.review-stars-input i.active.rating-4 {
    color: #f1c40f;
}

.review-stars-input i.active.rating-5 {
    color: #27ae60;
}

/* "Write a Review" button */
.btn-review {
    background: linear-gradient(135deg, #fff8f0, #fff3e6);
    color: #e67e22;
    border: 1px solid #f5d6b0;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 14px;
    transition: var(--transition);
}

.btn-review:hover {
    background: linear-gradient(135deg, #fff3e6, #ffe8cc);
    color: #d35400;
    border-color: #e6b87a;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.2);
}

/* Review card (displayed on each item) */
.review-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 14px;
}

.review-card p {
    line-height: 1.5;
}

.review-stars-display {
    letter-spacing: 1px;
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */
.text-accent { color: var(--accent-color) !important; }
.text-success { color: var(--success-color) !important; }
.bg-accent { background-color: var(--accent-color) !important; }
.border-accent { border-color: var(--accent-color) !important; }

.hover-shadow:hover {
    box-shadow: var(--shadow-md);
}

.transition-all {
    transition: var(--transition);
}
