﻿/* style.css - Complete CSS for UniPlan */

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

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(165deg, #e8f3e9, #d4e8d6);
  margin: 0;
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  height: 100%;
  background: #1b4e33;
  color: white;
  padding: 25px 20px;
  z-index: 100;
  box-shadow: 2px 0 15px rgba(0,0,0,0.1);
  overflow-y: auto;
}

.sidebar h2 {
  text-align: center;
  margin-bottom: 35px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 2px solid #2e704c;
  padding-bottom: 15px;
}

.sidebar h2 i {
  font-size: 1.6rem;
}

.sidebar .menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar .menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: white;
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.sidebar .menu a i {
  width: 24px;
  font-size: 1.1rem;
}

.sidebar .menu a:hover {
  background: #2e704c;
  transform: translateX(5px);
}

.sidebar .menu a.active {
  background: #389e6d;
  border-left: 4px solid #ffd700;
}

/* MAIN CONTENT */
.main {
  margin-left: 260px;
  padding: 30px;
  min-height: 100vh;
}

/* HEADER */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  background: white;
  padding: 20px 25px;
  border-radius: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.header h1 {
  color: #1b4e33;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header h1 i {
  color: #389e6d;
  font-size: 1.6rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-right .user-info {
  background: #e8f3e9;
  padding: 8px 18px;
  border-radius: 30px;
  color: #1b4e33;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.header-right .user-info:hover {
  background: #d4e8d6;
}

/* Dropdown pour les administrateurs */
.user-menu-wrapper {
  position: relative;
  display: inline-block;
}

.admin-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: white;
  min-width: 280px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border: 1px solid #e0e0e0;
  z-index: 1000;
  overflow: hidden;
}

.admin-dropdown.show {
  display: block;
}

.admin-dropdown-header {
  padding: 12px 16px;
  background: #f6fcf8;
  border-bottom: 1px solid #cee8d6;
  font-weight: 600;
  color: #17502f;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  list-style: none;
}

.admin-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.admin-item:last-child {
  border-bottom: none;
}

.admin-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #cee8d6;
  color: #1b4e33;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.admin-details {
  flex: 1;
}

.admin-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.admin-email {
  font-size: 0.75rem;
  color: #666;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
}

.status-dot.online {
  background: #2ecc71;
  box-shadow: 0 0 5px #2ecc71;
}

