/* ===============================================
   IERICORN CREATIVE - Admin Dashboard Styles
   =============================================== */

/* Admin Body */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--dark-bg);
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--dark-surface);
    border-right: 1px solid var(--dark-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.admin-sidebar.collapsed {
    transform: translateX(-100%);
}

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

.admin-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.nav-item:hover {
    background: rgba(0, 102, 255, 0.1);
    color: var(--white);
}

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

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px 0;
    border-top: 1px solid var(--dark-border);
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.admin-sidebar.collapsed + .admin-main {
    margin-left: 0;
}

/* Header */
.admin-header {
    background: var(--dark-surface);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--dark-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-search {
    position: relative;
}

.header-search input {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-md);
    padding: 10px 40px 10px 15px;
    color: var(--text-primary);
    width: 250px;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.header-search i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.header-user span {
    font-weight: 500;
}

/* Content Area */
.admin-content {
    padding: 30px;
}

/* Admin Sections */
.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card.blue .stat-icon {
    background: rgba(0, 102, 255, 0.2);
    color: var(--primary-blue);
}

.stat-card.red .stat-icon {
    background: rgba(255, 51, 102, 0.2);
    color: var(--primary-red);
}

.stat-card.green .stat-icon {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.stat-card.purple .stat-icon {
    background: rgba(136, 0, 255, 0.2);
    color: #8800ff;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.overview-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--dark-border);
}

.card-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--primary-blue);
}

.activity-list {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--dark-border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 102, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.activity-content span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.quick-stats {
    padding: 20px;
}

.quick-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--dark-border);
}

.quick-stat:last-child {
    border-bottom: none;
}

.quick-stat .label {
    color: var(--text-secondary);
}

.quick-stat .value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-blue);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 1.5rem;
}

/* Data Tables */
.data-table-container {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--dark-border);
}

.data-table th {
    background: var(--dark-surface);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: rgba(0, 102, 255, 0.05);
}

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

.table-image {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.table-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.published,
.status-badge.active {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
}

.status-badge.draft,
.status-badge.inactive,
.status-badge.disabled {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.status-badge.pending {
    background: rgba(0, 102, 255, 0.1);
    color: var(--primary-blue);
}

.status-badge.completed {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
}

.status-badge.cancelled {
    background: rgba(255, 51, 102, 0.1);
    color: var(--primary-red);
}

.role-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 500;
}

.role-badge.admin {
    background: rgba(136, 0, 255, 0.1);
    color: #8800ff;
}

.role-badge.user {
    background: rgba(0, 102, 255, 0.1);
    color: var(--primary-blue);
}

.table-actions {
    display: flex;
    gap: 10px;
}

.table-actions button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.table-actions button:hover {
    background: var(--dark-surface);
}

.table-actions button.edit:hover {
    color: var(--primary-blue);
}

.table-actions button.delete:hover {
    color: var(--primary-red);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.settings-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    padding: 25px;
}

.settings-card h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-card h3 i {
    color: var(--primary-blue);
}

.settings-card .form-group {
    margin-bottom: 15px;
}

.settings-card .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.settings-card .form-group input,
.settings-card .form-group textarea {
    width: 100%;
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-md);
    padding: 12px 15px;
    color: var(--text-primary);
    font-family: var(--font-primary);
}

.settings-card .form-group input:focus,
.settings-card .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* Theme Options */
.theme-options {
    display: flex;
    gap: 15px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 15px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: var(--transition-fast);
}

.theme-option:hover,
.theme-option.active {
    border-color: var(--primary-blue);
}

.theme-preview {
    width: 80px;
    height: 50px;
    border-radius: var(--radius-sm);
}

.theme-preview.dark {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a25 100%);
}

.theme-preview.light {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
}

/* Settings Toggles */
.settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--dark-border);
    border-radius: 26px;
    transition: var(--transition-normal);
}

.slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition-normal);
}

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

.toggle input:checked + .slider::before {
    transform: translateX(24px);
}

/* Admin Modals */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.admin-modal.active {
    opacity: 1;
    visibility: visible;
}

.admin-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.admin-modal .modal-content {
    position: relative;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.admin-modal .modal-header h2 {
    font-size: 1.3rem;
}

.admin-modal .modal-header button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.admin-modal form {
    padding: 25px;
}

.admin-modal p {
    padding: 25px;
    text-align: center;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

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

.btn-danger:hover {
    background: var(--primary-red-dark);
}

/* Responsive */
@media (max-width: 1199px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .mobile-toggle,
    .sidebar-toggle {
        display: block;
    }
    
    .header-search {
        display: none;
    }
}

@media (max-width: 767px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-header {
        padding: 15px 20px;
    }
    
    .admin-content {
        padding: 20px;
    }
    
    .data-table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}
