@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    /* Color Palette - Ocean Blue Theme */
    --deep-space-blue: #012a4aff;
    --yale-blue: #013a63ff;
    --yale-blue-2: #01497cff;
    --yale-blue-3: #014f86ff;
    --rich-cerulean: #2a6f97ff;
    --cerulean: #2c7da0ff;
    --air-force-blue: #468fafff;
    --steel-blue: #61a5c2ff;
    --sky-blue-light: #89c2d9ff;
    --light-blue: #a9d6e5ff;

    --primary: var(--cerulean);
    --primary-hover: var(--rich-cerulean);
    --primary-light: rgba(169, 214, 229, 0.5); 
    
    --secondary: var(--steel-blue);
    --secondary-hover: var(--air-force-blue);
    
    --success: var(--cerulean);
    --success-hover: var(--rich-cerulean);
    --success-bg: rgba(44, 125, 160, 0.1);
    --success-text: var(--yale-blue-2);
    
    --danger: #d9534f;
    --danger-hover: #c9302c;
    --danger-bg: #f2dede;
    --danger-text: #a94442;
    
    --bg-main: #f0f8ff; /* Alice Blue for clean contrast */
    --bg-card: #ffffff;
    
    --text-main: var(--deep-space-blue);
    --text-muted: var(--yale-blue-3);
    --text-light: var(--rich-cerulean);
    
    --border: var(--sky-blue-light);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 15px rgba(44, 125, 160, 0.3);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --header-bg: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] {
    --bg-main: var(--deep-space-blue);
    --bg-card: var(--yale-blue);
    
    --text-main: var(--light-blue);
    --text-muted: var(--sky-blue-light);
    --text-light: rgba(169, 214, 229, 0.6);
    
    --border: var(--yale-blue-3);
    --header-bg: rgba(1, 42, 74, 0.85);
    
    /* Ocean primary colors for eye comfort */
    --primary: var(--sky-blue-light);
    --primary-hover: var(--light-blue);
    --primary-light: rgba(169, 214, 229, 0.15);
    
    /* Darken shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
}

/* ================== THEME SWITCH ================== */
/* The switch - the box around the slider */
.switch {
  font-size: 15px; /* Scaled slightly to fit header nicely */
  position: relative;
  display: inline-block;
  width: 4em;
  height: 2.2em;
  border-radius: 30px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--yale-blue); /* Dark mode background */
  transition: 0.4s;
  border-radius: 30px;
  overflow: hidden;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.2em;
  width: 1.2em;
  border-radius: 20px;
  left: 0.5em;
  bottom: 0.5em;
  transition: 0.4s;
  transition-timing-function: cubic-bezier(0.81, -0.04, 0.38, 1.5);
  box-shadow: inset 8px -4px 0px 0px #fff;
}

.switch input:checked + .slider {
  background-color: var(--sky-blue-light); /* Light mode background */
}

.switch input:checked + .slider:before {
  transform: translateX(1.8em);
  box-shadow: inset 15px -4px 0px 15px #ffcf48;
}

.star {
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  width: 5px;
  transition: all 0.4s;
  height: 5px;
}

.star_1 {
  left: 2.5em;
  top: 0.5em;
}

.star_2 {
  left: 2.2em;
  top: 1.2em;
}

.star_3 {
  left: 3em;
  top: 0.9em;
}

.switch input:checked ~ .slider .star {
  opacity: 0;
}

.cloud {
  width: 3.5em;
  height: 2em;
  border-radius: 20px;
  background-color: #fff;
  position: absolute;
  bottom: -1.0em;
  left: -0.5em;
  opacity: 0;
  transition: all 0.4s;
}

.switch input:checked ~ .slider .cloud {
  opacity: 1;
}

* {
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg-main);
}

body {
    background: transparent;
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ======== ANIMATED BACKGROUND BLOBS ======== */
body::before, body::after {
    content: '';
    position: fixed;
    width: 50vw;
    height: 50vw;
    max-width: 600px;
    max-height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    animation: blob-float 25s infinite ease-in-out alternate;
    pointer-events: none;
}

body::before {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, var(--sky-blue-light), transparent 70%);
}

body::after {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, var(--yale-blue-3), transparent 70%);
    animation-delay: -12s;
}

[data-theme="dark"] body::before {
    background: radial-gradient(circle, rgba(169, 214, 229, 0.2), transparent 70%);
}

[data-theme="dark"] body::after {
    background: radial-gradient(circle, rgba(44, 125, 160, 0.2), transparent 70%);
}

@keyframes blob-float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(10vw, 5vh) scale(1.1); }
    66% { transform: translate(-5vw, 15vh) scale(0.9); }
    100% { transform: translate(5vw, -5vh) scale(1.05); }
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 0 15px;
    position: relative;
    z-index: 1; /* Ensures content is above the blobs */
}

/* ================== HEADER ================== */
.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
    transition: var(--transition);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

