@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;700;800&display=swap');

:root {
    --brand-blue: #0061ff;
    --brand-green: #00c853;
    --brand-red: #d93025;
    --text-dark: #111827;
    --text-muted: #4b5563;
    --bg-light: #f9fafb;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Inter', sans-serif; 
    color: var(--text-dark); 
    background: #fff; 
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

mark { 
    background-color: var(--brand-blue); 
    color: #ffffff; 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-weight: 600; 
}

.login-overlay { 
    position: fixed; 
    inset: 0; 
    background: var(--bg-light); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 2000; 
}

.login-card { 
    background: #fff; 
    padding: 40px; 
    border-radius: 24px; 
    width: 100%; 
    max-width: 400px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.05); 
    text-align: center; 
}

.login-card .logo { font-size: 32px; margin-bottom: 10px; }
.login-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 30px; }

.error-msg { 
    color: var(--brand-red); 
    font-size: 13px; 
    margin-top: 15px; 
    font-weight: 500; 
}

header { 
    height: 80px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 8%; 
    border-bottom: 1px solid var(--border); 
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.logo { 
    font-family: 'Outfit', sans-serif; 
    font-size: 24px; 
    font-weight: 800; 
    color: var(--brand-blue); 
    text-decoration: none; 
}

.logo span { color: var(--text-dark); }

.nav-links { 
    display: flex; 
    gap: 24px; 
    align-items: center; 
}

.nav-links a { 
    text-decoration: none; 
    color: var(--text-muted); 
    font-weight: 600; 
    font-size: 15px; 
    cursor: pointer; 
}

.btn-logout { 
    background: none; 
    border: none; 
    color: var(--brand-red); 
    font-weight: 600; 
    cursor: pointer; 
    font-size: 14px;
}

.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 60px 24px 120px 24px; 
    flex: 1;
    width: 100%;
}

.page { display: none; }
.page.active { display: block; animation: pageFade 0.4s ease-out; }

@keyframes pageFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.home-hero { text-align: center; max-width: 800px; margin: 0 auto 60px auto; }
.home-hero h1 { font-family: 'Outfit', sans-serif; font-size: 48px; letter-spacing: -1.5px; margin-bottom: 20px; color: var(--text-dark); }
.home-hero p { font-size: 18px; color: var(--text-muted); }

.app-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 24px; 
}

.app-card { 
    border: 1px solid var(--border); 
    border-radius: 20px; 
    padding: 24px; 
    transition: all 0.3s ease; 
    background: #fff;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.app-card:hover { 
    border-color: var(--brand-blue); 
    box-shadow: var(--shadow-md); 
    transform: translateY(-4px); 
}

.card-icon { 
    width: 64px; 
    height: 64px; 
    border-radius: 16px; 
    margin-bottom: 16px; 
    object-fit: cover; 
}

.card-tag { 
    position: absolute; 
    top: 24px; 
    right: 24px; 
    font-size: 10px; 
    font-weight: 800; 
    background: var(--bg-light); 
    padding: 4px 10px; 
    border-radius: 100px; 
    color: var(--brand-blue); 
    text-transform: uppercase; 
}

.app-card h3 { 
    font-family: 'Outfit'; 
    font-size: 20px; 
    margin-bottom: 8px; 
}

