/* Import czcionki Roboto z Google Fonts */
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&display=swap');

/* Reset niektórych domyślnych stylów */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
}

/* Zmienne kolorystyczne */
:root {
  --color-primary: #014f86;
  --color-primary-dark: #02365c;
  --color-primary-gray: #777;
  --color-text: #333;
  --color-bg: #F9F8F7;
  --color-bg-outer: #ebeae6;
  --color-bg-sand: #decba4;
  --color-border: #cccccc;
  --color-error: #c00;
}

/* Dark theme variables */
@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #4cc9f0;
    --color-primary-dark: #4895ef;
    --color-primary-gray: #aaa;
    --color-text: #f1f1f1;
    --color-bg: #23272f;
    --color-bg-outer: #181a20;
    --color-bg-sand: #3a3a2c;
    --color-border: #444;
    --color-error: #ff6b6b;
  }
}

/* Globalne ustawienia typografii */
body {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg-outer);
  line-height: 1.6;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color 0.2s;
}

/* Kontener na całą treść */
#main-content {
  background-color: var(--color-bg);
  min-height: 100%;
  width: 95%;
  max-width: 1300px;
  margin: 10px auto;
  border: 1px solid var(--color-border);
  border-radius:6px;
  padding:10px;
  box-shadow: 0px 0px 15px #aaa;
}

/* Nagłówek strony */
header {
  display: flex;
  flex-wrap: wrap;
  padding: 20px 10px;
  gap:20px;
border-bottom:solid 1px var(--color-border);
}

header form {
  flex-grow: 1;
  display:flex;
  gap: 10px;
  align-items: center;
}

header form input {
  flex-grow: 1;
  margin:0px !important;
}

header form button {
  width:100%;
  max-width:150px;
  white-space: nowrap;
}

header .logo {
  max-height:90px;
}

@media (max-width: 760px) {
  header {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width:100%;
  }

  header form {
    width: 100%;
  }
}

@media (max-width: 510px) {
  header form {
    flex-direction: column;
  }
  header form button {
  max-width:400px;
  }
}


/* Stopka */
footer {
  padding: 10px 0;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}


/* Sekcja główna */
main {
  padding: 40px 10px;
}

/* Tytuły */
h1, h2, h3, h4 {
  font-weight: 500;
  margin-bottom: 0.5em;
  color: var(--color-text);
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }


/* Formularze */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.75em;
  margin-bottom: 1em;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  box-shadow: 0px 0px 5px var(--color-border)
}

#player-current-time,
.btn,
button,
input[type="submit"] {
  display: inline-block;
  padding: 0.75em 1.5em;
  background-color: var(--color-primary);
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  color:#fff;
  vertical-align: middle;
  box-shadow: 0px 0px 5px var(--color-border)
}

button:hover,
input[type="submit"]:hover {
  background-color: var(--color-primary-dark);
}

.notice {
  padding: 1em 1.5em;
  border-radius: 4px;
  margin: 1em 0;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  background-color: #f8f8f8;
  color: var(--color-text);
}

.notice-success {
  border-color: #4caf50;
  background-color: #e8f5e9;
  color: #256029;
}

.notice-error {
  border-color: var(--color-error);
  background-color: #fdeaea;
  color: var(--color-error);
}

.notice-info {
  border-color: #2196f3;
  background-color: #e3f2fd;
  color: #0d47a1;
}


/* Styl przełącznika (slide switcher) */
.switch {
  position: relative;
  display: block;
  margin:5px;
  width: 60px;
  height: 32px;
  user-select: none;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: background-color 0.2s;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95em;
  color: #333;
  padding: 0 10px;
}

.slider.round {
  border-radius: 32px;
}

.switch input:checked + .slider {
  background-color: var(--color-primary);
  color: #fff;
}

.slider:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.switch input:checked + .slider:before {
  transform: translateX(28px);
}

.switch .slider {
  padding-left: 38px;
  padding-right: 8px;
  text-align: left;
}

.switch input:checked + .slider {
  padding-left: 8px;
  padding-right: 38px;
  text-align: right;
}

.dot-anim {
  display: inline-block;
}

.dot-anim::after {
  content: "";
  animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
  0% { content: ""; }
  33% { content: "."; }
  66% { content: ".."; }
  100% { content: "..."; }
}

