/* Custom CSS for BookStore E-commerce */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    flex-grow: 1;
}

.navbar-brand img {
    max-height: 40px;
    width: auto;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
}

.navbar-toggler {
    border: none;
    padding: 4px 8px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Ensure hamburger menu stays on the right */
.navbar > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 80px 0;
    margin-bottom: 50px;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-img-top {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.book-card {
    margin-bottom: 30px;
}

.book-card .card-body {
    padding: 20px;
}

.book-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
    height: 50px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.book-author {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.book-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Buttons */
.btn {
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #0056b3);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #0056b3, var(--primary-color));
    transform: translateY(-2px);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Forms */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

/* Cart */
.cart-item {
    border-bottom: 1px solid #e9ecef;
    padding: 20px 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.quantity-input {
    width: 80px;
    text-align: center;
}

.cart-summary {
    background: var(--light-color);
    border-radius: 15px;
    padding: 25px;
    position: sticky;
    top: 20px;
}

/* Order Status */
.order-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-paid {
    background: #d1ecf1;
    color: #0c5460;
}

.status-processing {
    background: #cce5ff;
    color: #004085;
}

.status-shipped {
    background: #d4edda;
    color: #155724;
}

.status-delivered {
    background: #d1ecf1;
    color: #0c5460;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Payment Status */
.payment-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.payment-pending {
    background: #fff3cd;
    color: #856404;
}

.payment-paid {
    background: #d1ecf1;
    color: #0c5460;
}

.payment-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Admin Panel */
.admin-sidebar {
    background: var(--dark-color);
    min-height: calc(100vh - 56px);
    padding: 20px 0;
}

.admin-sidebar .nav-link {
    color: #adb5bd;
    padding: 12px 20px;
    border-radius: 0;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: var(--primary-color);
    color: white;
}

.admin-content {
    padding: 30px;
}

.stats-card {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stats-card p {
    margin: 0;
    opacity: 0.9;
}

/* Tables */
.table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 15px;
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-color: #e9ecef;
}

.table tbody tr:hover {
    background: var(--light-color);
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 30px;
}

.page-link {
    border-radius: 50px;
    margin: 0 5px;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 15px;
}

.page-link:hover,
.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Search and Filters */
.search-filters {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-color);
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 30px;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--secondary-color);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */

/* Tablet and Small Desktop */
@media (max-width: 992px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .navbar-nav .nav-link {
        padding: 8px 12px;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .stats-card {
        margin-bottom: 15px;
    }
    
    .admin-sidebar {
        position: relative;
        min-height: auto;
        margin-bottom: 20px;
    }
    
    .admin-content {
        padding: 20px;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) {
    /* Navigation */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-nav {
        text-align: center;
        margin-top: 10px;
    }
    
    .navbar-nav .nav-item {
        margin: 5px 0;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 40px 0;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 15px;
    }
    
    .hero-section p {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    /* Cards */
    .card {
        margin-bottom: 20px;
    }
    
    .card-img-top {
        height: 200px;
    }
    
    .book-card .card-body {
        padding: 15px;
    }
    
    .book-title {
        font-size: 1rem;
        height: auto;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .book-author {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .book-price {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    /* Cart */
    .cart-item {
        padding: 15px 0;
        flex-direction: column;
        text-align: center;
    }
    
    .cart-item-image {
        width: 80px;
        height: 100px;
        margin: 0 auto 10px;
    }
    
    .cart-summary {
        margin-top: 20px;
        padding: 20px;
        position: static;
    }
    
    .quantity-input {
        width: 60px;
        margin: 10px auto;
    }
    
    /* Forms */
    .form-control {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-group .btn {
        width: auto;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .table td, .table th {
        padding: 8px;
        white-space: nowrap;
    }
    
    /* Admin */
    .admin-sidebar {
        min-height: auto;
        padding: 15px 0;
    }
    
    .admin-content {
        padding: 15px;
    }
    
    .stats-card {
        padding: 20px;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
    
    /* Search */
    .search-filters {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .filter-section {
        margin-bottom: 15px;
    }
}

/* Mobile Portrait */
@media (max-width: 576px) {
    /* Base */
    body {
        font-size: 14px;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Navigation */
    .navbar {
        padding: 8px 0;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-toggler {
        padding: 4px 8px;
        font-size: 1rem;
    }
    
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        background: var(--light-color);
        margin-top: 5px;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-section h1 {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    
    .hero-section p {
        font-size: 0.9rem;
    }
    
    /* Cards */
    .row > [class*="col-"] {
        padding-left: 5px;
        padding-right: 5px;
        margin-bottom: 15px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .card-img-top {
        height: 180px;
    }
    
    .book-title {
        font-size: 0.9rem;
        height: auto;
        margin-bottom: 6px;
    }
    
    .book-author {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .book-price {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    /* Buttons */
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        border-radius: 20px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 5px;
    }
    
    /* Forms */
    .form-control {
        padding: 8px 10px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 8px;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .input-group-text {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    /* Cart */
    .cart-item {
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    
    .cart-item-image {
        width: 60px;
        height: 80px;
        margin-bottom: 8px;
    }
    
    .cart-summary {
        padding: 15px;
        margin-top: 15px;
    }
    
    .quantity-input {
        width: 50px;
        padding: 5px;
        text-align: center;
    }
    
    /* Tables */
    .table {
        font-size: 0.8rem;
    }
    
    .table td, .table th {
        padding: 6px 4px;
        vertical-align: middle;
    }
    
    .table-responsive {
        border: none;
    }
    
    /* Pagination */
    .pagination {
        justify-content: center;
        margin-top: 20px;
    }
    
    .page-link {
        padding: 6px 10px;
        font-size: 0.8rem;
        margin: 0 2px;
    }
    
    /* Admin */
    .admin-sidebar {
        padding: 10px 0;
    }
    
    .admin-sidebar .nav-link {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .admin-content {
        padding: 10px;
    }
    
    .stats-card {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .stats-card h3 {
        font-size: 1.5rem;
    }
    
    .stats-card p {
        font-size: 0.85rem;
    }
    
    /* Search and Filters */
    .search-filters {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .filter-section {
        margin-bottom: 10px;
    }
    
    .filter-title {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 15px;
        padding: 8px 0;
    }
    
    /* Alerts */
    .alert {
        padding: 10px 15px;
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    
    /* Footer */
    .footer {
        padding: 30px 0;
    }
    
    .footer h5, .footer h6 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .footer ul li {
        margin-bottom: 5px;
    }
    
    .footer ul li a {
        font-size: 0.85rem;
    }
    
    .payment-methods {
        text-align: center;
        margin-top: 15px;
    }
    
    .payment-logo {
        height: 16px !important;
        margin: 0 3px;
    }
}

/* Extra Small Mobile */
@media (max-width: 375px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .hero-section h1 {
        font-size: 1.4rem;
    }
    
    .card-img-top {
        height: 160px;
    }
    
    .book-title {
        font-size: 0.85rem;
    }
    
    .book-price {
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .stats-card h3 {
        font-size: 1.3rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}

/* Landscape Orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 20px 0;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .hero-section p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .navbar {
        padding: 5px 0;
    }
    
    .card-img-top {
        height: 120px;
    }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-link, .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .form-control, .form-select {
        min-height: 44px;
    }
    
    .card {
        transition: none;
    }
    
    .card:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .admin-sidebar {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}
