:root {
    --primary-color: #4361ee;
    --primary-light: #e6f0ff;
    --secondary-color: #3a0ca3;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #4895ef;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --transition-speed: 0.3s;
    --border-radius: 8px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7fb;
    color: var(--dark-color);
    line-height: 1.6;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    transition: all var(--transition-speed) ease;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    color: var(--dark-color);
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    z-index: 100;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.05);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.5rem;
    margin-right: 10px;
}

.sidebar-menu {
    flex: 1;
    list-style: none;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--gray-color);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar-menu a i {
    margin-right: 10px;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    color: var(--gray-color);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
    border-left: 3px solid var(--primary-color);
}

.sidebar-menu a:hover i,
.sidebar-menu a.active i {
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 600;
    font-size: 0.9rem;
}

.role {
    font-size: 0.8rem;
    color: var(--gray-color);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--gray-color);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: var(--light-gray);
    color: var(--danger-color);
}

/* Main Content Styles */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    transition: all var(--transition-speed) ease;
    min-height: 100vh;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 0 25px;
    height: var(--header-height);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 90;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--dark-color);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    margin-right: 15px;
    cursor: pointer;
    color: var(--gray-color);
    display: none;
}

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

.notifications {
    position: relative;
    margin-right: 15px;
    cursor: pointer;
    color: var(--gray-color);
    font-size: 1.2rem;
}

.notifications .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-body {
    padding: 25px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

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

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.section-header h2 i {
    margin-right: 10px;
    color: var(--primary-color);
}

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

/* Card Styles */
.card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 25px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform 0.3s;
    border-top: 4px solid var(--primary-color);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--gray-color);
}

.stat-card span {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* Recent Activity */
.recent-activity {
    margin-top: 25px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    border-radius: var(--border-radius);
    transition: background 0.3s;
}

.activity-item:hover {
    background: var(--light-gray);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.activity-content p {
    font-weight: 500;
    margin-bottom: 5px;
}

.activity-time {
    font-size: 0.85rem;
    color: var(--gray-color);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.filter-group label {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--gray-color);
    font-weight: 500;
}

.form-select, .form-control {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background-color: #fff;
    transition: all 0.3s;
}

.form-select:focus,
.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.search-box {
    position: relative;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-color);
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.btn i {
    margin-right: 8px;
}

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

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-color);
    color: var(--gray-color);
}

.btn-outline:hover {
    background: var(--light-gray);
    color: var(--dark-color);
}

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

.btn-success:hover {
    background-color: #3aa8d8;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background-color: #e51773;
    transform: translateY(-2px);
}

/* Publication List */
.publication-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.pub-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    transition: all 0.3s;
    border-left: 4px solid var(--primary-color);
}

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

.pub-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--dark-color);
    font-weight: 600;
}

.pub-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.pub-meta span {
    background: var(--light-gray);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--gray-color);
    display: flex;
    align-items: center;
}

.pub-meta .status-draft {
    background: #fff3cd;
    color: #856404;
}

.pub-meta .status-published {
    background: #d4edda;
    color: #155724;
}

.pub-meta .status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 15px;
    line-height: 1.5;
}

.pub-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.modal-content {
    background: #fff;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: all 0.3s;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--dark-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
    transition: color 0.3s;
}

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

.modal-body {
    padding: 20px;
}

/* Form Tabs */
.form-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-color);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

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

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dark-color);
}

.form-group .required {
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Authors Section */
.authors-section {
    margin: 20px 0;
}

.current-authors, .add-authors {
    margin-bottom: 25px;
}

.authors-section h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--dark-color);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.authors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.author-tag {
    background: var(--light-gray);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-tag .remove-author {
    color: var(--gray-color);
    cursor: pointer;
    transition: color 0.3s;
}

.author-tag .remove-author:hover {
    color: var(--danger-color);
}

.author-search {
    position: relative;
    margin-bottom: 15px;
}

.author-search input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.author-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-color);
}

.author-results {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    max-height: 200px;
    overflow-y: auto;
}

.author-result-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.3s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.author-result-item:hover {
    background: var(--light-gray);
}

.author-result-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.author-result-institution {
    font-size: 0.8rem;
    color: var(--gray-color);
}

/* Type Specific Fields */
.type-fields {
    margin: 20px 0;
    padding: 20px;
    background: var(--light-gray);
    border-radius: var(--border-radius);
}

.type-fields h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Responsive styles */
@media (max-width: 1200px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
        overflow: hidden;
    }

    .sidebar-header .logo span,
    .sidebar-menu a span,
    .user-details,
    .logout-btn span {
        display: none;
    }

    .sidebar-menu a {
        justify-content: center;
        padding: 12px 0;
    }

    .sidebar-menu a i {
        margin-right: 0;
        font-size: 1.3rem;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }

    .avatar {
        margin-right: 0;
    }
}

@media (max-width: 992px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        z-index: 1000;
        height: 100vh;
        width: 280px;
    }

    .sidebar.active {
        left: 0;
    }

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

    .sidebar-toggle {
        display: block;
    }

    .publication-list {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .section-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 576px) {
    .admin-header {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
    }

    .pub-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }
}