*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #c8392b;
    --primary-dark: #a02d21;
    --accent: #f39c12;
    --dark: #1a1a2e;
    --dark2: #16213e;
    --text: #2c2c2c;
    --text-light: #666;
    --border: #e0e0e0;
    --bg: #f8f7f4;
    --white: #ffffff;
    --success: #27ae60;
    --warning: #e67e22;
    --danger: #e74c3c;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.14);
    --radius: 12px;
    --radius-sm: 6px;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    line-height: 1.3;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ===== NAVBAR ===== */
.navbar {
    background: var(--dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 65px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    font-size: 1.3rem;
    font-family: 'Playfair Display', serif;
}

.logo-icon { font-size: 1.5rem; }
.logo strong { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-links a:hover { color: var(--white); background: rgba(255,255,255,0.1); }

.btn-sell {
    background: var(--primary) !important;
    color: var(--white) !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
}

.btn-sell:hover { background: var(--primary-dark) !important; }

.btn-login {
    border: 1px solid rgba(255,255,255,0.3) !important;
    border-radius: 20px !important;
}

.btn-register {
    background: var(--accent) !important;
    color: var(--dark) !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
}

.nav-user {
    position: relative;
    cursor: pointer;
}

.nav-user > span {
    color: rgba(255,255,255,0.85);
    padding: 8px 12px;
    display: block;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.nav-user:hover .dropdown { display: block; }

.dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    padding: 8px 0;
    z-index: 100;
}

.dropdown a {
    display: block;
    padding: 10px 18px;
    color: var(--text);
    font-size: 0.88rem;
    transition: background 0.2s;
}

.dropdown a:hover { background: var(--bg); }
.dropdown .logout { color: var(--danger); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 50%, #0f3460 100%);
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(200,57,43,0.15) 0%, transparent 60%);
    animation: pulse 6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero h1 span { color: var(--accent); }

.hero p {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 32px;
}

.hero-btns {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-item .num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    font-family: 'Playfair Display', serif;
}
.stat-item .label { font-size: 0.85rem; opacity: 0.7; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
    font-family: 'DM Sans', sans-serif;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(200,57,43,0.35); }

.btn-accent {
    background: var(--accent);
    color: var(--dark);
}
.btn-accent:hover { background: #d68910; transform: translateY(-2px); }

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.5);
    color: var(--white);
}
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.1); }

.btn-dark {
    background: var(--dark);
    color: var(--white);
}

.btn-sm { padding: 7px 16px; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 20px; }
.section-title {
    text-align: center;
    margin-bottom: 40px;
}
.section-title h2 { font-size: 2rem; margin-bottom: 8px; }
.section-title p { color: var(--text-light); }

/* ===== AUCTION CARDS ===== */
.auction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.auction-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.auction-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #eee;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.auction-card:hover .card-image img { transform: scale(1.05); }

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active { background: var(--success); color: white; }
.badge-ended { background: #999; color: white; }
.badge-new { background: var(--accent); color: var(--dark); }

.card-timer {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }

.card-category {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.price-label { font-size: 0.78rem; color: var(--text-light); }
.price-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
}
.price-start { font-size: 0.85rem; color: var(--text-light); }

.card-actions {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

/* ===== FORMS ===== */
.form-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 40px auto;
}

.form-card h2 { margin-bottom: 24px; text-align: center; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    background: var(--white);
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }

/* ===== ALERTS ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 0.9rem;
}
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-danger { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--warning); }
.alert-info { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }

/* ===== PRODUCT DETAIL ===== */
.product-detail { max-width: 1100px; margin: 40px auto; padding: 0 20px; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.detail-image {
    border-radius: var(--radius);
    overflow: hidden;
    background: #eee;
    max-height: 420px;
}
.detail-image img { width: 100%; height: 100%; object-fit: cover; }

.detail-info h1 { font-size: 1.8rem; margin-bottom: 12px; }

.detail-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.meta-tag {
    padding: 4px 12px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-light);
}

.current-bid-box {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 100%);
    color: white;
    padding: 24px;
    border-radius: var(--radius);
    margin: 20px 0;
    text-align: center;
}

.current-bid-box .bid-label { font-size: 0.85rem; opacity: 0.8; margin-bottom: 4px; }
.current-bid-box .bid-price {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'Playfair Display', serif;
    color: var(--accent);
}

.countdown-box {
    background: var(--primary);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 20px;
}

.countdown-box .countdown-label { font-size: 0.82rem; opacity: 0.85; margin-bottom: 4px; }
.countdown-value { font-size: 1.4rem; font-weight: 700; letter-spacing: 2px; }

