/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

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

/* Header */
header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo a {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    color: #fff;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.23);
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background-color: #dc2626;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Hero Section (Index) */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    margin-bottom: 40px;
    border-radius: 0 0 24px 24px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #0f172a;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Card */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-img {
    aspect-ratio: 1 / 1;
    width: 100%;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
}

.card-content {
    padding: 20px;
    flex-grow: 1;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Post View / Product List */
.post-header {
    margin: 40px 0;
    text-align: center;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.product-list {
    max-width: 800px;
    margin: 0 auto;
}

.product-item {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.product-item:hover {
    box-shadow: var(--shadow-lg);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    object-fit: cover;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.product-price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--danger);
}

.product-original-price {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.product-discount {
    background-color: var(--danger);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
}

.product-store {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: block;
}

/* Admin Dashboard */
.admin-container {
    max-width: 1200px;
    margin: 40px auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.admin-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.85rem;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background-color: #f1f5f9;
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .product-price-wrapper {
        gap: 8px;
        align-items: baseline;
    }
    .product-price {
        font-size: 1.4rem;
    }
    .product-original-price {
        font-size: 0.95rem;
    }
    .product-discount {
        font-size: 0.8rem;
        padding: 3px 6px;
    }
    .product-title {
        font-size: 1.25rem;
    }
}
