/* ==========================================================================
   COMMON STYLES - Kvasir Platform
   Shared styles used across multiple pages
   ========================================================================== */

/* ==========================================================================
   1. CSS VARIABLES & ROOT SETTINGS
   ========================================================================== */

:root {
  /* Color Palette */
  --bg: #f5faff;
  --title: #10245e;
  --swamp-1: #6d8fbf;
  --swamp-2: #7fa9d6;
  --swamp-3: #a3c4e8;
  --swamp-4: #d6e7f7;
  
  /* Neutral Colors */
  --gray-light: #ecf0f2;
  --gray-pale: #aaa;
  --gray-medium: #ccc;
  --gray-dark: #666;
  --black: #000;
  --white: #fff;
  
  /* Semantic Colors */
  --primary: #007bff;
  --danger: #bb0000;
  --border-color: rgb(111, 114, 123);
  
  /* Spacing */
  --spacing-xs: 0.2rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  
  /* Breakpoints (for reference in media queries) */
  --breakpoint-mobile: 480px;
  --breakpoint-tablet: 768px;
  --breakpoint-desktop: 769px;
  
  /* Z-index layers */
  --z-background: -1;
  --z-base: 1;
  --z-nav: 10;
  --z-dropdown: 100;
  --z-modal: 1050;
  --z-tooltip: 1060;
}

/* ==========================================================================
   2. BASE & RESET
   ========================================================================== */

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ==========================================================================
   3. RESPONSIVE UTILITIES
   ========================================================================== */

/* Mobile-only visibility */
@media (max-width: 768px) {
  .not-phone-only {
    display: none !important;
  }
  
  .wrap-on-mobile {
    flex-wrap: wrap;
    gap: var(--spacing-xs) !important;
  }
}

/* Desktop-only visibility */
@media (min-width: 769px) {
  .phone-only {
    display: none !important;
  }
}

/* ==========================================================================
   5. CONTAINER COMPONENTS
   ========================================================================== */

.container {
  margin-left: 10px;
}

.container-fluid {
  padding: 0;
}

.container-for-selector {
  width: 100% !important;
  display: flex;
}

.disabled-container {
  pointer-events: none;
  opacity: 0.5;
}

/* Container Details - Used for form sections */
.container-details {
  padding: 10px 10px 12px 10px;
  background-color: var(--gray-light);
  border-radius: 20px;
  border: 3px solid var(--border-color);
}

/* Media Container for media elements */
.all-media-container {
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
}

/* ==========================================================================
   6. NAVBAR COMPONENTS
   ========================================================================== */

.navbar {
  background-color: var(--gray-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
  height: auto;
  width: 100px;
}

.navbar-name {
  font-weight: 700;
  display: none;
}

.navbar-line {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap !important;
}

/* Navigation buttons */
.nav-btn {
  padding: 0;
  border: none !important;
  box-shadow: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  position: relative;
  z-index: var(--z-nav);
}

.nav-btn .bi {
  font-size: 3rem;
  line-height: 1;
  color: currentColor;
}

.nav-btn:focus {
  box-shadow: none;
  outline: none;
}

/* ==========================================================================
   7. SELECTOR COMPONENTS
   ========================================================================== */

.selector-item {
  position: relative;
  width: 50px;
  height: 100px;
  background-color: gray;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.7rem;
  color: var(--white);
  font-weight: 700;
  text-align: center;
  border-radius: 5px;
  writing-mode: sideways-lr;
  text-orientation: mixed;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
}

.selector-item:hover {
  color: var(--black);
}

.selector-item-active {
  border: 3px solid var(--black);
}

.selector-item-line {
  width: 5px;
  height: 20px;
  background-color: var(--black);
}

.selector-item-arrow {
  font-size: 2rem;
  color: var(--black);
  padding: 0;
  margin: 0;
  position: relative;
  top: -16px;
  height: 16px;
  width: auto;
}

.selector-item-img {
  position: absolute;
  top: 0;
  height: 100%;
  width: auto;
}

.selector-item-text {
  position: absolute;
  top: 0;
  left: 0;
  z-index: var(--z-nav);
}

/* ==========================================================================
   8. FLOATING WINDOWS & MODALS
   ========================================================================== */

/* Base floating window styles */
.floating-window-alert,
.floating-window-prompt {
  position: fixed;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(100, 0, 0, 0.5);
  padding: 20px;
  z-index: var(--z-modal);
  display: none;
}

.floating-window-alert {
  top: 50%;
  border: 3px solid var(--danger);
}

.floating-window-prompt {
  top: 30%;
  font-size: 0.9rem;
  border: 2px solid var(--primary);
}

.floating-window-notes {
  top: 30%;
  font-size: 0.9rem;
  border: 2px solid var(--black);
  position: fixed;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white);
  box-shadow: 0 4px 10px rgba(100, 0, 0, 0.5);
  padding: 20px;
  z-index: var(--z-modal);
  display: none;
}

