/* Professional Admin Panel Styling */

/* Reset and Base Styles */
.admin-layout * {
    box-sizing: border-box;
}

/* Admin Layout */
.admin-layout {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* Admin Header */
.admin-header {
    background-color: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    height: 65px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    border-bottom: 1px solid #dee2e6;
}

.admin-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.5rem;
}

.admin-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-logo:hover {
    color: #3498db;
}

/* Admin Sidebar */
.admin-sidebar {
    width: 260px;
    background-color: #2c3e50;
    height: calc(100vh - 65px);
    position: fixed;
    left: 0;
    top: 65px;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1029;
}

.admin-nav {
    padding: 1.5rem 0;
}

.admin-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-nav-item {
    margin-bottom: 0.25rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.admin-nav-link i {
    margin-right: 0.75rem;
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

.admin-nav-link:hover {
    background-color: #34495e;
    padding-left: 1.75rem;
}

.admin-nav-link.active {
    background-color: #3498db;
    color: #ffffff;
    position: relative;
}

.admin-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #ffffff;
}

/* Admin Main Content */
.admin-main {
    margin-left: 260px;
    padding-top: 65px;
    min-height: 100vh;
}

.admin-content {
    padding: 2rem;
}

/* Page Header */
.admin-page-header {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.admin-page-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Cards */
.admin-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    overflow: hidden;
}

.admin-card-header {
    background-color: #f8f9fa;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #2c3e50;
}

.admin-card-body {
    padding: 1.5rem;
}

/* Tables */
.admin-table {
    width: 100%;
    margin-bottom: 0;
}

.admin-table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: #2c3e50;
    font-weight: 600;
    padding: 1rem;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
}

.admin-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Buttons */
.btn {
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3498db;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #27ae60;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: #f39c12;
    color: #ffffff;
}

.btn-warning:hover {
    background-color: #d68910;
}

.btn-info {
    background-color: #00bcd4;
    color: #ffffff;
}

.btn-info:hover {
    background-color: #00acc1;
}

.btn-secondary {
    background-color: #95a5a6;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-sm {
    padding: 0.375rem 1rem;
    font-size: 0.813rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    max-width: 600px;
    margin: 2rem auto;
    animation: slideDown 0.3s ease;
}

.modal-dialog-lg {
    max-width: 800px;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 4rem);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #ffffff;
    background-clip: padding-box;
    border: none;
    border-radius: 8px;
    outline: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    padding: 1.25rem;
    border-top: 1px solid #dee2e6;
    gap: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Close Button */
.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    opacity: 0.5;
    padding: 0;
    margin: -0.5rem -0.5rem -0.5rem auto;
    width: 1.5rem;
    height: 1.5rem;
}

.btn-close::before {
    content: '×';
    display: block;
    font-size: 1.5rem;
    line-height: 1;
}

.btn-close:hover {
    opacity: 0.75;
}

/* Form Controls */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 5px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    color: #495057;
    background-color: #fff;
    border-color: #3498db;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-check {
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5em;
    margin-bottom: 0.125rem;
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.25rem;
    vertical-align: top;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25em;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.form-check-input:checked {
    background-color: #3498db;
    border-color: #3498db;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.813rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 4px;
}

.bg-primary {
    background-color: #3498db !important;
    color: #ffffff;
}

.bg-success {
    background-color: #27ae60 !important;
    color: #ffffff;
}

.bg-danger {
    background-color: #e74c3c !important;
    color: #ffffff;
}

.bg-warning {
    background-color: #f39c12 !important;
    color: #ffffff;
}

.bg-info {
    background-color: #00bcd4 !important;
    color: #ffffff;
}

.bg-secondary {
    background-color: #95a5a6 !important;
    color: #ffffff;
}

/* Utilities */
.mb-3 {
    margin-bottom: 1rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.text-center {
    text-align: center !important;
}

.fw-bold {
    font-weight: 600 !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .modal-dialog {
        max-width: calc(100% - 2rem);
        margin: 1rem;
    }
}

/* Loading Spinner */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Product Image in Table */
.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* Action Buttons Group */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

/* Table Action Buttons */
.table .btn-group {
    display: flex;
    gap: 0.375rem;
}

.table .btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.813rem;
}

/* Fix button icons */
.btn i {
    display: inline-flex;
    align-items: center;
    font-size: inherit;
}

/* Filter Toolbar */
.filter-toolbar {
    background-color: #f8f9fa;
    padding: 1.25rem;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
}

/* Pagination */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    margin: 0;
}

.page-item {
    margin: 0 0.125rem;
}

.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    color: #3498db;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.page-link:hover {
    color: #2980b9;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    color: #fff;
    background-color: #3498db;
    border-color: #3498db;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: auto;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Status Colors */
.status-active {
    color: #27ae60;
}

.status-inactive {
    color: #e74c3c;
}

.status-pending {
    color: #f39c12;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 0.9375rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 6px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    color: #16181b;
    background-color: #f8f9fa;
}