/* ============================================
   DigiFree Admin Panel Styles
   ============================================ */

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    line-height: 1.6;
}

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 8px; font-size: 0.9rem;
    font-weight: 600; border: none; cursor: pointer; transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: #F07D00; color: #fff; }
.btn-primary:hover { background: #d06800; }
.btn-accent { background: #4A90D9; color: #fff; }
.btn-accent:hover { background: #3a78b8; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 1.5px solid #cbd5e1; color: #475569; }
.btn-outline:hover { border-color: #94a3b8; background: #f8fafc; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === LOGIN === */
.login-screen {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #060B18 0%, #0C1628 100%);
    padding: 20px;
}
.login-card {
    background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 1.8rem; color: #1e293b; }
.login-header p { color: #64748b; margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.error-msg { color: #ef4444; font-size: 0.85rem; text-align: center; min-height: 20px; }

/* === FORM === */
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: #475569; }
.form-field input, .form-field textarea, .form-field select {
    padding: 10px 14px; border: 1.5px solid #e2e8f0; border-radius: 8px;
    font-size: 0.9rem; font-family: inherit; transition: border-color 0.2s;
    background: #fff; color: #1e293b;
}
.form-field input:focus, .form-field textarea:focus {
    outline: none; border-color: #F07D00; box-shadow: 0 0 0 3px rgba(240,125,0,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* === ADMIN LAYOUT === */
.admin-panel { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px; background: #0f172a; color: #fff; display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-header { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-header h2 { font-size: 1.3rem; background: linear-gradient(135deg,#F07D00,#FFB347); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.sidebar-header span { font-size: 0.8rem; color: #64748b; }
.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px;
    color: #94a3b8; font-size: 0.9rem; text-decoration: none; margin-bottom: 4px;
    transition: all 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #e2e8f0; }
.nav-item.active { background: rgba(240,125,0,0.15); color: #F07D00; }
.nav-icon { font-size: 1.1rem; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.admin-info { margin-bottom: 8px; }
.admin-info span { font-size: 0.85rem; color: #94a3b8; }

/* === MAIN CONTENT === */
.main-content { flex: 1; margin-left: 260px; padding: 32px; }
.page { display: none; }
.page.active { display: block; }
.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 32px; flex-wrap: wrap; gap: 16px;
}
.page-header h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.page-header p { color: #64748b; font-size: 0.9rem; }

/* === CATEGORIES GRID === */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.category-card {
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); transition: all 0.2s;
    border: 1.5px solid #e2e8f0;
}
.category-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: #F07D00; }
.category-cover {
    height: 180px; background: linear-gradient(135deg, #1e293b, #334155);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: rgba(255,255,255,0.2); overflow: hidden;
    position: relative;
}
.category-cover img { width: 100%; height: 100%; object-fit: cover; }

/* === MEETINGS ADMIN GRID === */
.meetings-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.admin-meeting-card {
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1.5px solid #e2e8f0;
    transition: all 0.2s; display: flex; flex-direction: column;
}
.admin-meeting-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: #F07D00; }
.card-preview { width: 100%; height: 160px; overflow: hidden; background: #f1f5f9; }
.card-preview img { width: 100%; height: 100%; object-fit: cover; }
.card-info { padding: 16px 12px; flex: 1; }
.card-info h4 { margin: 0 0 8px 0; font-size: 0.95rem; font-weight: 600; }
.card-info p { margin: 0; font-size: 0.85rem; color: #666; }
.card-actions { display: flex; gap: 8px; padding: 0 12px 12px 12px; }
.card-actions .btn-icon { flex: 1; padding: 8px; font-size: 0.85rem; }
.category-cover .photo-count {
    position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.7);
    color: #fff; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}
.category-body { padding: 16px; }
.category-body h3 { font-size: 1.05rem; margin-bottom: 4px; }
.category-body p { font-size: 0.85rem; color: #64748b; margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.category-actions { display: flex; gap: 8px; }
.category-status {
    display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.7rem;
    font-weight: 600; margin-left: auto;
}
.status-active { background: #dcfce7; color: #166534; }
.status-inactive { background: #fee2e2; color: #991b1b; }

/* === PHOTOS GRID === */
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.photo-card {
    background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1.5px solid #e2e8f0;
    transition: all 0.2s; position: relative;
}
.photo-card:hover { border-color: #F07D00; }
.photo-thumb {
    height: 180px; overflow: hidden; cursor: pointer; background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.photo-card:hover .photo-thumb img { transform: scale(1.05); }
.photo-info { padding: 10px; }
.photo-info p { font-size: 0.8rem; color: #64748b; margin-bottom: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-actions { display: flex; gap: 6px; }

/* Drag & Drop Styles for Photos */
.photo-card[draggable="true"] {
    cursor: grab;
}
.photo-card[draggable="true"]:active {
    cursor: grabbing;
}
.photo-card .drag-handle {
    position: absolute; top: 8px; left: 8px;
    background: rgba(0,0,0,0.6); color: #fff;
    width: 28px; height: 28px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; line-height: 1; cursor: grab;
    z-index: 10; opacity: 0; transition: opacity 0.2s;
}
.photo-card:hover .drag-handle {
    opacity: 1;
}
.photo-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    border: 2px dashed #F07D00;
}
.photo-card.drag-over-left {
    border-left: 4px solid #F07D00;
}
.photo-card.drag-over-right {
    border-right: 4px solid #F07D00;
}

/* === MODAL === */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1000; }
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal-content {
    position: relative; background: #fff; border-radius: 16px; width: 90%;
    max-width: 600px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid #e2e8f0;
}
.modal-header h2 { font-size: 1.2rem; }
.modal-close {
    width: 32px; height: 32px; border-radius: 8px; border: none;
    background: #f1f5f9; cursor: pointer; font-size: 1rem; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #e2e8f0; }
.modal-body { padding: 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid #e2e8f0; margin-top: 16px; }

/* === UPLOAD === */
.upload-zone {
    border: 2px dashed #cbd5e1; border-radius: 12px; padding: 40px; text-align: center;
    transition: all 0.2s; cursor: pointer;
}
.upload-zone.dragover { border-color: #F07D00; background: rgba(240,125,0,0.05); }
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-hint { font-size: 0.8rem; color: #94a3b8; margin-top: 10px; }
.upload-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 16px; }
.upload-preview .preview-item {
    position: relative; height: 100px; border-radius: 8px; overflow: hidden;
    border: 1.5px solid #e2e8f0;
}
.upload-preview .preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview .remove-preview {
    position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
    background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 50%;
    cursor: pointer; font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
}
.upload-progress { margin-top: 16px; }
.progress-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #F07D00, #FFB347); border-radius: 4px; transition: width 0.3s; width: 0%; }

/* === TOAST === */
.toast {
    position: fixed; bottom: 24px; right: 24px; padding: 12px 24px; border-radius: 10px;
    color: #fff; font-size: 0.9rem; font-weight: 500; z-index: 2000;
    transform: translateY(100px); opacity: 0; transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: #22c55e; }
.toast.error { background: #ef4444; }
.toast.info { background: #3b82f6; }

/* === SETTINGS === */
.settings-card { background: #fff; border-radius: 12px; padding: 24px; max-width: 480px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.settings-card h3 { margin-bottom: 20px; }
.settings-form { display: flex; flex-direction: column; gap: 16px; }

/* === LOADING === */
.loading { text-align: center; padding: 40px; color: #94a3b8; font-size: 0.9rem; }
.empty-state { text-align: center; padding: 60px 20px; color: #94a3b8; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; }
    .admin-panel { flex-direction: column; }
    .main-content { margin-left: 0; padding: 20px; }
    .categories-grid { grid-template-columns: 1fr; }
    .photos-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .form-row { grid-template-columns: 1fr; }
    .sidebar-nav { display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto; }
    .sidebar-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; }
    .admin-info { margin-bottom: 0; }
    .page-header { flex-direction: column; }
}

/* === DATA TABLE === */
.data-table {
    width: 100%; border-collapse: collapse; background: #fff;
    border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.data-table thead {
    background: linear-gradient(135deg, #F07D00, #FFB347); color: #fff; font-weight: 600;
}
.data-table th {
    padding: 14px 16px; text-align: left; font-size: 0.9rem;
}
.data-table td {
    padding: 12px 16px; border-bottom: 1px solid #e2e8f0; font-size: 0.9rem;
}
.data-table tbody tr:hover {
    background: #f8fafc;
}
.data-table .btn-icon {
    padding: 6px 10px; margin: 0 4px; font-size: 0.8rem; background: none; border: 1px solid #e2e8f0;
    border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.data-table .btn-icon:hover {
    background: #F07D00; color: white; border-color: #F07D00;
}

/* === FORM STYLES === */
.form-group {
    display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px;
}
.form-group label {
    font-weight: 500; font-size: 0.9rem; color: #334155;
}
.form-group input,
.form-group textarea {
    padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 6px;
    font-family: inherit; font-size: 0.9rem;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none; border-color: #F07D00; box-shadow: 0 0 0 3px rgba(240, 125, 0, 0.1);
}

/* === MODAL ACTIONS === */
.modal-actions {
    display: flex; gap: 12px; margin-top: 20px;
}
.modal-actions .btn {
    flex: 1;
}

