/**
 * TG4 Cula4Aimsir - Optimized CSS
 * Irish Weather Education Game
 */

/* ================================
   CSS Variables / Custom Properties
   ================================ */
:root {
  /* Brand Colors */
  --primary-color: #00637b;
  --primary-rgba: rgba(0, 99, 123, 0.8);
  --accent-color: #62f9f6;
  --text-color: #ffffff;
  
  /* Layout */
  --game-width: 1024px;
  --game-height: 576px;
  --icon-size: 40px;
  --icon-margin: 15px;
  
  /* Typography */
  --font-primary: "skyler", verdana, sans-serif;
  --font-size-base: 16px;
  --font-size-large: 25px;
  
  /* Z-index layers */
  --z-background: 0;
  --z-line: 1;
  --z-content: 2;
  --z-icons: 11;
  --z-audio: 20;
  
  /* Animation */
  --transition-speed: 0.3s;
}

/* ================================
   Reset & Base Styles
   ================================ */
body {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--font-primary);
  color: var(--text-color);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  /* Prevent text selection for better game experience */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Default cursor instead of text cursor */
  cursor: default;
}

body * {
  z-index: var(--z-content);
}

/* ================================
   Layout Components
   ================================ */
.gameSpace {
  width: var(--game-width);
  height: var(--game-height);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  visibility: hidden;
  cursor: default;
}

/* Background Image Container */
.bgImageDiv {
  overflow: hidden;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: var(--z-background);
}

.bgImageDiv img {
  z-index: var(--z-background);
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* Audio Container */
.audioCont {
  z-index: var(--z-audio);
  top: 0;
  position: absolute;
}

/* Line Divider */
.line {
  background: var(--primary-color);
  position: absolute;
  z-index: var(--z-line);
}

/* ================================
   Loading State
   ================================ */
.loader {
  position: absolute;
  top: 0;
  width: 100%;
}

.loader img {
  display: block;
  margin: 200px auto 0;
}

/* ================================
   Icons & Weather Elements
   ================================ */
.icons {
  z-index: var(--z-icons);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-color);
}

.icons li {
  text-align: right;
  margin: 0;
  padding: 0;
  display: block;
  width: 49%;
}

.icon {
  width: 40px;
  height: 40px;
  background: #00637b;
  display: inline-block;
  float: right;
  cursor: move;
}

.icon_name {
  display: inline-block;
  margin: 0;
  padding: 0;
  height: 40px;
  float: right;
  line-height: 40px;
  margin-right: 15px;
  font-size: 25px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;
}

.onMapIcon {
  cursor: move;
}

/* Image protection - all images except weather icons */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  cursor: default;
}

/* Clickable images should show pointer */
img.clickable,
img[src*="button"],
img[src*="replay"] {
  cursor: pointer !important;
}

/* Allow weather icons to be draggable */
.icon img.ui-draggable,
.onMapIcon {
  -webkit-user-drag: auto;
  -khtml-user-drag: auto;
  -moz-user-drag: auto;
  -o-user-drag: auto;
  user-drag: auto;
  user-select: auto;
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
}

/* ================================
   Typography
   ================================ */
h1, h2 {
  display: block;
  background: var(--primary-rgba);
  vertical-align: middle;
  color: var(--text-color);
  position: absolute;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;
}

h2 {
  font-weight: normal;
  color: var(--accent-color);
}

/* ================================
   Utility Classes
   ================================ */
.clear {
  clear: both;
}

.clickable {
  cursor: pointer;
}

.invisible {
  visibility: hidden;
}

/* No jQuery UI enhancements - keeping it simple to avoid flickering */

/* No transitions or transforms to avoid drag conflicts */

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 1024px) {
  .gameSpace {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }
}

/* ================================
   Print Styles
   ================================ */
@media print {
  body {
    font-family: verdana, sans-serif;
    color: var(--text-color);
  }
  
  .line {
    background: var(--primary-color);
  }
  
  .icons {
    color: var(--text-color);
  }
  
  .icon {
    background: var(--primary-color);
  }
  
  h1, h2 {
    background: var(--primary-color);
    color: var(--text-color);
  }
  
  h2 {
    color: var(--accent-color);
  }
  
  @page {
    size: landscape;
  }
}

/* ================================
   Accessibility Improvements
   ================================ */
/* Focus indicators for keyboard navigation */
.clickable:focus,
.icon:focus,
.ui-draggable:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #004a5d;
    --accent-color: #00ffff;
  }
  
  .icon {
    border: 2px solid var(--text-color);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}