/* Admin specific styles to override/complement style.css for this page */
body {
    /* Reset body flex from style.css since we want a different layout structure */
    display: block;
    overflow: hidden;
    /* Hide main scrollbar, scroll content instead */
}

.admin-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.sidebar {
    width: 240px;
    background-color: var(--bg-header);
    /* Darker background for sidebar */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding-top: 2rem;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 0 1.5rem 2rem 1.5rem;
    color: var(--text-title);
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--text);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 1rem;
}

.menu-item:hover {
    color: var(--text-em);
    background-color: rgba(255, 255, 255, 0.03);
}

.menu-item.active {
    color: var(--text-em);
    background-color: var(--bg-span);
    border-left-color: var(--r);
    /* Use the brand pink/red color */
}

.content-area {
    flex-grow: 1;
    background-color: var(--bg-page);
    padding: 3rem;
    overflow-y: auto;
    position: relative;
}

.content-section h1 {
    margin-bottom: 0;
}

.content-section h2 {
    color: var(--text-title);
    margin-bottom: 1.5rem;
}

.content-section p {
    color: var(--text-sub);
}

/* Search Form Styles */
.search-form {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -1rem;
}

.form-group {
    flex: 1 1 0px;
    min-width: 80px;
    padding: 0 0.2rem;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text-sub);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--r);
}

.form-actions {
    display: flex;
    justify-content: flex-start;
    padding: 0 1rem;
    margin-top: 1rem;
}

.form-actions button {
    padding: 0.6rem 1.5rem;
    margin-right: 1rem;
    background: var(--bg-span);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.form-actions button[type="submit"] {
    background: var(--r);
    color: white;
    border-color: var(--r);
}

.form-actions button:hover {
    opacity: 0.9;
}

/* Table Management Styles */
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-input {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    width: 300px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--r);
}

.results-table {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow-x: auto;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text);
    font-size: 1rem;
}

.results-table th,
.results-table td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.results-table th {
    color: var(--text-sub);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
}

.results-table th.sorted {
    color: var(--text-em);
}

.results-table th:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.results-table th span {
    position: absolute;
    right: 1rem;
}

.results-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.btn-action {
    padding: 0.25rem 0.75rem;
    margin-right: 0.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-sub);
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-action:hover {
    border-color: var(--text-em);
    color: var(--text-em);
    background: rgba(255, 255, 255, 0.05);
}

.text-center {
    text-align: center;
    color: var(--text-sub);
    padding: 2rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-header);
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-title);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-save {
    background: var(--r);
    border: none;
    color: white;
    padding: 0.6rem 2rem;
    border-radius: 4px;
    cursor: pointer;
}

[x-cloak] {
    display: none !important;
}