.bid-form { background: var(--bg); padding: 20px; border-radius: var(--radius); }
.bid-form h3 { margin-bottom: 14px; font-size: 1.1rem; }

.bid-input-row { display: flex; gap: 10px; }
.bid-input-row input { flex: 1; }

.bid-history { margin-top: 30px; }
.bid-history h3 { margin-bottom: 14px; }

.bid-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.bid-table th {
    background: var(--dark);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
}

.bid-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.bid-table tr:last-child td { border-bottom: none; }
.bid-table tr:hover td { background: var(--bg); }

.winning-row td { background: #d4edda; font-weight: 600; }

/* ===== DASHBOARD ===== */
.dashboard { max-width: 1100px; margin: 40px auto; padding: 0 20px; }

.dashboard-header { margin-bottom: 30px; }
.dashboard-header h1 { font-size: 1.8rem; }
.dashboard-header p { color: var(--text-light); }

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--bg);
}

.stat-info .stat-num {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    color: var(--primary);
}

.stat-info .stat-label {
    font-size: 0.82rem;
    color: var(--text-light);
}

/* ===== TABLE ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.data-table th {
    background: var(--dark);
    color: white;
    padding: 14px 18px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

.table-responsive { overflow-x: auto; }

/* ===== BADGES ===== */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-block;
}

.status-active { background: #d4edda; color: #155724; }
.status-closed { background: #f8d7da; color: #721c24; }
.status-pending { background: #fff3cd; color: #856404; }
.status-cancelled { background: #e2e3e5; color: #383d41; }

/* ===== SEARCH / FILTER BAR ===== */
.filter-bar {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group { flex: 1; min-width: 150px; }
.filter-group label { font-size: 0.82rem; font-weight: 500; display: block; margin-bottom: 4px; }
.filter-group input,
.filter-group select {
    width: 100%;
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    background: var(--white);
}

/* ===== CATEGORIES ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    margin: 30px 0;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.25s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-4px);
    background: var(--primary);
    color: white;
}

.category-icon { font-size: 2rem; margin-bottom: 8px; }
.category-name { font-size: 0.85rem; font-weight: 600; }

/* ===== WATCHLIST HEART ===== */
.watch-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 4px 8px;
    transition: transform 0.2s;
}
.watch-btn:hover { transform: scale(1.2); }

/* ===== ADMIN ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--dark);
    color: white;
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar .logo { padding: 0 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); }

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 3px solid var(--accent);
}

.admin-content {
    margin-left: 240px;
    flex: 1;
    padding: 30px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.admin-topbar h1 { font-size: 1.6rem; }

/* ===== PAGE HEADER ===== */
.page-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 100%);
    color: white;
    padding: 40px 20px;
    margin-bottom: 40px;
}

.page-header .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.page-header h1 { font-size: 2rem; }
.page-header p { opacity: 0.8; margin-top: 4px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.3rem; margin-bottom: 8px; color: var(--text); }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 30px;
}

.pagination a {
    display: inline-block;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.pagination a:hover, .pagination a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== PROFILE ===== */
.profile-header {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--accent);
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta h2 { font-size: 1.5rem; }
.profile-meta p { color: var(--text-light); font-size: 0.9rem; }
.profile-role {
    display: inline-block;
    padding: 3px 12px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 6px;
    text-transform: capitalize;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links { display: none; flex-direction: column; position: absolute; top: 65px; left: 0; right: 0; background: var(--dark); padding: 12px; }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }

    .detail-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }

    .admin-sidebar { display: none; }
    .admin-content { margin-left: 0; }

    .stats-cards { grid-template-columns: 1fr 1fr; }

    .bid-input-row { flex-direction: column; }

    .profile-header { flex-direction: column; text-align: center; }

    .filter-bar { flex-direction: column; }
}

@media (max-width: 480px) {
    .hero { padding: 50px 16px; }
    .stats-bar { gap: 20px; }
    .stats-cards { grid-template-columns: 1fr; }
    .form-card { padding: 24px 16px; }
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.75);
    padding: 50px 20px 0;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 14px;
    font-family: 'Playfair Display', serif;
}

.footer-col h4 {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
}

.footer-col p {
    font-size: 0.88rem;
    line-height: 1.8;
    margin-bottom: 6px;
}

.footer-col a {
    display: block;
    color: rgba(255,255,255,0.65);
    font-size: 0.88rem;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
}

@media (max-width: 480px) {
    .footer-container {
        grid-template-columns: 1fr;
    }
}
