/* Campus Exchange - Main Styles */

:root {
    --primary-color: #2E7D32;
    --secondary-color: #1565C0;
    --accent-color: #FF6F00;
    --bg-color: #F5F5F5;
    --text-color: #212121;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --error-color: #F44336;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
}

main {
    flex: 1;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #2E7D32 0%, #25682a 100%);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.navbar .container {
    min-height: 68px;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    color: white !important;
    padding-top: 0;
    padding-bottom: 0;
}

.navbar-brand .brand-logo {
    height: 32px !important;
    width: auto !important;
    max-height: 32px;
    max-width: 120px;
    display: block;
    object-fit: contain;
}

.navbar-toggler {
    border: 0;
    padding: 0.35rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255,255,255,0.3);
}

.nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: white !important;
}

.navbar-nav {
    gap: 0.15rem;
}

.mobile-nav-header {
    margin: 0.4rem 0 0.8rem;
}

.mobile-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
}

.mobile-nav-welcome {
    color: rgba(255,255,255,0.92);
    font-size: 0.95rem;
}

.mobile-nav-actions {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.4rem;
}

.mobile-nav-actions .btn {
    width: 100%;
    font-weight: 600;
    border-radius: 10px;
    min-height: 44px;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1b5e20;
    border-color: #1b5e20;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #0d47a1;
    border-color: #0d47a1;
}

.btn-accent {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.btn-accent:hover {
    background-color: #e65100;
    border-color: #e65100;
    color: white;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

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

/* Product Cards */
.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.product-card .card-body {
    padding: 1rem;
}

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

/* Badges */
.badge-category {
    background-color: var(--secondary-color);
}

.badge-condition {
    background-color: var(--primary-color);
}

.badge-pending {
    background-color: var(--warning-color);
    color: #212121;
}

.badge-approved {
    background-color: var(--success-color);
}

.badge-rejected {
    background-color: var(--error-color);
}

.badge-sold {
    background-color: #9c27b0;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 0;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
}

.hero-section .lead {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Page Header */
.page-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 40px 0;
    margin-bottom: 30px;
}

/* Forms */
.form-control:focus, 
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(46, 125, 50, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Footer */
.footer {
    background-color: #212121;
    color: white;
    padding: 40px 0;
    margin-top: auto;
}

.social-link {
    color: white;
    font-size: 1.5rem;
    margin-right: 15px;
    transition: color 0.2s;
}

.social-link:hover {
    color: var(--accent-color);
}

/* Alerts */
.alert {
    border-radius: 8px;
}

/* Product Detail */
.product-image-main {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.product-thumbnail:hover,
.product-thumbnail.active {
    opacity: 1;
}

/* Enquiry Modal */
.enquiry-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.enquiry-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
}

.enquiry-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(46, 125, 50, 0.05);
}

.enquiry-option i {
    font-size: 2rem;
    margin-right: 10px;
}

/* Admin Dashboard */
.stats-card {
    border-radius: 12px;
    padding: 20px;
    color: white;
}

.stats-card.primary {
    background: linear-gradient(135deg, var(--secondary-color), #1976d2);
}

.stats-card.success {
    background: linear-gradient(135deg, var(--success-color), #388e3c);
}

.stats-card.warning {
    background: linear-gradient(135deg, var(--warning-color), #f57c00);
}

.stats-card.info {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
}

.stats-card i {
    font-size: 2.5rem;
    opacity: 0.8;
}

/* Table */
.table-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Filters */
.filter-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 1400px) {
    .container {
        max-width: 1140px;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }

    .product-card .card-img-top {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .enquiry-options {
        grid-template-columns: 1fr;
    }
    
    .product-image-main {
        height: 300px;
    }
    
    .page-header {
        padding: 30px 0;
    }
    
    .stats-card {
        margin-bottom: 15px;
    }
    
    .filter-section {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .container {
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .hero-section {
        padding: 30px 15px;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .product-card .card-img-top {
        height: 150px;
    }
    
    .product-card .price {
        font-size: 1.1rem;
    }
    
    .product-image-main {
        height: 250px;
    }
    
    .product-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .footer {
        padding: 30px 15px;
    }
    
    .enquiry-option {
        padding: 15px;
    }
    
    .enquiry-option i {
        font-size: 1.5rem;
    }
    
    .form-label {
        font-size: 0.9rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .social-link {
        font-size: 1.2rem;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .navbar-brand .brand-logo {
        height: 24px !important;
        max-height: 24px;
        max-width: 90px;
    }
    
    .product-card .card-img-top {
        height: 120px;
    }
}

/* Navbar responsive */
@media (max-width: 991px) {
    .navbar .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .navbar-collapse {
        margin-top: 0.75rem;
        padding: 0.9rem;
        background: rgba(0, 0, 0, 0.16);
        border: 1px solid rgba(255,255,255,0.18);
        border-radius: 14px;
        backdrop-filter: blur(3px);
    }

    .navbar-brand .brand-logo {
        height: 28px !important;
        max-height: 28px;
        max-width: 100px;
    }
    
    .navbar-nav .nav-link {
        border-radius: 10px;
        padding: 0.7rem 0.85rem !important;
        background: rgba(255,255,255,0.08);
        margin-bottom: 0.28rem;
    }

    .navbar-nav .nav-link:hover {
        background: rgba(255,255,255,0.18);
    }
}

/* Make images responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Ensure touch-friendly targets on mobile */
@media (pointer: coarse) {
    .btn, .nav-link, .card, a {
        min-height: 44px;
    }
    
    .product-card {
        cursor: pointer;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}
