/* Root Variables for Theming */
:root {
    --primary-color: #32CD32;
    --dark-bg: #1a1a1a;
    --dark-secondary-bg: #2d2d2d;
    --dark-text: #e0e0e0;
    --dark-border: #444;
    --light-bg: #ffffff;
    --light-secondary-bg: #f8f9fa;
    --light-text: #333;
    --light-border: #ddd;
}

/* Light Mode */
body.light-mode {
    --bg: var(--light-bg);
    --secondary-bg: var(--light-secondary-bg);
    --text: var(--light-text);
    --border: var(--light-border);
}

/* Dark Mode (Default) */
body {
    --bg: var(--dark-bg);
    --secondary-bg: var(--dark-secondary-bg);
    --text: var(--dark-text);
    --border: var(--dark-border);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navbar Styles */
nav {
    background-color: var(--secondary-bg);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

nav .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

nav .nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--primary-color);
}

nav a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.25rem;
}

/* Dark Mode Toggle */
.theme-toggle {
    background-color: var(--primary-color);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
    font-size: 0.9rem;
}

.theme-toggle:hover {
    background-color: #00AA00;
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

h2 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

h3 {
    color: var(--primary-color);
}

p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

a {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #00AA00 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 0;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--secondary-bg);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(50, 205, 50, 0.2);
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

/* Controls */
.controls {
    background: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid var(--border);
}

.controls input {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--bg);
    color: var(--text);
}

.controls button {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 600;
}

.controls button:hover {
    background-color: #00AA00;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--secondary-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

table thead {
    background-color: var(--primary-color);
    color: white;
}

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

table tbody tr:hover {
    background-color: var(--bg);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-active {
    color: var(--primary-color);
    font-weight: 600;
}

.status-inactive {
    color: #ff6b6b;
    font-weight: 600;
}

/* Actions */
.actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.btn-edit {
    background-color: #4CAF50;
    color: white;
}

.btn-edit:hover {
    background-color: var(--primary-color);
}

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

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

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card h3 {
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Footer */
footer {
    background-color: var(--secondary-bg);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
}

/* Responsive Design */
@media (max-width: 768px) {
    nav .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }

    nav .nav-right {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .controls {
        flex-direction: column;
    }

    .controls input,
    .controls button {
        width: 100%;
    }

    table th,
    table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    .btn-small {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .filter-controls {
        flex-direction: column !important;
    }

    .filter-controls input,
    .filter-controls button {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        max-width: 500px;
    }
}

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

/* Modal Content */
.modal-content {
    background-color: var(--bg);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    padding: 0;
    border: 1px solid var(--border);
}

.modal-small {
    max-width: 400px;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: var(--secondary-bg);
}

/* Form Styles */
.product-form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--secondary-bg);
    color: var(--text);
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(50, 205, 50, 0.1);
}

.form-group input::placeholder {
    color: var(--text);
    opacity: 0.6;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-submit,
.btn-cancel,
.btn-delete {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.btn-submit {
    background-color: var(--primary-color);
    color: white;
}

.btn-submit:hover {
    background-color: #00AA00;
}

.btn-cancel {
    background-color: var(--secondary-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

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

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

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

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-controls input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--secondary-bg);
    color: var(--text);
}

.filter-controls input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(50, 205, 50, 0.1);
}

.sort-btn,
.primary-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.sort-btn {
    background-color: var(--secondary-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.sort-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.primary-btn:hover {
    background-color: #00AA00;
}

/* Modal paragraph text */
.modal-content > p {
    padding: 0 1.5rem;
    margin: 1rem 0;
    line-height: 1.6;
}
