/* Admin Dashboard Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-secondary);
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-dark);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.2);
    border-left-color: var(--primary-color);
    color: white;
}

.nav-item i {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 40px;
    background: var(--bg-secondary);
}

/* Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.admin-header h1 {
    font-size: 2.2rem;
    color: var(--text-color);
}

.header-actions {
    display: flex;
    gap: 15px;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.stat-info p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--text-color);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-color);
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Projects List */
.projects-list {
    display: grid;
    gap: 20px;
}

.project-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: var(--transition);
}

.project-item:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.project-icon-display {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.project-info {
    flex: 1;
}

.project-info h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text-color);
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.5;
}

.project-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.project-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* Forms */
.form-container {
    max-width: 800px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Image Preview Grid */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.image-preview-grid > div {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.image-preview-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-grid button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(244, 67, 54, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--transition);
}

.image-preview-grid button:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.file-info {
    color: #10b981 !important;
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
}

/* Rich Text Editor */
.editor-toolbar {
    display: flex;
    gap: 5px;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.editor-btn {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: var(--transition);
}

.editor-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.editor-btn:active {
    transform: scale(0.95);
}

.editor-divider {
    width: 1px;
    background: var(--border-color);
    margin: 0 5px;
}

.rich-editor {
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    background: white;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
    cursor: text;
    color: #000000;
}

.rich-editor p {
    margin: 10px 0;
}

.rich-editor h3 {
    margin: 15px 0 10px 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.rich-editor h1, .rich-editor h2, .rich-editor h3, 
.rich-editor h4, .rich-editor h5, .rich-editor h6 {
    color: #000000;
}

/* Allow inline styles to override */
.rich-editor *[style*="color"] {
    color: inherit !important;
}

.rich-editor font[color] {
    color: inherit !important;
}

.rich-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.rich-editor:empty:before {
    content: attr(placeholder);
    color: #9ca3af;
    pointer-events: none;
    display: block;
}

.rich-editor ul, .rich-editor ol {
    margin: 10px 0;
    padding-left: 25px;
}

.rich-editor li {
    margin: 5px 0;
}

.rich-editor br {
    display: block;
    margin: 5px 0;
    content: "";
}

/* Data Management */
.data-management {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.data-card {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
}

.data-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.data-card p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.6rem;
    color: var(--text-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-color);
}

.modal-content form {
    padding: 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    display: none;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.notification.show {
    display: flex;
}

.notification.success {
    background: #10b981;
    color: white;
}

.notification.error {
    background: #ef4444;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .project-item {
        flex-direction: column;
        text-align: center;
    }
}
