/* ===== GLOBAL VARIABLES ===== */
:root {
  --primary-color: #3a4e8c;
  --secondary-color: #6c7fb7;
  --accent-color: #d72323;
  --dark-bg: #2a2e3d;
  --medium-bg: #383a4a;
  --light-bg: #44495a;
  --text-light: #f5f5f5;
  --text-muted: #b0b5c0;
  --border-radius: 12px;
  --box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-bg: rgba(30, 30, 60, 0.97);
}

/* ===== NAVIGATION STYLES ===== */
nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    padding: 0;
    margin: 0 0 20px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
}

nav ul {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 70px;
}

nav li {
    margin: 0 30px;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-size: 1.3em;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 25px;
    transition: var(--transition);
    letter-spacing: 1px;
    display: block;
}

nav a:hover,
nav a:focus {
    background: var(--primary-color);
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    outline: none;
}

nav a.active {
    background: var(--accent-color);
    color: #fff;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    position: absolute;
    top: 25px;
    right: 20px;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Animacja hamburgera */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Menu mobilne - lepsze tło */
nav ul.active {
    backdrop-filter: blur(8px);
    background: rgba(20, 20, 40, 0.95);
    transition: all 0.3s ease;
}

body.menu-open {
    overflow: hidden;
}

/* ===== BASE STYLES ===== */
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 40px;
  background: linear-gradient(135deg, var(--dark-bg) 0%, var(--medium-bg) 100%);
  color: var(--text-light);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 30px;
  background: var(--dark-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

h1, h2, h3 {
  color: var(--secondary-color);
  margin-bottom: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.4em;
  color: var(--accent-color);
  margin-bottom: 30px;
}

/* ===== HEADER & FOOTER ===== */
.header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.footer {
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9em;
}

.logo-header {
  display: block;
  max-height: 60px;
  height: 60px;
  width: auto;
}

/* ===== BUTTONS ===== */
button,
.stage-btn,
.back-btn,
.logout-btn,
.btna button,
.next button,
.btn4 button,
.room-item button,
.tile-remove,
.carousel-arrow {
  padding: 12px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.02em;
}

button:hover,
.stage-btn:hover,
.back-btn:hover,
.logout-btn:hover,
.btna button:hover,
.next button:hover,
.btn4 button:hover,
.room-item button:hover,
.tile-remove:hover,
.carousel-arrow:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(215, 35, 35, 0.2);
}

button:disabled,
.stage-btn:disabled {
  background: var(--medium-bg);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

.stage-btn {
  border-radius: 30px;
  padding: 10px 24px;
  margin: 0 5px;
}
.stage-buttons{
    display: flex;
    justify-content: center;
    margin-top: 20px;
}
.stage-btn.active {
  background: var(--accent-color);
  font-weight: 600;
}

.back-btn {
  background: transparent;
  color: var(--secondary-color);
  border: 1px solid var(--secondary-color);
  margin-bottom: 20px;
}

.logout-btn {
  background: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  padding: 8px 16px;
}

.room-item button {
  background: var(--accent-color);
  padding: 8px 16px;
}

.tile-remove {
  background: var(--accent-color);
  margin-top: 10px;
}


.next, 
.btna,
.btn4 {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  gap: 20px;
}

/* ===== FORM ELEMENTS ===== */
select, input {
  padding: 12px 16px;
  font-size: 1em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  background: var(--medium-bg);
  color: var(--text-light);
  transition: var(--transition);
}

select:focus, input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(215, 35, 35, 0.1);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.95em;
}

/* ===== LAYOUT & SECTIONS ===== */
.step {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.hidden {
  display: none;
}

.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.5em;
  margin-bottom: 20px;
  color: var(--secondary-color);
  position: relative;
  padding-bottom: 10px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent-color);
}

/* ===== TILE SYSTEMS ===== */
.tile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  margin: 30px 0 20px 0;
}

.tile-select {
  background: var(--medium-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tile-select:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow);
  border-color: var(--secondary-color);
}

.tile-select.selected {
  background: var(--primary-color);
  border-color: var(--accent-color);
}

.tile-select img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin-bottom: 20px;
  border-radius: 8px;
  background: white;
  padding: 10px;
}

