/* --- Admin Stylesheet for IT Job Institute --- */

:root {
  --bg-dark: hsl(222, 24%, 6%);
  --bg-card: hsl(220, 20%, 10%);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-orange-glass: rgba(249, 115, 22, 0.15);
  
  --primary: hsl(24, 95%, 53%); /* Vibrant Orange */
  --primary-hover: hsl(24, 95%, 45%);
  --primary-glow: rgba(249, 115, 22, 0.25);
  
  --text-white: hsl(210, 20%, 98%);
  --text-gray-100: hsl(210, 15%, 85%);
  --text-gray-200: hsl(210, 10%, 70%);
  --text-gray-300: hsl(210, 10%, 55%);
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 35px var(--primary-glow);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Outfit', sans-serif;
}

/* --- Base & Reset --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-gray-100);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* --- Background Decor --- */
.space-bg-decor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}

.orb-1 {
  top: -10%;
  right: -10%;
  width: 40vw;
  height: 40vw;
  background: var(--primary);
}

.orb-2 {
  bottom: -15%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: hsl(260, 80%, 40%);
}

/* --- Text Gradient --- */
.text-gradient {
  background: linear-gradient(135deg, var(--text-white) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Login Page --- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.login-card:hover {
  border-color: rgba(249, 115, 22, 0.3);
}

.brand-header {
  margin-bottom: 30px;
}

.brand-logo {
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.brand-logo .logo-icon {
  font-size: 28px;
}

.brand-header .subtitle {
  font-size: 14px;
  color: var(--text-gray-300);
  margin-top: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* --- Forms Styles --- */
.login-form {
  text-align: left;
}

.error-msg {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: hsl(0, 85%, 65%);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--text-gray-200);
  margin-bottom: 8px;
  font-weight: 500;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-gray-300);
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: rgba(10, 15, 30, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-white);
  font-family: inherit;
  font-size: 15px;
  transition: all 0.2s ease;
  outline: none;
}

.input-wrapper input {
  padding-left: 45px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.25);
  background: rgba(10, 15, 30, 0.8);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-login {
  background: var(--primary);
  color: var(--text-white);
  width: 100%;
  margin-top: 10px;
}

.btn-login:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Dashboard Header --- */
.dashboard-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dashboard-header {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.welcome-user {
  font-size: 15px;
  color: var(--text-gray-200);
}

.btn-logout {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-white);
  padding: 8px 16px;
  font-size: 14px;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: hsl(0, 85%, 65%);
}

/* --- Dashboard Layout --- */
.dashboard-main {
  flex: 1;
  padding: 40px 24px;
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.section-header h2 {
  font-size: 28px;
  font-weight: 600;
}

.btn-add {
  background: var(--primary);
  color: var(--text-white);
  font-size: 15px;
  padding: 10px 20px;
}

.btn-add:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.toast.success {
  background: hsl(142, 76%, 36%);
  color: var(--text-white);
}

.toast.error {
  background: hsl(350, 76%, 45%);
  color: var(--text-white);
}

/* --- Courses Grid --- */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.course-admin-card {
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.course-admin-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.card-meta .category-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 1px;
}

.card-meta h3 {
  font-size: 20px;
  margin: 6px 0 10px 0;
}

.card-meta .desc {
  font-size: 14px;
  color: var(--text-gray-200);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pdf-status {
  font-size: 13px;
}

.badge-pdf {
  color: hsl(142, 70%, 50%);
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-no-pdf {
  color: var(--text-gray-300);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.card-actions {
  display: flex;
  gap: 12px;
}

.card-actions button {
  flex: 1;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-edit {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-white);
}

.btn-edit:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: hsl(0, 85%, 65%);
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

/* --- Modals --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: hsl(220, 20%, 8%);
  border: 1px solid var(--border-glass);
  width: 90%;
  max-width: 960px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: hsl(220, 20%, 8%);
  z-index: 10;
}

.modal-header h3 {
  font-size: 22px;
}

.close-modal-btn {
  font-size: 28px;
  cursor: pointer;
  color: var(--text-gray-300);
}

.close-modal-btn:hover {
  color: var(--text-white);
}

#course-form {
  padding: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 25px;
}

.form-row {
  display: flex;
  gap: 15px;
}

.col-6 {
  flex: 0 0 calc(50% - 7.5px);
}

.col-4 {
  flex: 0 0 calc(33.33% - 10px);
}

.modal-footer {
  border-top: 1px solid var(--border-glass);
  padding: 20px 30px;
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  position: sticky;
  bottom: 0;
  background: hsl(220, 20%, 8%);
  z-index: 10;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-white);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
}

/* --- Dynamic Lists (Modules & Projects) --- */
.dynamic-editor-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 15px;
}

.section-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-subheader label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-white);
}

.btn-mini {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-transform: uppercase;
}

.btn-mini:hover {
  background: var(--primary);
  color: var(--text-white);
}

.dynamic-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 5px;
}

.dynamic-item-card {
  background: rgba(10, 15, 30, 0.5);
  border: 1px solid var(--border-glass);
  padding: 12px;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.card-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-fields input,
.card-fields textarea {
  padding: 8px 12px;
  font-size: 13px;
}

.btn-remove {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: hsl(0, 85%, 65%);
  width: 24px;
  height: 24px;
  font-size: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-remove:hover {
  background: rgba(239, 68, 68, 0.3);
  color: white;
}

/* --- File Upload Styling --- */
.file-upload-wrapper {
  background: rgba(10, 15, 30, 0.6);
  border: 1px dashed var(--border-glass);
  padding: 15px;
  border-radius: var(--radius-sm);
}

.file-status-info {
  margin-top: 10px;
  font-size: 13px;
}

.pdf-link-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pdf-link-meta a {
  color: var(--primary);
  font-weight: 500;
}

.remove-pdf-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: hsl(0, 85%, 65%);
  cursor: pointer;
}

.loader-placeholder,
.empty-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-gray-300);
  background: rgba(15, 23, 42, 0.25);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-glass);
}

.empty-placeholder.error {
  color: hsl(0, 85%, 65%);
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Animations --- */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .modal-content {
    width: 95%;
  }
}
