/*
 * custom.css — Personnalisation visuelle de ShinyProxy
 * Atelier — La Longue Vue
 *
 * Modifiez les variables CSS dans :root pour changer les couleurs
 * sans toucher au reste du fichier.
 */

/* ── Variables de marque ──────────────────────────────────────────────────── */
:root {
  --sp-primary:       #1a3a5c;   /* couleur principale : navbar, boutons    */
  --sp-primary-dark:  #122840;   /* variante sombre : hover navbar           */
  --sp-accent:        #2980b9;   /* liens, bordures actives                  */
  --sp-accent-light:  #d6eaf8;   /* fond au survol des cartes                */
  --sp-bg:            #f0f3f7;   /* fond de page                             */
  --sp-card-bg:       #ffffff;   /* fond des cartes d'applications           */
  --sp-card-radius:   10px;      /* arrondi des coins                        */
  --sp-card-shadow:   0 2px 8px rgba(0, 0, 0, 0.10);
  --sp-text:          #2c3e50;   /* couleur principale du texte              */
  --sp-text-muted:    #7f8c8d;   /* texte secondaire                         */
  --sp-navbar-height: 56px;
}

/* ── Reset & base ─────────────────────────────────────────────────────────── */
body {
  background-color: var(--sp-bg);
  color: var(--sp-text);
  padding-top: var(--sp-navbar-height);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar-custom {
  background-color: var(--sp-primary);
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.20);
  min-height: var(--sp-navbar-height);
}

.navbar-custom .navbar-brand {
  color: #ffffff !important;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.navbar-custom .navbar-brand:hover {
  color: #c8dff0 !important;
}

.navbar-custom .navbar-text,
.navbar-custom .navbar-text span {
  color: #c8dff0 !important;
}

/* Boutons navbar */
.navbar-custom .btn {
  margin-left: 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.navbar-custom .btn-primary {
  background-color: var(--sp-accent);
  border-color: var(--sp-accent);
}

.navbar-custom .btn-primary:hover {
  background-color: #1f6ca0;
  border-color: #1f6ca0;
}

/* Toggle mobile */
.navbar-custom .navbar-toggle .icon-bar {
  background-color: #ffffff;
}

/* ── Page d'accueil — liste d'apps ────────────────────────────────────────── */
.page-header-custom {
  margin: 28px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--sp-accent);
}

.page-header-custom h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sp-primary);
}

/* Grille de cartes */
.app-grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -12px;
}

.app-grid-item {
  padding: 12px;
  width: 100%;
}

@media (min-width: 640px)  { .app-grid-item { width: 50%; } }
@media (min-width: 960px)  { .app-grid-item { width: 33.333%; } }
@media (min-width: 1280px) { .app-grid-item { width: 25%; } }

/* Carte d'application */
.app-card {
  background: var(--sp-card-bg);
  border-radius: var(--sp-card-radius);
  box-shadow: var(--sp-card-shadow);
  padding: 20px 20px 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(0,0,0,0.06);
}

.app-card:hover,
.app-card:focus {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  border-color: var(--sp-accent);
  text-decoration: none;
  color: inherit;
}

.app-card__logo {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.app-card__logo img {
  max-height: 56px;
  max-width: 100%;
  object-fit: contain;
}

/* Icône par défaut si pas de logo */
.app-card__logo-placeholder {
  width: 56px;
  height: 56px;
  background-color: var(--sp-accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--sp-accent);
}

.app-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--sp-primary);
  margin: 0 0 6px;
  line-height: 1.3;
}

.app-card__description {
  font-size: 0.85rem;
  color: var(--sp-text-muted);
  flex-grow: 1;
  line-height: 1.5;
}

.app-card__footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  font-size: 0.78rem;
  color: var(--sp-accent);
  font-weight: 500;
}

/* Groupe d'apps */
.app-group-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sp-primary);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #dce3ec;
}

/* Message "aucune app disponible" */
.no-apps-alert {
  background: var(--sp-card-bg);
  border: 1px solid #d6eaf8;
  border-radius: var(--sp-card-radius);
  padding: 24px;
  text-align: center;
  color: var(--sp-text-muted);
}

/* ── Notification banner ──────────────────────────────────────────────────── */
.notification-message {
  border-radius: var(--sp-card-radius);
}

/* ── Panneau "My apps" (mode Inline) ─────────────────────────────────────── */
.myApps-inline {
  padding-top: 28px;
}

.myApps-title h4 {
  font-weight: 600;
  color: var(--sp-primary);
  border-bottom: 2px solid var(--sp-accent);
  padding-bottom: 6px;
  margin-bottom: 16px;
}

/* ── Page de l'application (app.html) ────────────────────────────────────── */
#iframeinsert {
  position: fixed;
  top: var(--sp-navbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  border: none;
}

#iframeinsert iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Page de connexion ────────────────────────────────────────────────────── */
.login-container {
  max-width: 420px;
  margin: 80px auto 0;
  padding: 0 16px;
}

.login-card {
  background: var(--sp-card-bg);
  border-radius: var(--sp-card-radius);
  box-shadow: var(--sp-card-shadow);
  padding: 36px 32px;
  border: 1px solid rgba(0,0,0,0.06);
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo img {
  max-height: 72px;
  max-width: 200px;
}

.login-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sp-primary);
  margin-bottom: 24px;
}

.login-card .form-control {
  border-radius: 6px;
  border-color: #d5dce6;
  height: 42px;
}

.login-card .form-control:focus {
  border-color: var(--sp-accent);
  box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

.login-card .btn-primary {
  background-color: var(--sp-primary);
  border-color: var(--sp-primary);
  width: 100%;
  height: 42px;
  font-weight: 600;
  border-radius: 6px;
  margin-top: 8px;
}

.login-card .btn-primary:hover {
  background-color: var(--sp-primary-dark);
  border-color: var(--sp-primary-dark);
}

.login-error {
  background: #fdf2f2;
  border: 1px solid #f5c6c6;
  border-radius: 6px;
  color: #c0392b;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.sp-footer {
  margin: 48px 0 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--sp-text-muted);
}
