body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.hidden { display: none !important; }

/* --- Centered Login Screen --- */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.login-card {
    background-color: white;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    text-align: center;
    max-width: 450px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 15px;
}

/* --- Navbar Styles --- */
.navbar {
    background-color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-logo {
    width: 32px;
    height: 32px;
}
.nav-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* --- Grid Styles --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* --- Form Styles --- */
.admin-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 0 auto;
    transition: all 0.3s;
}
.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    background-color: white;
    transition: all 0.3s;
}

/* --- Buttons --- */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.btn.primary { background-color: #3b82f6; color: white; }
.btn.primary:hover { background-color: #2563eb; }
.btn.secondary { background-color: #e2e8f0; color: #475569; }
.btn.secondary:hover { background-color: #cbd5e1; }
.btn-large { padding: 12px 30px; font-size: 16px; }

/* --- Error/Status Messages --- */
.error-msg { color: #ef4444; margin-top: 10px; font-size: 14px; }
#upload-status { margin-top: 15px; font-size: 14px; color: #10b981; }

/* --- Cards --- */
.project-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    position: relative; 
    cursor: pointer;
    height: 100%;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.project-img { 
    width: 100%; 
    height: 180px; 
    object-fit: cover; 
    object-position: center;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.project-content { padding: 20px; flex-grow: 1; }
.project-title { margin: 0 0 10px 0; font-size: 18px; color: #0f172a; transition: color 0.3s; }
.project-desc { font-size: 14px; color: #475569; line-height: 1.5; margin: 0; transition: color 0.3s; }

.edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #f59e0b;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    z-index: 10;
}
.edit-btn:hover { background-color: #d97706; }

/* --- NEW: "NEW" BADGE --- */
.new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* --- DRAG AND DROP STYLES --- */
.sortable-ghost .project-card {
    opacity: 0.4;
    border: 2px dashed #94a3b8;
}
.reordering .project-card { cursor: grab; }
.reordering .project-card:active { cursor: grabbing; }

/* --- PROJECT DETAILS MODAL STYLES --- */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: background-color 0.3s, color 0.3s;
}
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #94a3b8;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover { color: #0f172a; }
.ql-editor img { max-width: 100%; height: auto; border-radius: 8px; margin: 10px 0; }


/* =========================================
   NEW: LIST VIEW STYLES
   ========================================= */
.grid-container.list-view {
    display: flex;
    flex-direction: column;
}
.grid-container.list-view .project-card {
    flex-direction: row;
    height: auto;
    align-items: stretch;
}
.grid-container.list-view .project-img {
    width: 250px;
    height: auto;
    min-height: 120px;
    border-bottom: none;
    border-right: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.grid-container.list-view .project-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* Mobile responsiveness for List View */
@media (max-width: 600px) {
    .grid-container.list-view .project-card { flex-direction: column; }
    .grid-container.list-view .project-img { width: 100%; height: 180px; border-right: none; border-bottom: 1px solid #e2e8f0; }
}


/* =========================================
   NEW: DARK MODE STYLES
   ========================================= */
body.dark-mode {
    background-color: #0f172a;
    color: #f8fafc;
}
.dark-mode .navbar, 
.dark-mode .login-card, 
.dark-mode .admin-card, 
.dark-mode .project-card, 
.dark-mode .modal-content {
    background-color: #1e293b;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.dark-mode .navbar, 
.dark-mode .project-img,
.dark-mode .grid-container.list-view .project-img {
    border-color: #334155;
}
.dark-mode .project-title { color: #f8fafc; }
.dark-mode .project-desc { color: #cbd5e1; }
.dark-mode .form-input {
    background-color: #0f172a;
    color: #f8fafc;
    border-color: #334155;
}
.dark-mode .btn.secondary { background-color: #334155; color: #f8fafc; }
.dark-mode .btn.secondary:hover { background-color: #475569; }
.dark-mode .close-btn { color: #64748b; }
.dark-mode .close-btn:hover { color: #f8fafc; }
/* Keep Quill editor area light so text formatting doesn't get messed up */
.dark-mode #quill-editor { background-color: #fff; color: #000; }