:root {
    --bg-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    --bg-color: #2563eb;
    --sidebar-bg: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.15);
    --accent-color: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --border-color: rgba(255, 255, 255, 0.2);
    --glass-blur: blur(12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: white;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 0.75rem;
    transition: all 0.2s;
}

nav a:hover,
nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.stats-card {
    margin-top: auto;
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.stats-card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stats-card p {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.05), transparent);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.search-bar input {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    width: 300px;
    color: white;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: var(--accent-color);
}

.action-btn {
    background: white;
    border: none;
    color: #2563eb;
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    margin-right: 1rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #475569;
    box-shadow: none;
}

.user-profile {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Dashboard Grid */
.header-section {
    margin-bottom: 2rem;
}

.header-section h2 {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
}

.header-section p {
    color: var(--text-secondary);
}

.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.25rem;
    transition: transform 0.3s, border-color 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
}

.product-info h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.5rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.current-price {
    display: flex;
    flex-direction: column;
}

.cp-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cp-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
}

.lowest-price {
    text-align: right;
    font-size: 0.875rem;
    color: #10b981;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #2563eb;
    background-image: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    margin: 5% auto;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 900px;
    border-radius: 2rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    right: 2rem;
    top: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.product-details-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: center;
}

#modal-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background: white;
    padding: 1rem;
    border-radius: 1rem;
}

.product-title-group h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.product-title-group a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.875rem;
}

.chart-container {
    height: 400px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 1rem;
    padding: 1rem;
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(56, 189, 248, 0.1);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Status Badges & Delete Buttons */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-badge.inactive {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-badge.resealed {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    margin-left: 0.5rem;
}

.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #ef4444;
    color: white;
}

.view-section {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}