/* 
 * Common CSS styles shared across multiple pages 
 * This file imports all modular CSS components in the correct order
 */

/* CSS architecture based on ITCSS (Inverted Triangle CSS) methodology:
 * 1. Reset - normalize browser styles
 * 2. Variables - define design tokens
 * 3. Animations - define shared animations 
 * 4. Layout - structural elements and spacing
 * 5. Dark mode - dark theme styles
 * 6. Components - reusable UI components
 * 7. Header/Footer - global site elements
 * 8. Responsive - media queries for different devices
 */

/* Import reset styles - normalize browser defaults */
@import 'reset.css';

/* Import design tokens and variables */
@import 'variables.css';

/* Import animations */
@import 'animations.css';

/* Import layout styles */
@import 'layout.css';

/* Import dark mode styles */
@import 'dark-mode.css';

/* Import component styles */
@import 'components.css';

/* Import header and footer styles */
@import 'header-footer.css';

/* Import responsive styles - should be last */
@import 'responsive.css';

/* Animace zatřesení pro zamčené tlačítko */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

#themeToggle.shake {
  animation: shake 0.4s ease-in-out;
}

/* Prevent animations during page load */
.preload * {
  transition: none !important;
  animation: none !important;
}

/* --- ROOT VARIABLES --- */
:root {
  --color-text: #000f08;
  --color-bg: #E5F7FB; /* světlá modrá */
  --color-primary: #3B97A5; /* tyrkysová */
  --color-secondary: #7FD3E4; /* světlejší modrá */
  --color-accent: #E6DE65; /* žlutá */
  --color-highlight: #8A7B00; /* olivová */
}

body.dark-mode {
  --color-text: #e8f0f0;
  --color-bg: #0d1f21;
  --color-primary: #3AB7BF;  
  --color-secondary: #217482;
  --color-accent: #cfc554;
  --color-highlight: #f5e642;
}

/* --- BASE STYLES --- */
html, body {
  min-height: 100vh;
}

/* Main body background image - static, not fixed */
body {
  background-image: url('../pictures/web-logos/pozadiMobilLightMode.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center top 200px;
}

body.dark-mode {
  background-image: url('../pictures/web-logos/pozadiMobilDarkMode.webp');
}

/* Background image responsiveness */
@media (min-width: 1151px) {
  body, body::before {
    background-size: cover;
  }
}

@media (max-width: 1150px) and (min-width: 781px) {
  body, body::before {
    background-size: 80vw auto;
  }
}

@media (max-width: 780px) {
  body, body::before {
    background-image: none;
  }
  body.dark-mode, body.dark-mode::before {
    background-image: none;
  }
}

/* AdminPage exception - no blur effect and no background */
body.admin-page::before {
  display: none;
}

body.admin-page {  background-image: none;
}

/* --- HEADER STYLES --- */
header {
  background-color: var(--color-bg);
  padding-left: 2vw;
  padding-right: 1vw;
  position: relative;
  border: none;
  outline: none;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  gap: 0.7rem;
  width: 100vw;
  max-width: none;
  margin: 0;
  left: 50%;
  right: 50%;
  transform: translateX(-50%);
  padding-left: 2vw;
  padding-right: 2vw;
  box-sizing: border-box;
}

.logo {
  height: 150px;
  display: flex;
  align-items: center;
  margin: 0;
}

#logo_image {
  height: 150px;
  width: auto;
  max-width: 100%;
  object-fit: contain;  display: block;
  margin: 0 auto;
  content: url('../pictures/web-logos/logoKytkyLightMode.png');
}

body.dark-mode #logo_image {
  content: url('../pictures/web-logos/logoKytkyDarkMode.png');
}

/* --- CONTACT STYLES --- */
.contact {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-right: 2vw;
  text-align: left;
  font-size: clamp(0.8rem, 1.5vw, 1.1rem);
}

.header_contact {
  list-style: none;
  width: 250px;
}

#header_email {
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
}

a.header_email,
a.header_email:link,
a.header_email:visited,
a.header_email:active,
.header_email:hover {
  color: inherit;
}

a.header_email,
a.header_email:link,
a.header_email:visited,
a.header_email:active {
  text-decoration: none;
  font-weight: inherit;
  font-family: inherit;
}

a.header_email:hover {
  color: var(--color-highlight);
  text-decoration: none;
}

/* --- NAV STYLES --- */
nav {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  background-color: transparent; /* Changed from var(--color-bg) to transparent */
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.5rem;
  position: relative;
}

/* --- NAVBAR BUTTONS --- */
@keyframes buttonPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes buttonActivate {
  0% { transform: scale(1); }
  30% { transform: scale(0.95); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes buttonClick {
  0% { transform: scale(1); }
  40% { transform: scale(0.92); }
  70% { transform: scale(1.05); }
  85% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

.nav_button {
  background: rgba(127, 211, 228, 0.05) !important;
  border: 1px solid transparent;
  color: var(--color-text) !important;
  box-shadow: none;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  z-index: 2;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  margin: 0 0.3rem;
  overflow: hidden;
}

/* Separator styling moved to header-footer.css */

.nav_button.clicking {
  animation: buttonClick 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary)) !important;
  color: white !important;
  border-color: var(--color-accent);
}

.nav_button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.nav_button:hover, .nav_button:focus {
  color: var(--color-primary) !important;
  border-color: var(--color-secondary);
  box-shadow: 0 2px 8px rgba(59, 151, 165, 0.15);
  transform: translateY(-2px);
}

.nav_button:hover::before, .nav_button:focus::before {
  opacity: 0.1;
}

.nav_button:active {
  animation: buttonActivate 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  transform: translateY(0);
}

.nav_button.active {
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary)) !important;
  color: white !important;
  border: 1px solid var(--color-accent);
  box-shadow: 0 2px 10px rgba(59, 151, 165, 0.2);
  animation: buttonPulse 2s infinite ease-in-out;
}