/* ================== GLASS RADIO NAVIGATION ================== */
.glass-radio-group {
  --bg: rgba(0, 0, 0, 0.03); /* Lighter for light mode header */
  --text: var(--text-main);

  display: flex;
  position: relative;
  background: var(--bg);
  border-radius: 1rem;
  backdrop-filter: blur(12px);
  box-shadow:
    inset 1px 1px 4px rgba(255, 255, 255, 0.5),
    inset -1px -1px 6px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  width: fit-content;
}

[data-theme="dark"] .glass-radio-group {
    --bg: rgba(255, 255, 255, 0.06);
    --text: #e5e5e5;
    box-shadow:
        inset 1px 1px 4px rgba(255, 255, 255, 0.2),
        inset -1px -1px 6px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.15);
}

.glass-radio-group input {
  display: none;
}

.glass-radio-group label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  font-size: 14px;
  padding: 0.8rem 1.6rem;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text);
  position: relative;
  z-index: 2;
  transition: color 0.3s ease-in-out;
  text-decoration: none;
}

.glass-radio-group label:hover {
  color: var(--primary);
}

[data-theme="dark"] .glass-radio-group label:hover {
    color: white;
}

.glass-radio-group input:checked + label {
  color: #000;
}

[data-theme="dark"] .glass-radio-group input:checked + label {
  color: #fff;
}

/* Logout specific styling in the group */
.glass-radio-group label.logout-label:hover {
    color: var(--danger);
}

.glass-glider {
  position: absolute;
  top: 0;
  bottom: 0;
  /* width will be set dynamically via inline style if tabs vary, but default to 1/3 */
  border-radius: 1rem;
  z-index: 1;
  transition:
    transform 0.5s cubic-bezier(0.37, 1.95, 0.66, 0.56),
    background 0.4s ease-in-out,
    box-shadow 0.4s ease-in-out;
}

/* The Glider styles (Platinum theme from Uiverse) */
.glass-radio-group input:checked ~ .glass-glider {
  background: linear-gradient(135deg, rgba(169, 214, 229, 0.4), var(--sky-blue-light));
  box-shadow:
    0 0 18px rgba(137, 194, 217, 0.5),
    0 0 10px rgba(169, 214, 229, 0.4) inset;
}

[data-theme="dark"] .glass-radio-group input:checked ~ .glass-glider {
    background: linear-gradient(135deg, rgba(42, 111, 151, 0.4), var(--yale-blue-3));
    box-shadow:
      0 0 18px rgba(42, 111, 151, 0.5),
      0 0 10px rgba(137, 194, 217, 0.2) inset;
}

/* ================== MAIN CONTENT ================== */
.content {
    flex: 1;
    padding: 40px 0;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================== CARDS ================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.5);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card:hover::before {
    opacity: 1;
}

.card h3, .card h4 {
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 1.25rem;
}

.card p {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

/* ================== BUTTONS ================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 1.3em 3em;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 500;
    color: var(--deep-space-blue);
    background-color: #fff;
    border: none;
    border-radius: 45px;
    box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease 0s;
    cursor: pointer;
    outline: none;
    gap: 8px; /* For icons */
}

.btn:hover, .btn:focus {
    background-color: var(--primary);
    box-shadow: 0px 15px 20px var(--primary-light);
    color: #fff;
    transform: translateY(-7px);
    outline: none;
}

.btn:active {
    transform: translateY(-1px);
}

/* Modifier for Danger/Delete buttons */
.btn-danger {
    color: #fff;
    background-color: var(--danger);
    box-shadow: 0px 8px 15px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover, .btn-danger:focus {
    background-color: var(--danger-hover);
    box-shadow: 0px 15px 20px rgba(239, 68, 68, 0.4);
}

/* Modifier for Secondary/Back buttons */
.btn-secondary {
    color: #fff;
    background-color: var(--text-muted);
}
.btn-secondary:hover {
    background-color: #4b5563;
    box-shadow: 0px 15px 20px rgba(107, 114, 128, 0.4);
}

/* Modifier for small buttons */
.btn-small {
    padding: 0.8em 1.8em;
    font-size: 11px;
    letter-spacing: 1.5px;
}

/* Button Grouping for pages */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 25px;
    margin-bottom: 25px;
}

/* ================== CHAT BOT CONTAINER ================== */
.container_chat_bot {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  width: 100%;
}

.container_chat_bot .container-chat-options {
  position: relative;
  display: flex;
  background: linear-gradient(
    to bottom right,
    var(--sky-blue-light),
    var(--cerulean),
    var(--yale-blue),
    var(--deep-space-blue)
  );
  border-radius: 16px;
  padding: 1.5px;
  overflow: hidden;
}

.container_chat_bot .container-chat-options::after {
  position: absolute;
  content: "";
  top: -10px;
  left: -10px;
  background: radial-gradient(
    ellipse at center,
    #ffffff,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.1),
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0)
  );
  width: 30px;
  height: 30px;
  filter: blur(1px);
}

.container_chat_bot .container-chat-options .chat {
  display: flex;
  flex-direction: column;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 15px;
  width: 100%;
  overflow: hidden;
}

