:root {
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-hover: #0284c7;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.1) 0, transparent 50%), 
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0, transparent 50%);
    background-attachment: fixed;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar h2 {
    color: var(--accent-color);
    margin-bottom: 2rem;
    padding-left: 1rem;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 2rem;
    width: 100%;
    max-width: 1200px;
}

.container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

button {
    width: 100%;
    padding: 0.875rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--accent-hover);
}

#preview-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: var(--input-bg);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    overflow: hidden;
}

#preview-image img {
    height: 100%;
}

/* Table Styles for Inventory Page */
.inventory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.inventory-table th, .inventory-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

/* Sidebar Dropdown */
.dropdown-btn {
    text-align: left;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    font-weight: 500;
}
.dropdown-btn:hover, .dropdown-btn.active {
    color: var(--accent-color);
}
.dropdown-btn span {
    transition: transform 0.3s;
}
.dropdown-btn.active span {
    transform: rotate(180deg);
}

.dropdown-container {
    display: block; /* Ensure it's not none */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    padding: 0; /* Reset padding when closed */
}
.dropdown-container.show {
    max-height: 500px; /* Generous height */
    padding-bottom: 0.5rem;
}
.dropdown-container .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 1rem 0.5rem 2.5rem; 
    margin-bottom: 0;
    border-radius: 0;
    color: var(--text-secondary);
    border-left: 2px solid transparent;
}
.dropdown-container .nav-link:hover, .dropdown-container .nav-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-left-color: var(--accent-color);
    border-radius: 0;
}

.status-msg {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: none;
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(4px);
    overflow: auto;
}

.modal-content {
    background-color: var(--sidebar-bg);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    color: var(--text-primary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--accent-color);
}
