/* Dashboard Admin Styles */
:root {
    --navy: #1B2A4A;
    --navy-light: #243455;
    --teal: #0097A7;
    --teal-dark: #007a8a;
    --teal-light: #e0f7fa;
    --white: #FFFFFF;
    --grey-50: #F8F9FA;
    --grey-100: #F1F3F5;
    --grey-200: #E9ECEF;
    --grey-300: #DEE2E6;
    --grey-400: #CED4DA;
    --grey-500: #ADB5BD;
    --grey-600: #6C757D;
    --grey-700: #495057;
    --grey-800: #343A40;
    --grey-900: #212529;
    --success: #28A745;
    --danger: #DC3545;
    --warning: #FFC107;
    --info: #17A2B8;
    --sidebar-width: 280px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--grey-100);
    color: var(--grey-800);
    line-height: 1.5;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--navy);
    color: white;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.sidebar-header h2 span {
    color: var(--teal);
}

.sidebar-header p {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    margin-top: 0.25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.nav-item i {
    width: 1.25rem;
    font-size: 1rem;
}

.nav-item:hover {
    background: rgba(0,151,167,0.1);
    color: white;
}

.nav-item.active {
    background: rgba(0,151,167,0.15);
    color: var(--teal);
    border-left-color: var(--teal);
}

.nav-logout {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    margin-bottom: 1rem;
}

.nav-logout .nav-item {
    color: rgba(255,255,255,0.6);
}

.nav-logout .nav-item:hover {
    color: var(--danger);
    background: rgba(220,53,69,0.1);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1.5rem;
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.top-bar h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--navy);
}

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

.admin-avatar {
    width: 40px;
    height: 40px;
    background: var(--teal-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal);
}

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

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--teal-light);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 1.5rem;
    color: var(--teal);
}

.stat-info h3 {
    font-size: 0.7rem;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
}

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
}

.card-body {
    padding: 1.5rem;
}

/* Forms */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--grey-700);
}

.form-group label.required::after {
    content: '*';
    color: var(--danger);
    margin-left: 0.25rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--grey-300);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0,151,167,0.1);
}

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

/* Image Upload */
.image-upload-area {
    border: 2px dashed var(--grey-300);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--grey-50);
}

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

.image-upload-area i {
    font-size: 2rem;
    color: var(--grey-500);
    margin-bottom: 0.5rem;
}

.image-preview {
    margin-top: 1rem;
    text-align: center;
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 0.5rem;
    object-fit: cover;
    border: 2px solid var(--teal);
}

.therapeutic-areas-editor {
    display: grid;
    gap: 1rem;
}

.therapeutic-areas-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--grey-50);
    border: 1px solid var(--grey-200);
    border-radius: 0.75rem;
}

.therapeutic-areas-toolbar p {
    margin: 0;
    color: var(--grey-600);
    font-size: 0.875rem;
}

.therapeutic-areas-list {
    display: grid;
    gap: 1rem;
}

.therapeutic-area-row {
    border: 1px solid var(--grey-200);
    border-radius: 0.75rem;
    padding: 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.therapeutic-area-row .form-group:last-child {
    margin-bottom: 0;
}

.therapeutic-area-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.therapeutic-area-row-header h4 {
    margin: 0;
    color: var(--navy);
}

.therapeutic-area-media-tools {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 1rem;
    align-items: stretch;
}

.therapeutic-area-preview {
    min-height: 180px;
    border: 1px solid var(--grey-200);
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--grey-50);
    display: flex;
    align-items: center;
    justify-content: center;
}

.therapeutic-area-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.therapeutic-area-preview-empty {
    color: var(--grey-500);
    font-size: 0.875rem;
    padding: 1rem;
    text-align: center;
}

.remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
}

/* Buttons */
.btn-primary {
    background: var(--teal);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--teal-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--grey-600);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.btn-warning {
    background: var(--warning);
    color: var(--grey-900);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    background: var(--grey-50);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--grey-600);
}

.data-table tr:hover {
    background: var(--grey-50);
}

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

/* Filters */
.filters-bar {
    background: var(--grey-50);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
    color: var(--grey-600);
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--grey-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: none;
    animation: slideDown 0.3s ease;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--grey-600);
}

.modal-body {
    padding: 1.5rem;
}

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

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--grey-50);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--grey-700);
    transition: all 0.2s;
}

.quick-action:hover {
    background: var(--teal-light);
    color: var(--teal);
    transform: translateY(-2px);
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h1 {
    color: var(--navy);
    font-size: 1.75rem;
}

.login-logo span {
    color: var(--teal);
}

.login-logo p {
    font-size: 0.875rem;
    color: var(--grey-600);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .therapeutic-areas-toolbar,
    .therapeutic-area-row-header {
        flex-direction: column;
        align-items: stretch;
    }
    .therapeutic-area-media-tools {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .mobile-menu-btn {
        display: block;
        position: fixed;
        bottom: 1rem;
        right: 1rem;
        z-index: 1100;
    }
}

.mobile-menu-btn {
    display: none;
    background: var(--teal);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
}

.rich-text-editor {
    border: 1px solid var(--grey-300);
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--white);
}

.rich-text-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--grey-50);
    border-bottom: 1px solid var(--grey-200);
}

.toolbar-btn {
    border: 1px solid var(--grey-300);
    background: var(--white);
    color: var(--grey-700);
    border-radius: 0.5rem;
    padding: 0.45rem 0.65rem;
    cursor: pointer;
}

.toolbar-btn:hover {
    color: var(--teal-dark);
    border-color: var(--teal);
}

.rich-text-input {
    min-height: 220px;
    padding: 1rem;
    outline: none;
    line-height: 1.7;
}

.rich-text-input ul,
.rich-text-input ol,
.rich-text-content ul,
.rich-text-content ol {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

.rich-text-content p + p {
    margin-top: 1rem;
}