/* Kontener listy — reset domyślnych marginesów/paddingów */
.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Każdy „wiersz” jako flexbox */
.track-item {
  display:flex;
  align-items: center;
  border-bottom: 1px solid #ddd;
  padding:10px 0px;
  width:100%;
  justify-content: center;
}

@media (max-width: 760px) {
    .track-item {
      flex-wrap: wrap;
    }

    .track-actions, .track-actions .btn {
      width:100%;
    }
}

/* Wspólne ustawienia dla wszystkich pól w wierszu */
.track-item > * {
  text-overflow: ellipsis;

}

.track-info {
  display: flex;
  align-items: flex-start;
  width:100%;
}

@media (max-width: 480px) {
  .track-item, .track-info {
  flex-direction: column;
  align-items: center;
  }
  .track-item > * {
    width: 100%;
    text-align: center;
  }
}

.track-desc {
    flex-grow: 1;
}

/* Konkretne pola – możesz dostosować proporcje */
.track-title  {  
  font-weight: bold; 
}
.track-source  {  

  color: #555; 
}
.track-actions {
  padding:15px;
}

.track-thumb {
  margin-right:15px;
}

.track-thumb img{
  max-width:150px;
  border-radius: 4px;
  display: inline-block;
  border: solid 1px var(--color-bg);
}

.track-ready {
  cursor: pointer;
}

.track-ready:hover {
  background-color: #f0f0f0;
}

.player-section {
  display:flex;
  flex-direction: row-reverse;
  flex-wrap: wrap-reverse;
  justify-content: stretch;
  width: 100%;
  gap:15px;
  margin-bottom: 1rem;
}

.player-section > * {
  flex-grow: 1;
  background-color: var(--color-bg-outer);
  padding:15px;
  border-radius:4px;
}

#player-tools-container {

}

#player-wrapper {
  display:flex;
  gap:20px;
  flex-direction: column;
  align-items: center;
}

#player {
  width: 100%;
  aspect-ratio: 4 / 3;
}

#player-title {

}

#player-embedded {
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0;
}

.player-switch-title {
  margin-right: 8px;
}

#player-progress-bar-wrapper  {
  width: 100%;
  position: relative;
}

/* Podstawowe style dla input[type="range"] w Chrome */
#player-progress-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  background: var(--color-primary);
  border-radius: 3px;
  outline: none;
  margin: 8px 0;
  opacity: 0.7; /* Set transparency (for mouse-over effects on hover) */
  -webkit-transition: .2s; /* 0.2 seconds transition on hover */
  transition: opacity .2s;
}

#player-progress-bar:hover {
  opacity: 1; /* Fully shown on mouse-over */
}

/* Webkit browsers (Chrome, Safari, Edge) */
#player-progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Firefox */
#player-progress-bar::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#player-chord-fill {
  padding: 0.5rem 1rem;
  background: #f0f0f0;
  display: inline-block;
  border-radius: 4px;
  width:100%;
  max-width: 300px;
  text-align: center;
  position: relative;
  border: solid 1px var(--color-border);
}

#player-current-chord {
  font-size: 2rem;
  font-weight: bold;
  z-index:1;
  position: relative;
}

#player-chord-fill-bar {
  position:absolute;
  top:0;
  left:0;
  height:100%;
  width:0;
  background:var(--color-bg-sand);
  transition:none;
  z-index:0;
  border-radius: 4px;
}

#player-ribbon-container {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    margin: 10px 0;
    position: relative;
    border-radius: 4px;
    padding:10px;
    border: solid 1px var(--color-border);
}

#player-ribbon {
    display: flex;
    white-space: nowrap;
    min-height: 2em;
    max-height: 150px;
    overflow-y: auto;

}

.player-ribbon-item {
  text-align:center;
  display: inline-block;
  min-width:60px;
}

.player-ribbon-beat {
  border: solid 1px var(--color-border);
  background-color: var(--color-bg-outer);
  margin:2px;
  margin-bottom:5px;
  padding:5px;
  text-align:center;
  border-radius: 4px;
  font-size: 16pt;
  min-height: 48px;
  cursor:pointer;
}

.player-ribbon-beat:hover {
  background-color: var(--color-primary-gray);
  color: #fff;
  border-color: var(--color-primary-gray);
}

.player-ribbon-beat-one {
  background: var(--color-bg-sand);
  border: solid 1px var(--color-bg-sand);
}

.player-ribbon-beat-current {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  border-radius: 4px;
}