/* Inherit common styles from style.css */
/* If you want to strictly keep admin.css separate from style.css for shared components,
   you'd import style.css here using @import, or ensure admin.html links to both.
   For this example, admin.html links to both, so no @import needed here. */

/* Admin Header Specifics */
.main-header.admin-header {
    justify-content: space-between; /* Allow space between logo and nav */
    padding: 0 1rem;
}

.main-header.admin-header .logo-container {
    padding-right: 1.5rem; /* Space between logo and nav on larger screens */
}

.admin-nav-wrapper {
    flex-grow: 1; /* Allow navigation to take more space */
    justify-content: flex-end; /* Push nav to the right */
}

.admin-nav {
    display: flex;
    gap: 1.5rem;
    flex-grow: 1;
    justify-content: flex-end; /* Push nav items to the right */
}

.admin-nav .nav-item {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: 0.25rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.admin-nav .nav-item:hover {
    color: var(--color-text-primary);
    background-color: var(--color-surface);
}

.admin-nav .nav-item.active {
    color: var(--color-primary-action);
    font-weight: 700;
    background-color: rgba(32, 148, 243, 0.1); /* Light primary background */
}

.admin-nav .nav-item:focus-visible {
    outline: 2px solid var(--color-primary-action);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .main-header.admin-header .logo-container {
        padding-right: 0; /* No extra padding on mobile */
    }

    .admin-nav-wrapper {
        align-items: flex-start; /* Stack items vertically */
        justify-content: flex-start;
        right: -100%; /* Ensure it's off-screen by default */
    }
    .admin-nav-wrapper.active {
        right: 0;
    }

    .admin-nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.5rem;
        justify-content: flex-start; /* Ensure items start from the top */
    }

    .admin-nav .nav-item {
        width: 100%;
        text-align: left;
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
}

/* Admin Content Layout */
.admin-content-wrapper {
    background-color: var(--color-surface); /* A lighter background for the content area */
    padding: 1.5rem 0; /* Vertical padding */
    min-height: calc(100vh - var(--header-height) - 132px); /* Adjust based on your footer height */
}

.admin-content {
    background-color: var(--color-background); /* White background for the inner content container */
    padding: 1.5rem;
    width: 100%;
    margin-top: 1.7rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* Subtle shadow for the content area */
}

/* Admin Sections */
.admin-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Consistent spacing between elements within a section */
}

.admin-section .section-header {
    margin-bottom: 0; /* Reset default margin, gap handles spacing now */
}

/* Dashboard Summary Cards */
.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-summary-card {
    border: none; /* Remove default border from .admin-card */
    padding: 1.5rem;
    text-align: center;
    background-color: var(--color-white);
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dashboard-summary-card h3 {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.dashboard-summary-card .summary-value {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--color-primary-action);
}

/* Admin Card (general purpose for content blocks) */
.admin-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

/* Admin Tables (reusing .products-table but with admin-specific adjustments) */
.admin-table {
    width: 100%;
    /* No sticky header for now, simplifying */
    /* th, td padding and other styles are inherited from .products-table */
}

.admin-table th.col-actions,
.admin-table td.col-actions {
    text-align: center;
    width: 80px; /* Allocate specific width for actions column */
}

.admin-table .action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.admin-table .action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.25rem;
    color: var(--color-text-secondary);
    background-color: var(--color-surface);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-table .action-btn:hover {
    background-color: var(--color-border);
    color: var(--color-text-primary);
}

.admin-table .action-btn.btn-delete:hover {
    color: var(--color-error);
    background-color: rgba(224, 49, 49, 0.1);
}

.admin-table .no-data-row td {
    padding: 1.5rem;
    text-align: center;
    color: var(--color-text-secondary);
    font-style: italic;
}

/* Modals */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000; /* High z-index to be on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4); /* Dark overlay */
    align-items: center; /* Center content vertically */
    justify-content: center; /* Center content horizontally */
    padding: 1rem; /* Padding around the modal content */
}

.modal.active {
    display: flex; /* Show modal */
}

.modal-content {
    background-color: var(--color-background);
    margin: auto;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    position: relative;
    animation: fadeIn 0.3s ease-out; /* Simple fade-in animation */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.close-modal-btn:hover {
    color: var(--color-text-primary);
    background-color: var(--color-surface);
}

/* Form Layouts within modals */
.form-grid-1 {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Space between form groups */
}

.form-grid-1 .form-submit-container {
    margin-top: 1rem; /* Space above submit button */
}

/* Adjust form-feedback in modals */
.modal .form-feedback-message {
    text-align: left;
    margin-top: 0.75rem;
}

/* Select element styling */
.form-input[type="file"] {
    padding: 0.75rem 1rem;
    height: auto; /* Allow height to adjust for file input text */
}