/* ============================================================
   Arun Tech — Admin Panel Styles
   Dark Glassmorphism Design
   ============================================================ */

:root {
    --bg-dark:       #0a0a12;
    --bg-card:       #12121e;
    --bg-card2:      #1a1a2e;
    --bg-sidebar:    #0d0d1a;
    --accent:        #6c63ff;
    --accent-hover:  #5a52e8;
    --accent-glow:   rgba(108, 99, 255, 0.3);
    --danger:        #ff4757;
    --danger-hover:  #e84057;
    --success:       #00d4aa;
    --warning:       #ffa502;
    --text-primary:  #e8e8f0;
    --text-secondary:#9090a8;
    --border:        rgba(255,255,255,0.08);
    --shadow-card:   0 8px 32px rgba(0,0,0,0.4);
    --radius:        14px;
    --radius-sm:     8px;
    --transition:    0.25s ease;
    --font:          'Space Grotesk', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.login-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: orbFloat 8s ease-in-out infinite alternate;
}
.orb-1 { width: 400px; height: 400px; background: #6c63ff; top: -100px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 300px; height: 300px; background: #ff6b9d; bottom: -80px; right: -60px; animation-delay: 2s; }
.orb-3 { width: 250px; height: 250px; background: #00d4aa; top: 50%; left: 60%; animation-delay: 4s; }

@keyframes orbFloat {
    from { transform: translateY(0) scale(1); }
    to   { transform: translateY(-30px) scale(1.05); }
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
}

.login-card {
    background: rgba(18, 18, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-card), 0 0 60px rgba(108,99,255,0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #6c63ff, #ff6b9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-form { display: flex; flex-direction: column; gap: 1.2rem; }

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; gap: 0.4rem; }

.form-control {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(108,99,255,0.05);
}
.form-control::placeholder { color: rgba(144,144,168,0.5); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.password-wrapper { position: relative; }
.toggle-pwd {
    position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 0.25rem; font-size: 1rem; transition: color var(--transition);
}
.toggle-pwd:hover { color: var(--accent); }

.btn-login {
    background: linear-gradient(135deg, var(--accent), #5a52e8);
    border: none; border-radius: var(--radius-sm);
    color: #fff; cursor: pointer; font-family: var(--font);
    font-size: 1rem; font-weight: 600; padding: 0.85rem 1.5rem;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    transition: all var(--transition); margin-top: 0.5rem;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 25px var(--accent-glow); }
.btn-login:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.login-footer { text-align: center; margin-top: 1.5rem; }
.back-link { color: var(--text-secondary); text-decoration: none; font-size: 0.88rem; transition: color var(--transition); display: inline-flex; align-items: center; gap: 0.4rem; }
.back-link:hover { color: var(--accent); }

/* Alert */
.alert { border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 1rem; padding: 0.75rem 1rem; display: flex; align-items: flex-start; gap: 0.5rem; }
.alert-error { background: rgba(255,71,87,0.15); border: 1px solid rgba(255,71,87,0.3); color: #ff6b7a; }

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

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-logo {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 1rem; border-radius: var(--radius-sm);
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.9rem; font-weight: 500; transition: all var(--transition);
}
.nav-item:hover { background: rgba(108,99,255,0.15); color: var(--text-primary); }
.nav-item.active { background: rgba(108,99,255,0.2); color: var(--accent); }
.nav-item--danger { color: #ff6b7a; margin-top: auto; }
.nav-item--danger:hover { background: rgba(255,71,87,0.15); }

.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 0.6rem;
    color: var(--text-secondary); font-size: 0.85rem;
}

/* Main Area */
.admin-main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-dark);
}

.admin-topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(10,10,18,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
}

.admin-page-title { font-size: 1.1rem; font-weight: 600; flex: 1; }

.sidebar-toggle {
    display: none; background: none; border: none;
    color: var(--text-primary); font-size: 1.4rem; cursor: pointer;
}

.btn-add, .btn-back, .btn-cancel {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500; text-decoration: none;
    cursor: pointer; transition: all var(--transition);
}
.btn-add { background: var(--accent); color: #fff; border: none; }
.btn-add:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-back, .btn-cancel { background: rgba(255,255,255,0.07); color: var(--text-primary); border: 1px solid var(--border); }
.btn-back:hover, .btn-cancel:hover { background: rgba(255,255,255,0.12); }

.admin-content {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex; flex-direction: column; gap: 1.5rem;
}

/* Flash */
.flash {
    border-radius: var(--radius-sm); padding: 0.9rem 1.2rem;
    display: flex; align-items: flex-start; gap: 0.6rem;
    font-size: 0.9rem; position: relative; animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity:0; transform: translateY(-10px); } to { opacity:1; transform: translateY(0); } }
.flash--success { background: rgba(0,212,170,0.12); border: 1px solid rgba(0,212,170,0.3); color: var(--success); }
.flash--error   { background: rgba(255,71,87,0.12); border: 1px solid rgba(255,71,87,0.3); color: var(--danger); }
.flash-close { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background:none; border:none; color:inherit; cursor:pointer; font-size:1.1rem; opacity:0.7; }
.flash-close:hover { opacity:1; }

/* Stat Grid */
.stat-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 1rem;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: var(--shadow-card); transition: transform var(--transition);
}
.stat-card:hover { transform: translateY(-3px); }
.stat-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-icon--blue   { background: rgba(108,99,255,0.15); color: #6c63ff; }
.stat-icon--green  { background: rgba(0,212,170,0.15);  color: #00d4aa; }
.stat-icon--red    { background: rgba(255,71,87,0.15);  color: #ff4757; }
.stat-icon--purple { background: rgba(255,107,157,0.15); color: #ff6b9d; }
.stat-num { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-lbl { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* Section Card */
.section-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden;
}
.section-card-header {
    padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.section-card-header h2 { font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; flex: 1; }

/* Category Chips */
.cat-chips { padding: 1.25rem 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cat-chip { display: flex; align-items: center; gap: 0.6rem; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 50px; padding: 0.4rem 1rem; }
.cat-name { font-size: 0.85rem; }
.cat-count { font-size: 0.8rem; font-weight: 700; background: var(--accent); color: #fff; border-radius: 50px; padding: 0.1rem 0.5rem; }

/* Table Search */
.table-search-wrap { display: flex; align-items: center; gap: 0.5rem; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.4rem 0.8rem; }
.table-search { background: none; border: none; color: var(--text-primary); font-family: var(--font); font-size: 0.85rem; outline: none; width: 180px; }
.table-search::placeholder { color: rgba(144,144,168,0.5); }

/* Table */
.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table thead tr { background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border); }
.admin-table th { padding: 0.8rem 1rem; text-align: left; color: var(--text-secondary); font-weight: 600; white-space: nowrap; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.admin-table td { padding: 0.85rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.admin-table tbody tr:hover { background: rgba(108,99,255,0.05); }
.admin-table tbody tr:last-child td { border-bottom: none; }

.td-id { color: var(--text-secondary); font-size: 0.8rem; width: 40px; }
.td-img { width: 60px; }
.project-thumb { width: 50px; height: 38px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.td-title strong { display: block; margin-bottom: 0.2rem; }
.td-desc { color: var(--text-secondary); font-size: 0.78rem; }
.td-url a { color: var(--accent); text-decoration: none; font-size: 0.82rem; display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.td-url a:hover { text-decoration: underline; }
.td-actions { white-space: nowrap; }

/* Badge */
.badge-cat { padding: 0.25rem 0.65rem; border-radius: 50px; font-size: 0.75rem; font-weight: 500; }
.badge-cat--business      { background: rgba(108,99,255,0.15); color: #6c63ff; }
.badge-cat--education     { background: rgba(0,212,170,0.15);  color: #00d4aa; }
.badge-cat--ecommerce     { background: rgba(255,107,157,0.15); color: #ff6b9d; }
.badge-cat--import-export { background: rgba(255,165,2,0.15);  color: #ffa502; }
.badge-cat--marketing     { background: rgba(0,191,255,0.15);  color: #00bfff; }
.badge-cat--landing       { background: rgba(255,71,87,0.15);  color: #ff4757; }

/* Status Badge */
.status-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.7rem; border-radius: 50px; font-size: 0.75rem; font-weight: 500; }
.status-badge i { font-size: 0.55rem; }
.status-badge--active   { background: rgba(0,212,170,0.12); color: #00d4aa; }
.status-badge--inactive { background: rgba(255,71,87,0.12); color: #ff4757; }

/* Action Buttons */
.action-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 7px; font-size: 0.85rem; margin: 0 2px; transition: all var(--transition); text-decoration: none; }
.action-btn--edit { background: rgba(108,99,255,0.15); color: #6c63ff; }
.action-btn--edit:hover { background: var(--accent); color: #fff; transform: scale(1.1); }
.action-btn--del { background: rgba(255,71,87,0.12); color: #ff4757; }
.action-btn--del:hover { background: var(--danger); color: #fff; transform: scale(1.1); }

/* ============================================================
   PROJECT FORM
   ============================================================ */
.project-form { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group--center { display: flex; align-items: center; }
.req { color: var(--danger); }
.form-group small { color: var(--text-secondary); font-size: 0.78rem; }

/* Toggle Switch */
.toggle-label { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; }
.toggle-input { display: none; }
.toggle-slider {
    position: relative; width: 44px; height: 24px;
    background: rgba(255,255,255,0.12); border-radius: 50px; flex-shrink: 0;
    transition: background var(--transition);
}
.toggle-slider::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; background: #fff; border-radius: 50%;
    transition: transform var(--transition);
}
.toggle-input:checked + .toggle-slider { background: var(--accent); }
.toggle-input:checked + .toggle-slider::after { transform: translateX(20px); }
.toggle-text { font-size: 0.88rem; }

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border); border-radius: var(--radius-sm);
    transition: border-color var(--transition); cursor: pointer; overflow: hidden;
    min-height: 120px; display: flex; align-items: center; justify-content: center;
    position: relative;
}
.file-upload-area:hover { border-color: var(--accent); }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; z-index: 2; }
.file-upload-placeholder { text-align: center; padding: 1.5rem; color: var(--text-secondary); }
.file-upload-placeholder i { font-size: 2rem; margin-bottom: 0.5rem; display: block; color: var(--accent); }
.file-upload-placeholder p { font-size: 0.88rem; margin-bottom: 0.25rem; }
.file-upload-placeholder small { font-size: 0.75rem; }
.image-preview { width: 100%; max-height: 220px; object-fit: contain; }
.current-image-wrap { padding: 0.5rem; background: rgba(255,255,255,0.03); border-radius: var(--radius-sm); }
.current-image { max-width: 200px; max-height: 130px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

/* Form Actions */
.form-actions { display: flex; gap: 0.75rem; padding-top: 0.5rem; }
.btn-submit {
    background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
    font-family: var(--font); font-size: 0.9rem; font-weight: 600; padding: 0.7rem 1.5rem;
    cursor: pointer; display: flex; align-items: center; gap: 0.4rem;
    transition: all var(--transition); box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-submit:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar--open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .form-row { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .td-desc, .td-url { display: none; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .admin-content { padding: 1rem; }
    .login-card { padding: 1.75rem 1.25rem; }
    .form-actions { flex-direction: column; }
}
