
/* Reset & Base */
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #f8f9fa; color: #1f2937; height: 100vh; overflow: hidden; }

/* Navigation Bar */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.nav-brand {
    font-size: 1.3em;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-search {
    position: relative;
    width: 300px;
}
.nav-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}
.nav-search input {
    width: 100%;
    padding: 10px 10px 10px 38px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    outline: none;
    font-size: 0.9em;
    background: #f9fafb;
    transition: all 0.2s;
}
.nav-search input:focus {
    background: #fff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    color: #fff;
    padding: 80px 20px;
    text-align: center;
    margin-bottom: 40px;
}
.hero h1 {
    font-size: 2.5em;
    font-weight: 800;
    margin: 0 0 15px 0;
    letter-spacing: -0.5px;
}
.hero p {
    font-size: 1.1em;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Public Container */
.public-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.section-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #111827;
}
.section-meta {
    color: #6b7280;
    font-size: 0.95em;
}

/* Layout */
.admin-layout { display: flex; height: 100vh; }
.sidebar { width: 240px; background: #111827; color: #d1d5db; display: flex; flex-direction: column; flex-shrink: 0; }
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #f3f4f6; }
.content-area { flex: 1; padding: 30px; overflow: auto; }

/* Sidebar */
.sidebar-header { padding: 20px; border-bottom: 1px solid #1f2937; }
.brand { font-size: 1.2em; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.sidebar-menu { flex: 1; padding: 20px 0; }
.sidebar-footer { padding: 20px; border-top: 1px solid #1f2937; }

.menu-item {
    display: flex; align-items: center; width: 100%; padding: 12px 20px;
    background: transparent; border: none; color: #9ca3af; cursor: pointer;
    font-size: 0.95em; text-align: left; text-decoration: none;
    transition: all 0.2s;
}
.menu-item:hover, .menu-item.active { background: #1f2937; color: #fff; }
.menu-item i { width: 24px; margin-right: 10px; text-align: center; }

/* Top Bar */
.top-bar { 
    height: 70px; background: #fff; border-bottom: 1px solid #e5e7eb; 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 0 30px; flex-shrink: 0; 
}
.top-left h2 { margin: 0; font-size: 1.5em; font-weight: 700; color: #111827; }
.top-right { display: flex; gap: 15px; align-items: center; }

/* Search Box Top */
.search-box-top { position: relative; width: 300px; }
.search-box-top i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.search-box-top input { 
    width: 100%; padding: 10px 10px 10px 38px; border: 1px solid #e5e7eb; 
    border-radius: 8px; outline: none; font-size: 0.9em; background: #f9fafb;
    transition: border-color 0.2s;
}
.search-box-top input:focus { border-color: #4f46e5; background: #fff; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }

/* Buttons */
.btn { padding: 10px 18px; border: none; border-radius: 8px; cursor: pointer; font-size: 0.9em; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; }
.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-outline { background: #fff; border: 1px solid #d1d5db; color: #374151; }
.btn-outline:hover { background: #f9fafb; border-color: #9ca3af; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }

/* Project Grid */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.project-card { 
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; 
    padding: 20px; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer;
    display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0,0,0,0.05); border-color: #d1d5db; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.card-icon { 
    width: 40px; height: 40px; border-radius: 10px; background: #e0e7ff; color: #4f46e5;
    display: flex; align-items: center; justify-content: center; font-size: 1.2em;
}
.card-status { font-size: 0.8em; padding: 4px 8px; border-radius: 20px; font-weight: 600; }
.status-public { background: #d1fae5; color: #059669; }
.status-private { background: #fee2e2; color: #dc2626; }
.card-title { font-size: 1.1em; font-weight: 600; margin-bottom: 5px; color: #111827; }
.card-meta { font-size: 0.85em; color: #6b7280; display: flex; gap: 15px; margin-top: auto; padding-top: 15px; border-top: 1px solid #f3f4f6; }
.card-meta i { margin-right: 5px; }

/* File Editor (Full Screen Overlay Style) */
.editor-layout { display: flex; height: 100%; gap: 0; background: #fff; border-radius: 8px; border: 1px solid #e5e7eb; overflow: hidden; }
.file-sidebar { width: 250px; background: #f9fafb; border-right: 1px solid #e5e7eb; overflow-y: auto; }
.file-main { flex: 1; display: flex; flex-direction: column; }
.file-header { padding: 10px 20px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; background: #fff; }
.code-area { flex: 1; padding: 20px; overflow: auto; background: #fff; }
.editor-textarea { width: 100%; height: 100%; border: 1px solid #e5e7eb; border-radius: 4px; padding: 10px; font-family: monospace; font-size: 14px; line-height: 1.5; resize: none; outline: none; }
.editor-textarea:focus { border-color: #4f46e5; }

/* File Tree */
.tree-item { padding: 8px 15px; cursor: pointer; font-size: 0.9em; color: #4b5563; display: flex; align-items: center; }
.tree-item:hover { background: #e5e7eb; }
.tree-item i { margin-right: 8px; color: #9ca3af; width: 16px; text-align: center; }
.tree-item.active { background: #e0e7ff; color: #4f46e5; }
.tree-item.active i { color: #4f46e5; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 1000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-box { background: #fff; width: 500px; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); overflow: hidden; animation: modalSlide 0.2s ease-out; }
@keyframes modalSlide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 20px 25px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; background: #f9fafb; }
.modal-header h3 { margin: 0; font-size: 1.1em; font-weight: 600; color: #111827; }
.modal-body { padding: 25px; }
.modal-footer { padding: 20px 25px; background: #f9fafb; text-align: right; border-top: 1px solid #e5e7eb; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9em; color: #374151; }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.95em; transition: border-color 0.2s; }
.form-control:focus { border-color: #4f46e5; outline: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }

/* JS Libs List */
.lib-list { list-style: none; padding: 0; margin: 0; }
.lib-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #e5e7eb; background: #fff; transition: background 0.1s; }
.lib-item:hover { background: #f9fafb; }
.lib-info strong { display: block; color: #111827; margin-bottom: 4px; }

/* Toast */
#toast-container { position: fixed; bottom: 30px; right: 30px; z-index: 2000; }
.toast { background: #1f2937; color: #fff; padding: 12px 24px; border-radius: 8px; margin-top: 10px; font-size: 0.95em; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 10px; }
.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