/* User Profile Inside Dropdown */
.current-user-profile {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(135deg, #f6fcf8, #e8f3e9);
  border-bottom: 1px solid #cee8d6;
}

.profile-avatar {
  font-size: 2.2rem;
  color: #1f8a5a;
}

.profile-details {
  flex: 1;
}

.profile-name {
  font-weight: 700;
  color: #1b4e33;
  font-size: 1rem;
}

.profile-email {
  font-size: 0.8rem;
  color: #555;
  margin-top: 2px;
}

.dropdown-footer {
  padding: 10px;
  border-top: 1px solid #f0f0f0;
  background: #fdfdfd;
}

.dropdown-logout {
  width: 100%;
  padding: 10px;
  background: #fff0f0;
  color: #d32f2f;
  border: 1px solid #fbdada;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.dropdown-logout:hover {
  background: #ffebeb;
}

.header-right .logout-btn {
  background: #d9534f;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.3s;
}

.header-right .logout-btn:hover {
  background: #c9302c;
  transform: scale(1.05);
}

/* SECTION */
.section {
  background: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* INPUTS */
input, select {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border-radius: 12px;
  border: 1.5px solid #c0e0ca;
  background: #f6fcf8;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: #2e8b57;
  box-shadow: 0 0 0 3px rgba(70, 160, 100, 0.2);
}

/* BUTTONS */
button {
  background: linear-gradient(105deg, #389e6d, #1f8a5a);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(56, 158, 109, 0.3);
}

button i {
  font-size: 0.9rem;
}

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  border-radius: 12px;
  overflow: hidden;
}

th {
  background: #1b4e33;
  color: white;
  padding: 12px;
  text-align: center;
}

td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #e0ece4;
}

tr:nth-child(even) {
  background: #f8fbf9;
}

tr:hover {
  background: #eef5f0;
}

/* ACTION BUTTONS IN TABLES */
.edit-btn, .delete-btn {
  padding: 6px 12px;
  margin: 0 3px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.edit-btn {
  background: #2e704c;
}

.edit-btn:hover {
  background: #389e6d;
}

.delete-btn {
  background: #d9534f;
}

.delete-btn:hover {
  background: #c9302c;
}

/* CARDS */
.card-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.card {
  flex: 1;
  min-width: 180px;
  background: white;
  padding: 25px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  transition: 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card h3 {
  color: #1b4e33;
  margin-bottom: 10px;
  font-size: 1rem;
}

.card span {
  font-size: 2rem;
  font-weight: bold;
  color: #389e6d;
}

.card i {
  font-size: 2rem;
  color: #389e6d;
  margin-bottom: 10px;
  display: block;
}

/* CHART */
.chart-container {
  background: white;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

/* FLEX UTILITIES */
.flex-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.flex-1 {
  flex: 1;
}

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

/* RESPONSIVE */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }
  .main {
    margin-left: 200px;
    padding: 20px;
  }
  .header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  .flex-row {
    flex-direction: column;
  }
}




/* MODAL STYLES */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 500px;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  transform: translateY(0);
  animation: slideUp 0.3s ease;
}

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

.modal-header h2 {
  color: #1b4e33;
  margin: 0;
  font-size: 1.4rem;
}

.modal-close {
  background: none;
  color: #666;
  font-size: 1.5rem;
  padding: 0;
  box-shadow: none;
}
.modal-close:hover {
  transform: scale(1.1);
  box-shadow: none;
  color: #d32f2f;
}

.modal-body {
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cancel-btn {
  background: #f0f0f0;
  color: #666;
}
.cancel-btn:hover {
  background: #e0e0e0;
  box-shadow: none;
}
.action-icons .edit-btn { color: #667eea; }
.action-icons .edit-btn:hover { background: #eef2ff; }
.action-icons .delete-btn { color: #e53e3e; }
.action-icons .delete-btn:hover { background: #fee2e2; }

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  border-radius: 24px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  min-height: 300px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eef2ff;
}

.modal-header h3 {
  font-size: 1.3rem;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eef2ff;
}

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: none;
}

.alert-success {
  background: #d4edda;
  color: #2e704c;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #b42318;
  border: 1px solid #f5c6cb;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: #999;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 15px;
}

.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 16px 20px;
  flex: 1;
  min-width: 120px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card i {
  font-size: 24px;
  margin-bottom: 8px;
}

.stat-card .number {
  font-size: 28px;
  font-weight: bold;
  color: #333;
}

.stat-card .label {
  font-size: 12px;
  color: #666;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f9ff;
  padding: 8px 16px;
  border-radius: 40px;
}



.search-box input {
  border: none;
  background: none;
  padding: 8px;
  width: 250px;
  outline: none;
}

.bottom-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.hide-spinner .loading-spinner {
  display: none!important;
}

.loading-spinner {
  min-height: 300px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}
/*  spinner CSS */
.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: #333;
  border-radius: 50%;
  width: 160px;
  height: 160px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
.icon {
  width: 80px;
  height: 80px;
}

svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
div#preview .modal-header {
    border: none;
}
div#iconContainer {
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
}
div#statusContainer {
    text-align: center;
    padding: 30px;
}
div#continuerBtn
 {
    text-align: center;
    justify-content: center;
    padding: 30px;
}
div#continuerBtn a{
  text-decoration: none;
}
div#continuerBtn .btn-primary {
    color: white;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    background: linear-gradient(105deg, rgb(56, 158, 109), rgb(31, 138, 90));
    border-width: medium;
    border-style: none;
    border-color: currentcolor;
    border-image: initial;
    padding: 10px 20px;
    border-radius: 12px;
    transition: 0.3s;
    gap: 8px;
}
.circle {
  stroke: #4caf50;
  stroke-width: 4;
  stroke-dasharray: 157; /* circumference ~ 2*π*r */
  stroke-dashoffset: 157;
  animation: draw-circle 0.5s forwards;
}

.check {
  stroke: #4caf50;
  stroke-width: 4;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw-check 0.5s 0.5s forwards; /* delay to start after circle */
}

@keyframes draw-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}
.icon.error .circle {
  stroke: #f44336; /* red */
  stroke-width: 4;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: draw-circle 0.5s forwards;
}

.cross {
  stroke: #f44336;
  stroke-width: 4;
  stroke-dasharray: 28.28; /* ~ sqrt(20² + 20²) */
  stroke-dashoffset: 28.28;
  animation: draw-cross 0.5s 0.5s forwards; /* delay after circle */
}

.cross2 {
  animation-delay: 0.7s; /* second line appears slightly later */
}

@keyframes draw-cross {
  to { stroke-dashoffset: 0; }
}

