@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap');

:root {
    --primary: #0A68FF; --secondary: #FFB800; --accent: #E44D26; --light: #F8F9FA;
    --dark: #121212; --success: #20C997; --danger: #DC3545; --warning: #FFC107;
    --card-bg: #FFFFFF; --shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
    --border-radius: 16px; --border-color: #E9ECEF;
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: #F5F7FA; color: var(--dark); line-height: 1.6; }

/* --- Auth Screen Styles --- */
#auth-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #F5F7FA; display: flex; align-items: center; justify-content: center; z-index: 2000; }
.login-container { background: white; padding: 40px; border-radius: var(--border-radius); box-shadow: var(--shadow); width: 100%; max-width: 450px; text-align: center; animation: fadeIn 0.5s ease-out; }
.login-header { margin-bottom: 20px; }
.login-header h2 { margin-bottom: 5px; }
.auth-subtitle { color: #6C757D; margin-bottom: 30px; }
.btn-login { width: 100%; padding: 15px; font-size: 16px; }
.login-error-message { color: var(--danger); margin-top: 15px; font-weight: 500; height: 20px; }
.auth-switch { margin-top: 25px; font-size: 15px; color: #6C757D; }
.auth-switch a { color: var(--primary); text-decoration: none; font-weight: 600; cursor: pointer; }
.auth-switch a:hover { text-decoration: underline; }

/* --- Main App Styles --- */
.container { max-width: 1600px; margin: 0 auto; padding: 20px; }
header { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; margin-bottom: 30px; border-bottom: 1px solid var(--border-color); }
.logo-text h1 { font-size: 26px; font-weight: 900; background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.logo-text p { font-size: 15px; color: #6C757D; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.user-info { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.user-info .avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 18px; }
.user-details { display: flex; flex-direction: column; line-height: 1.2; align-items: flex-start; }
.brand-name { font-weight: 600; font-size: 16px; color: var(--dark); }
.user-name { font-weight: 500; font-size: 13px; color: #6C757D; }
#user-logout-btn { color: var(--danger); font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 2px; }
#user-logout-btn:hover { text-decoration: underline; }

.dashboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--card-bg); border-radius: var(--border-radius); padding: 25px; box-shadow: var(--shadow); transition: transform 0.3s ease, box-shadow 0.3s ease; border: 1px solid var(--border-color); animation: slideUp 0.5s ease; }
.stat-card:hover { transform: translateY(-6px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.stat-card h3 { font-size: 15px; color: #6C757D; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; font-weight: 500;}
.stat-card .value { font-size: 32px; font-weight: 700; color: var(--dark); }

.content-container { display: grid; grid-template-columns: 320px 1fr; gap: 30px; }
.sidebar { background: var(--card-bg); border-radius: var(--border-radius); padding: 25px; box-shadow: var(--shadow); height: fit-content; animation: slideLeft 0.5s ease; border: 1px solid var(--border-color); position: sticky; top: 20px; }
.sidebar h2 { font-size: 20px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); color: var(--primary); display: flex; align-items: center; gap: 10px; }
.category-list { list-style: none; }
.category-item { padding: 14px 18px; border-radius: 10px; cursor: pointer; margin-bottom: 8px; transition: all 0.3s ease; display: flex; align-items: center; justify-content: space-between; font-weight: 500; font-size: 15px; }
.category-item:hover { background: #F1F3F5; color: var(--primary); }
.category-item.active { background: linear-gradient(90deg, rgba(10, 104, 255, 0.1), rgba(255, 184, 0, 0.1)); color: var(--primary); font-weight: 600; }
.category-item .count { background: #E9ECEF; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #495057;}
.category-item.active .count { background: var(--primary); color: white; }

.content-area { background: var(--card-bg); border-radius: var(--border-radius); padding: 30px; box-shadow: var(--shadow); animation: slideRight 0.5s ease; border: 1px solid var(--border-color); }
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.content-header h2 { font-size: 24px; color: var(--dark); font-weight: 700; }
.search-box { position: relative; }
.search-box input { padding: 12px 20px 12px 45px; border: 1px solid var(--border-color); border-radius: 10px; width: 250px; transition: all 0.3s ease; font-size: 15px; }
.search-box input:focus { outline: none; border-color: var(--primary); width: 300px; }
.search-box i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #ADB5BD; }
        
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 25px; min-height: 200px; }
.content-card { background: white; border-radius: var(--border-radius); overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: all 0.3s ease; border: 1px solid var(--border-color); animation: fadeIn 0.5s ease; display: flex; flex-direction: column; cursor: pointer; position: relative; }
.content-card:hover { transform: translateY(-8px); box-shadow: var(--shadow); border-color: var(--primary); }
.content-image { height: 180px; background: linear-gradient(135deg, rgba(10, 104, 255, 0.05), rgba(255, 184, 0, 0.05)); display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 44px; }
.content-body { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.content-tags { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.content-tag { background: #F1F3F5; color: #495057; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.content-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; color: var(--dark); line-height: 1.4; }
.content-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 1px solid var(--border-color); margin-top: auto; }
.content-format { font-size: 14px; color: var(--dark); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.content-category-label { font-size: 13px; color: #6C757D; font-weight: 500; }
.used-by-tag { position: absolute; top: 15px; right: 15px; background-color: rgba(0, 0, 0, 0.7); color: white; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; z-index: 3; backdrop-filter: blur(4px); }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(18, 18, 18, 0.6); display: none; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity 0.3s ease; backdrop-filter: blur(8px); }
.modal.active { display: flex; opacity: 1; }
.modal-content { background: white; border-radius: var(--border-radius); width: 95%; max-width: 900px; max-height: 90vh; transform: scale(0.95); transition: transform 0.3s ease; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; }
.modal.active .modal-content { transform: scale(1); }
.modal-header { padding: 25px 30px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: white; z-index: 10; flex-shrink: 0; }
.modal-header h3 { font-size: 22px; color: var(--dark); font-weight: 700; }
.modal-close { background: #F1F3F5; border: none; font-size: 20px; cursor: pointer; color: #6C757D; transition: all 0.3s ease; width: 40px; height: 40px; border-radius: 50%;}
.modal-close:hover { color: var(--danger); transform: rotate(90deg); background: #F8D7DA; }
.modal-body { padding: 30px; flex-grow: 1; overflow-y: auto; }
.content-detail { margin-bottom: 30px; }
.content-detail h4 { font-size: 18px; margin-bottom: 15px; color: var(--dark); display: flex; align-items: center; gap: 10px; font-weight: 600; }
.content-detail h4 i { color: var(--primary); }
.content-detail pre { white-space: pre-wrap; word-wrap: break-word; font-family: 'SF Mono', 'Menlo', 'Courier New', monospace; font-size: 14px; background: #F8F9FA; padding: 20px; border-radius: 12px; border: 1px solid var(--border-color); line-height: 1.7; color: #212529; }
.copy-section { position: relative; }
.copy-btn { position: absolute; top: 15px; right: 15px; background: white; color: var(--primary); border: 1px solid var(--border-color); padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all 0.3s ease; font-weight: 600; }
.copy-btn:hover { background: var(--primary); color: white; border-color: var(--primary);}
.modal-footer { padding: 20px 30px; border-top: 1px solid var(--border-color); display: flex; align-items: center; gap: 12px; position: sticky; bottom: 0; background: #F8F9FA; flex-shrink: 0;}
.modal-footer button.modal-close { margin-right: auto; }
.modal-footer #edit-btn { margin-right: auto; }
.btn { padding: 12px 25px; border-radius: 10px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; border: none; font-size: 15px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #0056D6; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #19A47D; }
.btn-outline { background: white; border: 1px solid #CED4DA; color: var(--dark); }
.btn-outline:hover { border-color: var(--dark); }
.btn-warning { background: var(--warning); color: var(--dark); }
.btn-warning:hover { background: #e6a800; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c9302c; }

.assign-role-body { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 30px; }
.btn-role { background-color: #F1F3F5; color: var(--dark); text-align: center; padding: 20px; font-size: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; border: 1px solid var(--border-color); }
.btn-role:hover { background-color: var(--primary); color: white; border-color: var(--primary); }
.btn-role i { font-size: 24px; }

.toast { position: fixed; bottom: 25px; right: 25px; background: var(--dark); color: white; padding: 18px 28px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); display: flex; align-items: center; gap: 12px; transform: translateY(120px); opacity: 0; transition: all 0.4s cubic-bezier(0.215, 0.610, 0.355, 1); z-index: 2001; font-weight: 500; }
.toast.show { transform: translateY(0); opacity: 1; }
.empty-state { text-align: center; padding: 60px 20px; color: #6C757D; grid-column: 1 / -1; }
.empty-state i { font-size: 50px; margin-bottom: 20px; color: var(--border-color); }
.empty-state h3 { font-size: 20px; margin-bottom: 10px; color: var(--dark); }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--dark); font-size: 15px; text-align: left;}
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #CED4DA; font-size: 15px; transition: border-color 0.3s ease; background-color: #F8F9FA; }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); background-color: white; }

#admin-users-list table { width: 100%; border-collapse: collapse; }
#admin-users-list th, #admin-users-list td { padding: 12px 15px; border-bottom: 1px solid var(--border-color); text-align: left; }
#admin-users-list th { background-color: #F8F9FA; font-weight: 600; }
#admin-users-list tr:last-child td { border-bottom: none; }
.btn-remove-user { background-color: #f1f3f5; color: var(--danger); border: 1px solid var(--border-color); padding: 5px 10px; font-size: 12px; font-weight: 600; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; }
.btn-remove-user:hover { background-color: var(--danger); color: white; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 1200px) { .dashboard { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 992px) { .content-container { grid-template-columns: 1fr; } .sidebar { display: none; } }
@media (max-width: 768px) {
    .dashboard { grid-template-columns: 1fr; }
    .header-actions { gap: 10px; }
    .content-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .search-filter { width: 100%; }
    .search-box input, .search-box input:focus { width: 100%; }
}