/* =====================================================
   ELECTRAEDGE E-COMMERCE CSS TEMPLATE
   For secure electronics e-commerce platform
   ===================================================== */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* =====================================================
   HEADER & NAVIGATION
   ===================================================== */

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-menu a.active {
  color: #ffd700;
}

.nav-menu a:hover {
    color: #ffd700;
}

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

.cart-icon {
    position: relative;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================
   BUTTONS & FORMS
   ===================================================== */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

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

.btn-danger {
    background: #dc3545;
    color: white;
}

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

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error {
    border-color: #dc3545;
}

.form-input.success {
    border-color: #28a745;
}

.form-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-success {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* =====================================================
   AUTHENTICATION PAGES (Bernice Goo)
   ===================================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.auth-header p {
    color: #666;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    color: #666;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* User Profile Styles */
.profile-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.profile-header {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    margin: 0 auto 1rem;
}

.profile-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.profile-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 2px solid #f1f3f4;
    padding-bottom: 0.5rem;
}

/* =====================================================
   PRODUCT PAGES (Yin Er)
   ===================================================== */

/* Home Page Hero */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

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

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

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.product-image {
    height: 200px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    overflow: hidden;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 1rem;
}

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

.stars {
    color: #ffd700;
}

/* Product Details Page */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
}

.product-detail-image {
    height: 400px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 5rem;
}

.product-detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.product-detail-price {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 1rem;
}

.product-description {
    margin-bottom: 2rem;
    line-height: 1.6;
    color: #666;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quantity-input {
    width: 80px;
    text-align: center;
}

/* Shopping Cart */
.cart-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.cart-item {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 100px 1fr auto auto;
    gap: 1rem;
    align-items: center;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.cart-item-info h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.cart-item-price {
    font-weight: bold;
    color: #667eea;
}

.cart-summary {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-top: 2rem;
}

.cart-total {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 1rem;
}

/* =====================================================
   ORDER & ADMIN PAGES (Bernice Chng)
   ===================================================== */

/* Order Confirmation */
.order-confirmation {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
}

.order-success-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.order-number {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Order History */
.order-history {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.order-item {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f3f4;
}

.order-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #d4edda;
    color: #155724;
}

.status-shipped {
    background: #d1ecf1;
    color: #0c5460;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

/* Admin Dashboard */
.admin-dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 80px);
}

.admin-sidebar {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
}

.admin-nav {
    list-style: none;
}

.admin-nav li {
    margin-bottom: 0.5rem;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    display: block;
    transition: background 0.3s;
}

.admin-nav a:hover {
    background: #34495e;
}

.admin-nav a.active {
    background: #667eea;
}

.admin-content {
    padding: 2rem;
    background: #f8f9fa;
}

.admin-header {
    margin-bottom: 2rem;
}

.admin-header h1 {
    color: #333;
    margin-bottom: 0.5rem;
}

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

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-weight: 500;
}

/* Data Tables */
.data-table {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f3f4;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.table tr:hover {
    background: #f8f9fa;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }
.d-block { display: block; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 15px; }

.shadow { box-shadow: 0 5px 15px rgba(0,0,0,0.08); }
.shadow-lg { box-shadow: 0 15px 35px rgba(0,0,0,0.1); }

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .admin-dashboard {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        order: 2;
    }
    
    .order-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.admin-header p {
  font-size: 1.2rem;
  margin-top: 0.5rem;
  color: #333;
}

/* Add these styles to your CSS file */
.image-preview {
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.img-thumbnail {
    max-width: 100%;
    height: auto;
}

/* Style the file input */
.form-control[type="file"] {
    padding: 0.375rem 0.75rem;
}

/* Error message styling */
.error-message {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

/* Product thumbnail styling */
/* Product image styling */
#productsTable img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px;
    background: white;
    display: block;
    margin: 0 auto;
}

/* Hover effect for images */
#productsTable img:hover {
    transform: scale(2);
    transition: transform 0.3s ease;
    z-index: 100;
    position: relative;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* Center the image cell */
#productsTable td:nth-child(6) {
    text-align: center;
    width: 100px;
}

/* Admin Sidebar Gradient */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 2px 0 15px rgba(102, 126, 234, 0.08);
}

.admin-sidebar {
    min-height: 100vh;
    box-shadow: 2px 0 15px rgba(102, 126, 234, 0.08);
}

.admin-nav a {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    gap: 0.75rem;
    border-radius: 8px 0 0 8px;
    margin-right: 1rem;
    font-weight: 500;
}

.admin-nav a.active, .admin-nav a:hover {
    background: rgba(255,255,255,0.12) !important;
    color: #fff !important;
}

.admin-nav i {
    font-size: 1.2rem;
}

/* Admin Content Card */
.admin-content {
    background: #f8f9fa;
    min-height: 100vh;
}

.admin-header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #333;
}

/* Add Product Button */
.btn-success.btn-large {
    background: #28a745;
    color: #fff;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(40,167,69,0.08);
}
.btn-success.btn-large:hover {
    background: #218838;
    color: #fff;
}

/* Action Buttons */
.action-buttons .btn {
    border-radius: 6px;
    font-size: 0.95rem;
    padding: 0.5rem 1.1rem;
    margin-right: 0.3rem;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}
.btn-danger:hover {
    background: #c82333;
    color: #fff;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}
.btn-warning:hover {
    background: #e0a800;
    color: #fff;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}
.btn-secondary:hover {
    background: #545b62;
    color: #fff;
}

/* Table tweaks for admin */
.data-table {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table th, .table td {
    vertical-align: middle;
}

.btn-gradient {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    border: 2px solid #4f6fdc;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    transition: background 0.2s, box-shadow 0.2s;
}
.btn-gradient:hover, .btn-gradient:focus {
    background: linear-gradient(90deg, #5a62e8 0%, #6d3bbd 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
    border-color: #4f6fdc;
}

/* Sticky footer layout */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#footer-placeholder {
    margin-top: auto;
}

/* Pagination styles */
#pagination {
    padding-top: 1rem;
    background: #fff;
}

#join-electraedge-btn {
}