body.dark-mode .nav_button {
  background: rgba(33, 116, 130, 0.05) !important;
  border-color: transparent;
  color: var(--color-text) !important;
}

body.dark-mode .nav_button::before {
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-accent));
}

body.dark-mode .nav_button:hover, body.dark-mode .nav_button:focus {
  color: var(--color-accent) !important;
  border-color: var(--color-secondary);
  box-shadow: 0 2px 8px rgba(58, 183, 191, 0.15);
}

body.dark-mode .nav_button.active {
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary)) !important;
  color: var(--color-highlight) !important;
  border: 1px solid var(--color-highlight);
  box-shadow: 0 2px 10px rgba(58, 183, 191, 0.3);
}

/* --- THEME TOGGLE --- */
#themeToggle {
  position: relative;
  margin: 0;
  align-self: center;
  z-index: 2000;
  border-radius: 50%;
  aspect-ratio: 1/1;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  max-width: 42px;
  max-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  background: var(--color-accent) !important;
  color: #000f08 !important;
  border: 1px solid transparent;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
}

#themeToggle:hover {
  transform: translateY(-2px) rotate(10deg);
  box-shadow: 0 3px 10px rgba(138, 123, 0, 0.2);
  border-color: var(--color-secondary);
  background: var(--color-highlight) !important;
}

#themeToggle:active {
  transform: scale(0.95);
  box-shadow: 0 1px 5px rgba(138, 123, 0, 0.15);
  transition: all 0.1s ease;
}

#themeToggle.disabled {
  cursor: wait;
  opacity: 0.8;
  transform: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode #themeToggle {
  background: var(--color-highlight) !important;
  color: #0d1f21 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border-color: transparent;
}

body.dark-mode #themeToggle:hover {
  transform: translateY(-2px) rotate(-10deg);
  background: var(--color-accent) !important;
  color: #0d1f21 !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  border-color: var(--color-secondary);
}

/* --- Sdílené styly z HomePage --- */
.divider {
  background-color: transparent !important;
  width: 100%;
}

.preload * {
  transition: none !important;
  animation: none !important;
}

.header_contact {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  font-size: 0.9rem;
  width: auto;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.contact {
  display: block;
  width: auto;
  margin-top: 1.5rem;
  text-align: center;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 1 !important;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
  overflow: hidden;
}

.img-box {
  width: 100%;
  margin: 0 auto;
  min-height: 80px;
  max-width: 100%;
  background: #eee !important;
  border-radius: 12px !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.highlight {
  z-index: 2;
  position: relative;
  text-align: center;
  width: 100%;
  margin: 2rem auto;
  padding: 1rem;
  font-size: clamp(1.1rem, 2vw, 1.8rem);
  color: var(--color-highlight);
}

/* --- FOOTER STYLES --- */
footer {
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary));
  color: var(--color-text);
  text-align: center;
  padding: 0.75rem;
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 2;
  box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.1);
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 0.9rem;
  padding: 0.25rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0.25rem;
  text-align: right;
  font-size: 0.9rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

/* Dark mode footer */
body.dark-mode footer {
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary));
  border-top: 1px solid rgba(67, 167, 214, 0.2);
  color: var(--color-text);
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.25rem;
    padding: 0.5rem;
  }
  
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
    flex: none;
    width: 100%;
    font-size: 0.85rem;
  }
  
  footer .header_contact {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }
  
  footer .header_contact li {
    margin: 0;
  }
}

/* --- RESPONSIVE STYLES --- */
@media (max-width: 900px) {
  body {
    background-size: 100vw auto;
    background-position: center 120px;
  }
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: clamp(1.2rem, 3vw, 2rem);
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 48px;
  }
  #logo_image {
    height: 48px;
    width: auto;
    max-width: 98vw;
    min-width: unset;
  }
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    justify-content: flex-start;
    padding-left: 2vw;
    padding-right: 2vw;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .header-nav {
    justify-content: center;
  }
  .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  #themeToggle {
    display: none;
  }
}

@media (max-width: 780px) {
  body, body.dark-mode {
    background-image: none !important;
  }
  main {
    margin-top: 0.5rem !important;
  }
  body.dark-mode header {
    box-shadow: none;
  }
  body.dark-mode nav {
    padding: 0.3rem 0.2rem;
    border-radius: 3px;
    box-shadow: none;
  }
}

@media (max-width: 700px) {
  body, body.dark-mode {
    background-size: 100vw auto;
    background-position: center 175px !important;
  }
  .nav_button:not(:last-child)::after {
    display: none;
  }
  .divider {
    width: 100%;
    height: clamp(24px, 6vw, 60px);
    min-height: 16px;
    max-height: 70px;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