.tile-label {
  font-size: 1.1em;
  font-weight: 500;
  margin: 10px 0 0;
}

/* ===== COMPONENT TILES ===== */
.component-tile {
  background: var(--medium-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.component-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--box-shadow);
  border-color: var(--secondary-color);
}

.component-tile.selected {
  background: var(--primary-color);
  border-color: var(--accent-color);
}

.component-tile img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  padding: 10px;
  margin-bottom: 15px;
}

.component-tile .tile-qty input[type="number"] {
  width: 70px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--secondary-color);
  background: var(--dark-bg);
  color: var(--text-light);
  text-align: center;
}

.component-tile.selected::after {
  content: "Wybrano";
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-color);
  color: white;
  font-size: 0.8em;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* ===== ROOM SELECTION ===== */
.rooms {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.room-item {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  gap: 12px;
  background: var(--light-bg);
  padding: 15px;
  border-radius: var(--border-radius);
}

.room-image-section {
  width: 220px;
  text-align: center;
}

.room-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--border-radius);
  transition: var(--transition);
  border: 1px solid var(--secondary-color);
}

.room-photo:hover {
  transform: scale(1.03);
  border-color: var(--accent-color);
}

#roomControls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
#roomsContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  margin-top: 20px;
}

/* ===== CAROUSEL ===== */
.component-carousel-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 0 auto 20px auto;
  position: relative;
}

.component-carousel {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 24px;
  padding: 10px 0;
  width: 90%;
  scrollbar-width: thin;
}

.component-carousel::-webkit-scrollbar {
  height: 8px;
  background: var(--secondary-color);
  border-radius: 8px;
}

.component-carousel::-webkit-scrollbar-thumb {
  background: var(--dark-bg);
  border-radius: 8px;
}

.carousel-arrow {
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.left-arrow { margin-right: 12px; }
.right-arrow { margin-left: 12px; }
h2, .section-title {
  text-align: center;
}
/* ===== GLOBAL OPTIONS ===== */
#globalOptions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  background: var(--light-bg);
  padding: 20px;
  border-radius: var(--border-radius);
  flex-wrap: wrap;
}

#globalOptions label {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--secondary-color);
}

#globalOptions select {
  min-width: 250px;
}

.selectimage {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px 0;
}

#seriesImage, #frameImage {
  width: 25%;
  height: auto;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

#seriesImage:hover, #frameImage:hover {
  transform: scale(1.03);
}
/* ===== SUMMARY SECTION STYLES ===== */
#finalSummary {
  background: #2a2e3d;
  border-radius: 12px;
  padding: 30px;
  margin: 40px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
}

.summary-header {
  text-align: center;
  margin-bottom: 30px;
  color: #d72323;
  font-size: 1.8em;
  position: relative;
  padding-bottom: 15px;
  font-weight: 600;
}

.summary-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: #6c7fb7;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.summary-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid #6c7fb7;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.summary-section:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-3px);
}

.section-title {
  color: #6c7fb7;
  font-weight: 600;
  margin-bottom: 15px;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-content {
  color: #f5f5f5;
  line-height: 1.6;
}

.section-image {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
  margin-top: 15px;
  background: white;
  padding: 10px;
  border: 1px solid #6c7fb7;
}

.summary-total {
  text-align: center;
  font-size: 1.3em;
  padding: 20px;
  background: rgba(215, 35, 35, 0.1);
  border-radius: 12px;
  margin-top: 30px;
  border: 1px solid #d72323;
}

.summary-total strong {
  color: #d72323;
  font-weight: 700;
}

.summary-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .component-carousel {
    scroll-behavior: auto !important;
  }
}
/* Responsywność podsumowania */
@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .summary-section {
    padding: 15px;
  }
  
  .summary-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .summary-actions button {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  #finalSummary {
    padding: 20px 15px;
  }
  
  .summary-header {
    font-size: 1.5em;
  }
  
  .section-title {
    font-size: 1em;
  }
  
  .summary-total {
    font-size: 1.1em;
  }
}