.app-card p { 
    color: var(--text-muted); 
    font-size: 14px; 
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.project-hero { display: flex; gap: 40px; align-items: center; margin-bottom: 48px; }
.project-img { width: 140px; height: 140px; border-radius: 32px; box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.category-label { color: var(--brand-green); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: 1px; }
.project-meta h2 { font-family: 'Outfit'; font-size: 40px; margin-bottom: 8px; }
.project-meta p { font-size: 17px; color: var(--text-muted); }
.project-content { display: grid; grid-template-columns: 1.8fr 1fr; gap: 48px; }

.sidebar-card { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 24px; position: sticky; top: 120px; }
.spec-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dotted var(--border); font-size: 14px; }

.rich-text { color: var(--text-muted); font-size: 15px; }
.rich-text p { margin-bottom: 14px; }
.serious-legal { text-align: justify; color: #374151; }
.serious-legal p { margin-bottom: 18px; }

.legal-card { border-radius: 4px; border: 1px solid #d1d5db; background: #fff; padding: 60px; }
.legal-summary { background: #f0f7ff; padding: 24px 32px; border-left: 4px solid var(--brand-blue); border-radius: 0 12px 12px 0; margin-bottom: 40px; }
.legal-summary strong { color: var(--brand-blue); display: flex; align-items: center; font-size: 18px; margin-bottom: 12px; }
.legal-summary li { position: relative; padding-left: 20px; margin-bottom: 8px; color: var(--text-muted); font-weight: 500; font-size: 14px; list-style: none; }
.legal-summary li::before { content: '✓'; position: absolute; left: 0; color: var(--brand-blue); font-weight: bold; }

.legal-footer { margin-top: 60px; padding-top: 40px; border-top: 1px double #e5e7eb; background: #fafafa; padding: 30px; border-radius: 8px; }
.support-badge { display: inline-block; margin-top: 12px; padding: 8px 16px; background: var(--brand-blue); color: white; text-decoration: none; font-weight: 600; border-radius: 4px; font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 24px; border-radius: 12px; font-weight: 600; cursor: pointer; transition: 0.2s; font-size: 14px; border: none; height: 44px; }
.btn-blue { background: var(--brand-blue); color: white; box-shadow: 0 4px 10px rgba(0, 97, 255, 0.3); }
.btn-blue:hover { background: #0052cc; box-shadow: 0 6px 14px rgba(0, 97, 255, 0.4); transform: translateY(-1px); }
.btn-outline { background: #ffffff; border: 2px solid #94a3b8; color: var(--text-dark); box-shadow: 0 2px 5px rgba(0,0,0,0.08); font-weight: 700; }
.btn-outline:hover { border-color: #475569; background: #f1f5f9; }
.btn-back { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); text-decoration: none; font-weight: 600; margin-bottom: 24px; background: var(--bg-light); padding: 8px 16px; border-radius: 100px; font-size: 14px; }

.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.app-list-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.app-list-table th { text-align: left; padding: 14px; background: var(--bg-light); font-size: 12px; color: var(--text-muted); text-transform: uppercase; }
.app-list-table td { padding: 16px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }

.status-pill { padding: 4px 10px; border-radius: 100px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-pill.published { background: #e6f4ea; color: #1e8e3e; }
.status-pill.private { background: #fff4e5; color: #b05a00; }
.status-pill.draft { background: #f1f3f4; color: #5f6368; }

.admin-form-expanded .form-group { margin-bottom: 24px; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--text-dark); display: block; margin-bottom: 8px; }
.form-group input, .form-group textarea, .form-group select { 
    width: 100%; 
    padding: 12px; 
    border: 2px solid #94a3b8; 
    border-radius: 8px; 
    font-family: inherit; 
    font-size: 14px; 
    background-color: #f1f5f9;
    color: #0f172a;
    transition: 0.2s ease;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    background-color: #ffffff;
    border-color: var(--brand-blue);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 97, 255, 0.25);
}
.tall-textarea { min-height: 250px; resize: vertical; }
.xl-textarea { min-height: 450px; resize: vertical; }
.checkbox-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; background: var(--bg-light); padding: 15px; border-radius: 10px; }
.full-width { grid-column: 1 / -1; }

.toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 16px 32px; border-radius: 12px; z-index: 9999; display: none; }
.toast.show { display: flex; animation: slideUp 0.3s ease; }

@keyframes slideUp { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

@media (max-width: 900px) {
    .project-content { grid-template-columns: 1fr; }
    .project-hero { flex-direction: column; text-align: center; }
    .form-grid { grid-template-columns: 1fr; }
}

footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(4px);
}
.modal-card {
    background: #fff;
    padding: 32px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: scale(0.95);
    opacity: 0;
    animation: modalShow 0.3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes modalShow {
    to { transform: scale(1); opacity: 1; }
}
.modal-card h3 { font-family: 'Outfit'; font-size: 24px; margin-bottom: 12px; color: var(--text-dark); }
.modal-card p { color: var(--text-muted); margin-bottom: 24px; font-size: 15px; }
.modal-actions { display: flex; gap: 16px; justify-content: center; }
.modal-actions .btn { flex: 1; }