/* Admin Panel Styles */

:root {
    --primary-color: #333;
    --secondary-color: #667eea;
    --accent-color: #f5576c;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-color: #e0e0e0;
    --danger-color: #ff4757;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-bg);
    color: var(--text-color);
}

.admin-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--white);
    box-shadow: var(--shadow);
    overflow-y: auto;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-header h2 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.sidebar-header p {
    color: #999;
    font-size: 0.85rem;
}

.sidebar-nav {
    padding: 2rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--light-bg);
    border-left-color: var(--secondary-color);
}

.nav-item.active {
    background: var(--light-bg);
    border-left-color: var(--secondary-color);
    color: var(--secondary-color);
    font-weight: 600;
}

.nav-item .icon {
    margin-right: 1rem;
    font-size: 1.2rem;
}

.nav-item.logout {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--danger-color);
}

.nav-item.logout:hover {
    background: rgba(255, 71, 87, 0.05);
}

/* Main Content */
.main-content {
    margin-left: 250px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background: var(--white);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

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

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 2rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content h3 {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.dashboard-actions {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.dashboard-actions h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

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

.section-header h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* Search Box */
.search-box {
    margin-bottom: 2rem;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Models Table */
.models-table-container {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

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

.models-table thead {
    background: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.models-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
}

.models-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.models-table tbody tr:hover {
    background: var(--light-bg);
}

.action-buttons-table {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-icon.edit {
    background: #4facfe;
    color: white;
}

.btn-icon.edit:hover {
    background: #3a9adb;
}

.btn-icon.delete {
    background: var(--danger-color);
    color: white;
}

.btn-icon.delete:hover {
    background: #ff3838;
}

/* Form Styles */
.model-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group.full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="color"] {
    width: 60px;
    height: 40px;
    cursor: pointer;
}

/* Form Preview */
.form-preview {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
}

.form-preview h3 {
    margin-bottom: 1.5rem;
}

.model-preview-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    max-width: 300px;
}

.model-preview-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.model-preview-card h3 {
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 1.2rem;
}

.preview-specialty {
    padding: 0 1.5rem;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.preview-bio {
    padding: 0.5rem 1.5rem 1rem;
    color: #666;
    font-size: 0.95rem;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

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

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: var(--white);
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-cancel {
    background: #e0e0e0;
    color: var(--text-color);
}

.btn-cancel:hover {
    background: #d0d0d0;
}

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

.btn-danger:hover {
    background: #ff3838;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Settings */
.settings-container {
    display: grid;
    gap: 2rem;
}

.settings-group {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.settings-group h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.settings-group p {
    color: #999;
    margin-bottom: 1rem;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

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

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--primary-color);
}

.modal-content p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header .btn {
        width: 100%;
    }

    .models-table {
        font-size: 0.85rem;
    }

    .models-table th,
    .models-table td {
        padding: 0.75rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }

    .top-bar {
        padding: 1rem;
    }

    .top-bar-left h1 {
        font-size: 1.3rem;
    }

    .content-area {
        padding: 1rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}
