/* Admin Panel Styles */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.admin-sidebar.open {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    .admin-sidebar {
        transform: translateX(0);
    }
}

.admin-sidebar-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-sidebar-close {
    display: block;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

@media (min-width: 1024px) {
    .admin-sidebar-close {
        display: none;
    }
}

.admin-user {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
}

.admin-user-name {
    font-weight: 600;
}

.admin-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.admin-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

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

.admin-nav-item.active {
    background: var(--primary);
    color: white;
}

.admin-nav-item svg {
    width: 1.25rem;
    height: 1.25rem;
}

.admin-sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

@media (min-width: 1024px) {
    .admin-main {
        margin-left: 260px;
    }
}

.admin-header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
}

.admin-menu-btn {
    display: block;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

@media (min-width: 1024px) {
    .admin-menu-btn {
        display: none;
    }
}

.admin-content {
    padding: 2rem;
}

/* Dashboard Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.dashboard-stat {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.dashboard-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.dashboard-stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-stat-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: white;
}

.dashboard-stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.dashboard-stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.dashboard-stat-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

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

.admin-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table tbody tr:hover {
    background: var(--background);
}

.admin-table-actions {
    display: flex;
    gap: 0.5rem;
}

/* Admin Card */
.admin-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.admin-card-body {
    padding: 1.5rem;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius);
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Image Upload */
.image-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-upload:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.image-upload-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: var(--text-muted);
}

.image-upload-text {
    color: var(--text-muted);
}

.image-preview {
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 200px;
    border-radius: var(--radius);
}

.image-preview-remove {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Status badges */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
}

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

.quick-action {
    padding: 1.5rem;
    text-align: center;
    background: var(--background);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.quick-action:hover {
    background: var(--primary-light);
}

.quick-action-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 0.75rem;
    color: var(--primary);
}

.quick-action-text {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Rich text editor placeholder */
.editor {
    min-height: 300px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

/* Responsive table */
.table-responsive {
    overflow-x: auto;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: var(--border);
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.5rem;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 9999px;
    transition: 0.2s;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 1.25rem;
    width: 1.25rem;
    left: 0.125rem;
    bottom: 0.125rem;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked + .switch-slider {
    background: var(--primary);
}

.switch input:checked + .switch-slider:before {
    transform: translateX(1.5rem);
}