.container_chat_bot .container-chat-options .chat .chat-bot {
  position: relative;
  display: flex;
}

.container_chat_bot .chat .chat-bot textarea {
  background-color: transparent;
  border-radius: 16px;
  border: none;
  width: 100%;
  height: 120px;
  color: #ffffff;
  font-family: 'Tajawal', sans-serif;
  font-size: 15px;
  font-weight: 400;
  padding: 15px;
  resize: none;
  outline: none;
}

.container_chat_bot .chat .chat-bot textarea::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.container_chat_bot .chat .chat-bot textarea::-webkit-scrollbar-track {
  background: transparent;
}

.container_chat_bot .chat .chat-bot textarea::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

.container_chat_bot .chat .chat-bot textarea::-webkit-scrollbar-thumb:hover {
  background: #555;
  cursor: pointer;
}

.container_chat_bot .chat .chat-bot textarea::placeholder {
  color: #a0aabf;
  transition: all 0.3s ease;
}

.container_chat_bot .chat .chat-bot textarea:focus::placeholder {
  color: #555;
}

.container_chat_bot .chat .options {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 10px 15px;
}

.container_chat_bot .chat .options .btns-add {
  display: flex;
  gap: 8px;
}

.container_chat_bot .chat .options .btns-add button {
  display: flex;
  color: rgba(255, 255, 255, 0.5);
  background-color: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.container_chat_bot .chat .options .btns-add button:hover {
  transform: translateY(-5px);
  color: #ffffff;
}

.container_chat_bot .chat .options .btn-submit {
  display: flex;
  padding: 2px;
  background-image: linear-gradient(to top, var(--yale-blue), var(--cerulean), var(--yale-blue));
  border-radius: 10px;
  box-shadow: inset 0 6px 2px -4px rgba(255, 255, 255, 0.5);
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.15s ease;
}

.container_chat_bot .chat .options .btn-submit i {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  backdrop-filter: blur(3px);
  color: #8b8b8b;
  font-size: 1.2rem;
}

.container_chat_bot .chat .options .btn-submit svg {
  transition: all 0.3s ease;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.container_chat_bot .chat .options .btn-submit:hover svg,
.container_chat_bot .chat .options .btn-submit:hover i {
  color: #f3f6fd;
  filter: drop-shadow(0 0 5px #ffffff);
}

.container_chat_bot .chat .options .btn-submit:focus svg,
.container_chat_bot .chat .options .btn-submit:focus i {
  color: #f3f6fd;
  filter: drop-shadow(0 0 5px #ffffff);
  transform: scale(1.2) rotate(45deg) translateX(-2px) translateY(1px);
}

.container_chat_bot .chat .options .btn-submit:active {
  transform: scale(0.92);
}

.container_chat_bot .tags {
  padding: 14px 0;
  display: flex;
  flex-wrap: wrap;
  color: #ffffff;
  font-size: 11px;
  gap: 8px;
}

.container_chat_bot .tags span {
  padding: 6px 12px;
  background-color: var(--yale-blue);
  border: 1.5px solid var(--yale-blue-3);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  color: var(--light-blue);
}

.container_chat_bot .tags span:hover {
    background-color: var(--cerulean);
    border-color: var(--sky-blue-light);
}

/* ================== FORMS & INPUTS ================== */
form {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    margin: 20px auto;
    border: 1px solid rgba(255,255,255,0.7);
}

form > .btn {
    width: 100%;
    margin-top: 15px;
}

label {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-main);
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

input::placeholder {
    color: var(--text-light);
}

/* ================== GRID & UTILITIES ================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.text-center {
    text-align: center;
}

h2.text-center {
    margin-bottom: 30px;
    color: var(--primary);
    font-weight: 800;
    font-size: 2rem;
    position: relative;
    display: inline-block;
}

h2.text-center::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.text-center > h2.text-center { 
    display: block; 
}
.text-center > h2.text-center::after { 
    left: 50%; 
}

/* ================== ALERTS ================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-right: 4px solid var(--success);
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-right: 4px solid var(--danger);
}

/* ================== TABLES ================== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
    margin-top: 30px;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: right;
    font-size: 15px;
}

.table thead {
    background: var(--bg-main);
}

.table th {
    padding: 16px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 16px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover td {
    background: var(--primary-light);
}

/* ================== FOOTER ================== */
.footer {
    background: #111827;
    color: #9ca3af;
    text-align: center;
    padding: 25px 0;
    margin-top: auto;
    font-size: 0.9rem;
}

/* ================== RESPONSIVE DESIGN ================== */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    form {
        padding: 25px;
        width: 100%;
        box-shadow: none;
        border: none;
        background: transparent;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Table adjustments if needed */
    .table thead {
        display: none;
    }

    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 20px;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 10px;
    }

    .table td {
        text-align: right;
        padding: 10px;
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--border);
    }
    
    .table td:last-child {
        border-bottom: none;
        justify-content: center;
        gap: 10px;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--text-muted);
    }
}