/* ===== ANIMACJE PRZEJŚĆ ETAPÓW ===== */
@keyframes stepFadeInRight {
  from { opacity: 0; transform: translateX(40px);}
  to   { opacity: 1; transform: translateX(0);}
}
@keyframes stepFadeOutLeft {
  from { opacity: 1; transform: translateX(0);}
  to   { opacity: 0; transform: translateX(-40px);}
}
@keyframes stepFadeInLeft {
  from { opacity: 0; transform: translateX(-40px);}
  to   { opacity: 1; transform: translateX(0);}
}
@keyframes stepFadeOutRight {
  from { opacity: 1; transform: translateX(0);}
  to   { opacity: 0; transform: translateX(40px);}
}

.step {
  animation: stepFadeInRight 0.45s cubic-bezier(0.4,0,0.2,1);
  will-change: opacity, transform;
}

.step.step-in-right {
  animation: stepFadeInRight 0.45s cubic-bezier(0.4,0,0.2,1);
}
.step.step-in-left {
  animation: stepFadeInLeft 0.45s cubic-bezier(0.4,0,0.2,1);
}
.step.step-out-left {
  animation: stepFadeOutLeft 0.35s cubic-bezier(0.4,0,0.2,1);
}
.step.step-out-right {
  animation: stepFadeOutRight 0.35s cubic-bezier(0.4,0,0.2,1);
}

/* ===== RESPONSIVE DESIGN ===== */
/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablety i mniejsze laptopy (1024px i mniej) */
@media (max-width: 1024px) {
  .container {
    padding: 25px;
  }
  
  .tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
  }
  
  #globalOptions {
    flex-direction: column;
    align-items: center;
  }
  
  .selectimage {
    flex-direction: column;
  }
  
  #seriesImage, #frameImage {
    width: 70%;
    margin: 10px 0;
  }
}

/* Tablety w orientacji pionowej (768px i mniej) */
@media (max-width: 768px) {
  body {
    padding: 20px;
    font-size: 15px;
  }
  
  .header {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .user-info {
    justify-content: center;
  }
  
  .button-container {
    flex-direction: column;
    align-items: center;
  }
  
  button, .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .component-tile img {
    width: 140px;
    height: 140px;
  }
  
  .room-photo {
    height: 140px;
  }
  
  nav li {
    margin: 0 15px;
  }
  
  nav a {
    font-size: 1.1em;
    padding: 10px 16px;
  }
}

/* Smartfony (700px i mniej) - NAWIGACJA MOBILNA */
@media (max-width: 700px) {
    .menu-toggle {
        display: flex;
    }

    nav ul {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        background: rgba(30, 30, 60, 0.98);
        z-index: 1000;
        padding: 80px 0;
    }

    nav ul.active {
        display: flex;
    }

    nav li {
        margin: 15px 0;
        text-align: center;
    }

    nav a {
        font-size: 1.5em;
        padding: 15px;
    }
}

/* Smartfony (480px i mniej) */
@media (max-width: 480px) {
  body {
    padding: 15px;
    font-size: 14px;
  }
  
  .container {
    padding: 15px;
    border-radius: 10px;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  .tile-grid {
    grid-template-columns: 1fr;
  }
  
  .tile-select, .component-tile {
    padding: 15px;
  }
  
  .component-tile img {
    width: 120px;
    height: 120px;
  }
  
  .room-item {
    flex-direction: column;
    width: 100%;
  }
  
  .carousel-arrow {
    width: 30px;
    height: 30px;
  }
  
  /* Układ karuzeli na mobile */
  .component-carousel-wrapper {
    flex-direction: column;
  }
  
  .component-carousel {
    flex-direction: column;
    overflow-x: unset;
    gap: 15px;
  }
  
  .carousel-arrow {
    position: static;
    margin: 10px 0;
  }
  .stage-buttons {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0;
  }
  .stage-btn {
    width: 70%;
    min-width: unset;
    font-size: 1em;
    padding: 14px 10px;
  }
  
  nav a {
    font-size: 1.2em;
    padding: 12px;
  }
}

/* Ekstremalnie małe ekrany (360px i mniej) */
@media (max-width: 360px) {
  body {
    padding: 10px;
  }
  
  button, .btn {
    padding: 10px 15px;
    font-size: 0.9em;
  }
  
  .component-tile img {
    width: 100px;
    height: 100px;
  }
  
  nav a {
    font-size: 1em;
  }
}