.floating-window-images {
  position: fixed;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffef;
  top: 30%;
  font-size: 0.9rem;
  border: 0;
  z-index: var(--z-tooltip);
  display: none;
  border-radius: 0;
}

.floating-window-gallery {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 70vh;
  width: 50vw;
  transform: translate(-50%, -50%);
  background: var(--white);
  font-size: 0.9rem;
  border: 1px solid var(--black);
  z-index: var(--z-modal);
  display: none;
  border-radius: 10px;
  padding: 10px;
}

/* Floating window headers */
.floating-header-alert,
.floating-header-prompt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.floating-header-alert {
  font-size: 2rem;
  padding-bottom: 10px;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--primary);
}

.floating-header-prompt {
  font-size: 1.5rem;
  padding-bottom: 5px;
  margin-bottom: 5px;
  border-top: 2px solid var(--primary);
}

/* Close button for floating windows */
.floating-close-btn {
  cursor: pointer;
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary);
  border: none;
  background: none;
}

.floating-close-btn:hover {
  color: red;
}

/* Notes list in floating windows */
.notes-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-y: auto;
  border: 1px solid blue;
  width: 100%;
  max-height: 80vh;
}

.unselected-note-floating-window {
  white-space: pre;
  overflow-x: hidden;
}

.unselected-note-floating-window:hover {
  cursor: pointer;
  color: var(--primary);
}

/* ==========================================================================
   9. CALLOUT COMPONENT
   ========================================================================== */

.callout {
  position: fixed;
  top: 50px;
  right: 50px;
  width: 600px;
  background: var(--white);
  border: 2px solid var(--gray-medium);
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  padding: 15px;
  display: none;
  flex-direction: column;
  gap: 10px;
}

.callout img {
  width: 100%;
  border-radius: 8px;
}

.callout-text {
  font-size: 1.2rem;
  color: #333;
}

.callout-close {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 20px;
  font-weight: bold;
  color: var(--gray-dark);
  cursor: pointer;
}

.callout-close:hover {
  color: var(--black);
}

.callout-footer {
  display: flex;
  align-items: center;
  font-size: 12px;
}

.callout-footer input {
  margin-right: 5px;
}

/* ==========================================================================
   10. DONATION BUTTONS
   ========================================================================== */

.button-donate {
  color: gold;
  display: none;
  background-color: rgba(168, 169, 170, 0.235);
  border: 1px solid rgba(168, 169, 170, 0.5);
  border-radius: 18px;
  font-size: 2rem;
  font-family: "Coiny", sans-serif;
  max-height: 2.5rem;
  padding: 0 10px;
  align-items: flex-end !important;
}

.button-donate-fixed {
  color: gold;
  display: none;
  background-color: transparent;
  border: 0;
  font-size: 2rem;
  font-family: "Coiny", sans-serif;
  max-height: 2rem;
  padding: 0;
  align-items: flex-end !important;
  margin: 0 !important;
  position: fixed;
  right: 1vw;
  z-index: 900;
}

/* ==========================================================================
   11. FORM ELEMENTS & DATA DISPLAY
   ========================================================================== */

pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  outline: none;
  overflow-y: auto;
}

/* Learning details data - for consume pages */
.learning_details_data {
  margin-bottom: 0;
  padding: 0;
  z-index: 2;
  overflow-y: hidden;
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-pale) !important;
}

.input-label {
  min-width: 150px;
  max-width: 150px;
}

/* ==========================================================================
   12. MOBILE RESPONSIVE STYLES (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
  .container {
    margin-left: 0;
  }
  
  .container-details {
    width: 99%;
    margin: 0;
  }
  
  .all-media-container {
    width: 100%;
  }
  
  .navbar {
    padding: 0;
  }
  
  .navbar-name {
    display: none;
  }
  
  .navbar-nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }
  
  .floating-window-alert {
    max-height: 80%;
    font-size: 1rem;
    width: 90%;
  }
  
  .floating-header-alert {
    font-size: 1.5rem;
  }
  
  .input-label {
    min-width: 120px;
    max-width: 120px;
  }
}

/* ==========================================================================
   13. TABLET/DESKTOP RESPONSIVE STYLES (min-width: 769px)
   ========================================================================== */

@media (min-width: 769px) {
  .container-details {
    width: 90%;
    margin-left: 1%;
    margin-top: 10px;
    margin-bottom: 20px;
  }
  
  .all-media-container {
    max-width: 80%;
  }
  
  .navbar {
    padding: 0 20px;
  }
  
  .navbar-name {
    display: block;
    margin-left: 10px;
    margin-right: 10px;
  }
  
  .selector {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .floating-window-alert {
    font-size: 1.5rem;
    width: 50%;
  }
  
  .floating-header-alert {
    font-size: 2rem;
  }
  
  .button-donate-fixed {
    top: 6vh !important;
    right: 1.5rem;
  }
}

/* ==========================================================================
   14. EXTRA SMALL MOBILE STYLES (max-width: 480px)
   ========================================================================== */

@media (max-width: 480px) {
  /* Container fluid adjustments */
  .container-fluid select {
    width: 5rem !important;
    margin-left: 0.4rem !important;
    padding: 0.2rem;
  }
  
  .container,
  .container-fluid {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }
  
  .container-fluid {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 4px;
    align-items: center;
  }
  
  .container-fluid::-webkit-scrollbar {
    display: none;
  }
  
  /* Button sizing */
  .container-fluid button,
  .container-fluid .btn,
  .container-fluid .do-btn,
  .container-fluid .nav-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px !important;
    font-size: 0.85rem !important;
    margin: 0.2rem !important;
    min-width: auto !important;
    width: auto !important;
    max-width: none !important;
  }
  
  .nav-btn .bi {
    font-size: 3rem;
    line-height: 1;
    color: currentColor;
  }
  
  .nav-btn:focus {
    box-shadow: none;
    outline: none;
  }
  
  .container-fluid .bi {
    font-size: 1.6rem !important;
  }
  
  /* Static section layout */
  #staticSection.container-fluid {
    display: flex;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem;
    padding: 4px;
    overflow-x: hidden !important;
  }
  
  /* Navbar adjustments */
  .navbar .container-fluid {
    flex-wrap: nowrap !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between;
    gap: 0.5rem;
  }
  
  .navbar .navbar-brand {
    flex-shrink: 0;
  }
  
  .navbar .d-flex.ms-3 {
    flex-grow: 1;
    display: flex;
    flex-shrink: 1;
    margin-left: 0 !important;
    gap: 0.4rem;
    flex: 0 0 auto;
    width: 200px;
  }
  
  .navbar .d-flex.ms-3 input[type="search"] {
    width: 100% !important;
    min-width: 0;
    flex-grow: 1;
    font-size: 0.9rem;
  }
  
  .navbar .d-flex.ms-3 button {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.9rem;
    height: 2.4rem;
  }
  
  .navbar-toggler {
    margin-left: 0.5rem;
    flex-shrink: 0;
    flex: 0 0 auto;
  }
  
  #loginBtnContainer {
    position: absolute !important;
    right: 1rem;
    z-index: 9999;
    padding: 0.5rem;
  }
  
  .navbar-collapse.collapse.show {
    background-color: var(--gray-light);
    display: flex !important;
    align-items: center;
    justify-content: space-between;
  }
  
  .navbar .form-select.ms-3 {
    flex: 0 0 auto;
    width: 5rem !important;
  }
  
  .nav-link {
    cursor: pointer;
    border-radius: 5px;
    border: none;
    padding: 0.5rem 1rem;
    position: relative;
  }
  .nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0%;
    height: 2px;
    background: #2563eb;
    transition: width 0.3s ease;
  }
  .nav-link:hover::after {
    width: 100%;
  }
  
  .form-select {
    width: 14rem !important;
    padding: 0.2rem;
  }
  
  /* Floating windows */
  .floating-window-alert,
  .floating-window-prompt,
  .floating-window-notes {
    width: 95%;
    max-height: 80%;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
  
  .floating-window-alert {
    font-size: 1.2rem;
  }
  
  .button-donate-fixed {
    top: 6vh !important;
    right: 0;
  }
}

/* ==========================================================================
   15. UTILITY CLASSES
   ========================================================================== */

/* Visually hidden but accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* End of common.css */
