:root {
    
    /* Main colors */
    --main-background-color: #f0f0f0;
    --main-theme-color: black;
    --logo-color: color-mix(in srgb, var(--main-theme-color) 60%, transparent);
    --list-backround-color: #f9f9f9; 
    --list-border-color: var(--main-theme-color);
    --list-title-text-color: color-mix(in srgb, var(--main-theme-color) 80%, transparent);
    --list-title-disabled-color: color-mix(in srgb, var(--main-theme-color) 65%, transparent);
    --shadow-color: var(--main-theme-color);
    
    /* Input field */
    --input-field-underline-color: #2e2e2ea2;
    
    /* Options */
    --todo-bar-bg-color: color-mix(in srgb, var(--main-theme-color) 15%, transparent);
    --todo-text-color: var(--main-theme-color);
    --todo-text-disabled-color: color-mix(in srgb, var(--main-theme-color) 65%, transparent);
    
    /* Buttons */
    --button-text-color: var(--main-theme-color);
    --button-hover-bg-color: color-mix(in srgb, var(--main-theme-color) 10%, transparent);
    --button-bg-color: white; /* #f44336;*/
    --button-tab-color: rgb(149, 145, 145);

    /* Fonts */
    --font-family-alt: "Barlow Condensed", sans-serif;
    --font-family: "Barlow", sans-serif;
    
    /* Modals */
    --main-modal-background-color: white;
    --modal-url-button-bg-color: rgb(241, 241, 241);        
    
    background-color: var(--main-background-color);
    min-height: 100vh;
    padding: 0.5rem 0;
}

body {
    font-family: var(--font-family);
    max-width: 600px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
}

.minimum-spacing 
{
  letter-spacing: -0.005rem;
  font-weight: 700;
  font-style: italic;
}

.zero-spacing 
{
  letter-spacing: -0.5rem;
}

.app-logo-style {
    font-family: var(--font-family);
    font-weight: 700; 
    font-size: 3em;
    text-align: center;
    margin: 0em;
}

h1 {
    color: var(--logo-color);
}

h2 {
    text-align: center;
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
}


.app-container {
    display: flex;
    flex-direction: column;
 
}

.mini-mode-element {
    padding: 0.2rem;
    padding-left: 0.3rem;
    text-align: right;
    font-size: calc(0.8rem + 0.4cqw);
    font-family: var(--font-family);  
    color: var(--main-theme-color)
}

input {
  /* border: 1px solid #ccc; */
  transition: all 0.3s ease;
}

textarea {
  /* border: 1px solid #ccc; */
  transition: all 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--input-field-underline-color);
  border-style: none none dotted none;
  border-bottom-width: 0.1rem;
}


.button-tab {
    font-family: var(--font-family-alt);
    cursor: pointer;
    padding: 0.2rem;
    padding-bottom: 0.3rem;
    font-size: calc(0.9rem + 0.6cqw);
    border-color: var(--shadow-color);
    color: var(--shadow-color);
    border-style: solid;
    font-weight: 500;
    box-shadow: calc(0.15rem + 0.2cqw) calc(0.15rem + 0.2cqw) 0 var(--shadow-color);
}

.button-tab-active {
    pointer-events: none; 
    cursor: not-allowed;
    font-weight: 400;
    color: var(--button-tab-color);
    border-color: var(--button-tab-color);
    box-shadow: 0.1rem 0.1rem 0;
}


.top-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    grid-column: 2;
}

.button-help {
    /* border-style: none; */
    opacity: 0.5;
    width: 1.5rem;
    padding: 0;
    grid-column: 3;
    justify-self: end;
    align-self: end;
    margin-bottom: 0.6rem;
    box-shadow: 0.1rem 0.1rem 0;
}

.list-tab-container {
    container-type: inline-size;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    flex-direction: column;
}

.list-tabs {  
    justify-content: center;
    display: flex;
    opacity: 0.6;
    gap: calc(0.1rem + 0.3cqw); 
}


.tabs-explainer {
    font-family: var(--font-family);
    color: var(--logo-color);
    font-size: calc(0.7rem + 0.5cqw);
    width: auto;
    padding: 0.4rem;
    align-items: center;
    justify-content: center;
    display: flex;
    margin: 0.2rem;
    margin-top: 0.5rem;
    margin-bottom: 0.3rem;
}

.list {
    margin: 1rem 0;
    padding: calc(0.2rem + 1cqw);
    padding-bottom: 1rem;
    position: relative;
    border-radius: 0.2rem;
    background-color: var(--list-backround-color);
    border: 0.3rem solid var(--list-border-color);
}

.render-list-container {
    
}


.poll h2 {
    margin-top: 0;
    padding-bottom: 1rem;
    justify-content: center;
    text-align: center;
}   


.poll-value {
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
}

.poll-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.todo-nickname {
    position: absolute;
    right: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-family);
    font-size: 0.9rem;
    color: var(--main-theme-color);
    background: rgba(255, 255, 255, 0.85);
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    border: none;
    text-align: right;
    cursor: default;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.15s ease;
    /* Šířka co nejužší, wrap povolený, bez dělení slov */
    width: max-content;
    max-width: 10rem;
    white-space: normal;
    word-break: keep-all;
}

/* Hover target - zvětší aktivní oblast doleva */
.todo-nickname::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: -3rem;
}

.todo-nickname:hover {  
    opacity: 1;
}

;; Dropdown

.dropdown-choice {
    font-family: var(--font-family);
    font-size: calc(0.9rem + 0.4cqw);
    color: var(--main-theme-color);
    border: none;
    border-radius: 2rem;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
    text-align: center;
    resize: none;
    cursor: pointer;
    
}

.dropdown-choices {
    position: absolute;
    top: 0.05rem;
    left: 0rem;
    display: flex;
    flex-direction: column;
    /* position: absolute; */
    /* right: 0; */
    background-color: var(--list-backround-color);
    border: 0.2rem solid var(--list-border-color);
    border-radius: 1.3rem;
    padding: 0.2rem;
    padding-left: 0.2rem; 
    padding-right: 0.2rem;
    gap: 0.2rem;
    z-index: 9;
    box-shadow: 0.2rem 0.2rem 0 var(--shadow-color);
    width: fit-content;
    max-width: 12rem;
    text-align: center;
    opacity: 1;
    transition: opacity 0.2s ease;
    --webkit-width: fit-content;
    text-wrap: nowrap;
    padding-bottom: 0.3rem;
}


.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 8;
}

.dropdown-choices.without-dropdown {
    position: relative; 
    box-shadow: none;
    border: none; 
    border-radius: 2rem;
    background-color: transparent;
    transition: opacity 0.2s ease;
    z-index: 3;
    text-align: center;
}

.dropdown-choice:hover {
    /* background-color: var(--main-theme-color);
    color: var(--main-background-color);
    padding: 0.1rem; */
}

.dropdown-choice.selected {
    background-color: var(--main-theme-color);
    color: var(--main-background-color);
    padding: 0.2rem;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
    border-radius: 2rem;
    z-index: 1;
    text-align: center;
    border: none;
}


.mode-icon {
    font-size: calc(0.9rem + 1cqw);
    font-family: var(--font-family-alt);
    margin: 0.1rem;
    vertical-align: middle;
    text-align: right;
}


.list-title-container {
    display: flex;
    align-items: center;
    margin-bottom: 1em;
    container-type: inline-size;
}

.list-title {
    font-family: var(--font-family-alt);
    font-size: calc(1.4em + 2cqw);
    font-weight: 500;
    text-align: left;
    border: none;
    outline: none;
    padding: 0 0 0.3rem 0.5rem;
    word-wrap: break-word;
    background-color: transparent;
    resize: none;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
    width: 100%;
    color: var(--poll-title-text-color);
    field-sizing: content;
    min-height: 31h;
}

.list-title:disabled {
    color: var(--poll-title-disabled-color);
    opacity: 1;  /* vynutit plnou opacity */
    -webkit-text-fill-color: var(--poll-title-disabled-color);
}

.todo-checkbox {
    width: 1.5em;
    /* height: 1.5em; */
    margin-right: 0.5rem;
    flex-shrink: 0;
    z-index: 2; /* Zajištění, že je nad pozadím */
}

.todo-text {
    font-family: var(--font-family);    
    font-size: calc(1rem + 1cqw);
    text-align: left;
    border-width: 0;
    border: none;
    resize: none;
    outline: none;
    background-color: transparent;
    width: 100%;
    color: var(--todo-text-color);
    padding-left: 0.2rem;
    padding-bottom: 0.3rem;
    field-sizing: content;
    min-height: 31h;
    position: relative;
    z-index: 2; /* Zajištění, že je nad pozadím */
}


.todo-text:disabled {
   color: var(--todo-text-disabled-color);
   opacity: 1;  /* vynutit plnou opacity */
    -webkit-text-fill-color: var(--todo-text-disabled-color);
}

.list-todos {
    margin: 0.2rem;
    padding-bottom: 0.6rem;
    color: var(--todo-text-color);
    background-color: transparent;
}

.todo-container {
    position: relative;
    display: flex;
    gap: 0.1rem;
    user-select: none;
    -webkit-user-select: none;
    border-radius: 0.2rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    padding: 0.2rem;
    border-style: dotted;
    border-color: var(--todo-bar-bg-color);
    container-type: inline-size;
}

.todo-background {
    position: absolute;
    top: 5%;
    left: 0.2rem;
    height: 90%;
    background: repeating-linear-gradient(
        -45deg, 
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.1) 0.3rem,
        rgba(255, 255, 255, 0) 0.3rem,
        rgba(255, 255, 255, 0) 0.6rem
    );   
    z-index: 1; /* Zajištění, že je pod textarea */
}

.todo-bar-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between; 
    cursor: pointer;
}

.todo-bar-container.disabled {
    cursor: not-allowed;
    pointer-events: none;
}


.todo-bar-buttons {
    padding-left: 0.03rem;
    padding-top: 0.1rem;
    padding-bottom: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vote-count-label {
    width: 3rem;
    text-align: right;
    font-weight: bold;
    border: none;
    padding: none;
    margin: none;
    background: transparent;
}

.option-buttons-container
{
    display: flex;
    align-items: center;
    margin-left: 1em;

}

.app-menu-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
}


.reorder-buttons {
    display: flex;
    flex-direction: row;
    margin-left: 0.5rem;
    gap: 0.3rem;
}

.ro-mini {
    padding: 0.1rem !important; 
    font-size: 1.3rem;
    border: none;
    background: transparent;
}

.ro-mini:disabled {
    opacity: 0.5;
    display: none;
    cursor: not-allowed;
    pointer-events: none;
}

button {
    color: var(--button-text-color); 
    -webkit-appearance: none; /* Vypnutí nativního stylu iOS */
    appearance: none;
    font-family: var(--font-family);
    font-weight: 700;
    background-color: var(--button-bg-color);
    padding: 0.4rem;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    margin: 0.2rem;
    cursor: pointer;
    position: relative;
    opacity: 1;
    border-style: solid;
    border-color: var(--shadow-color);;
    border-width: 0.2rem;
}

.button-main {
    color: var(--button-text-color);
    background-color: var(--button-bg-color);
    opacity: 1;
    font-size: 1.1rem;    
    box-shadow: 0.2rem 0.2rem 0 var(--shadow-color);
    width: fit-content;
}


button:hover {
    background-color: var(--button-hover-bg-color);
}

.plus-todo-button {
    font-size: 1rem;
    padding: 0rem;
}


.button-small {
    box-sizing: border-box;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(1.2rem + 0.4cqw);
    margin: 0.1em;
    padding: 0 0 0.1em 0;
    width: 1.3em;
    height: 1.3em;
    flex-shrink: 0;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0.1rem 0.1rem 0 var(--shadow-color);
}

.button-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}


.button-small:hover {
    color: var(--button-text-color);
    opacity: 1;
}
    
.setting-box {
    width: 2.4rem;
    display: flex;
    align-items: center;
    margin-right: 0;
    margin-bottom: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
}


.setting-text {
    font-family: var(--font-family);
    font-size: 1.2rem;
    font-weight: 600;
    align-content: center;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
}

.option-bar {
    cursor: pointer;
    width: 100%;
    height: 2em;
    align-items: center;    
    padding-left: 0em;
    position: relative;
    margin-right: 1em;
    box-sizing: border-box;
    background-color: var(--main-theme-color);
    color: var(--main-theme-color);
}

.option-bar.disabled {
    cursor: not-allowed;
    pointer-events: none;
    background: repeating-linear-gradient(
     -45deg, transparent, transparent 0.3rem,
     color-mix(in srgb, var(--main-theme-color) 80%, transparent) 0.3rem,
     color-mix(in srgb, var(--main-theme-color) 80%, transparent) 0.6rem); 
}

.poll-option-bar-container {
    position: relative;
}


.option-second-row-container {
    display: flex;
    align-content: center;
    justify-content: space-between;
    align-items: center;
}

input::placeholder,
textarea::placeholder {
    color: var(--main-theme-color);
    opacity: 0.5;
}

.drag-handle { 
    cursor: grab; 
    touch-action: none;
    font-size: calc(1.2rem + 0.5cqw);
    margin-right: 0.3rem;
    color: var(--option-label-color);
}

.drag-handle:active { 
    cursor: grabbing; 
}

.poll-option-bar-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        -45deg, 
        rgba(0, 0, 0, 0.3),
        rgba(0, 0, 0, 0.3) 0.3rem,
        rgba(255, 255, 255, 0.6) 0.3rem,
        rgba(255, 255, 255, 0.6) 0.6rem
    );
    mix-blend-mode: difference;
    mask-image: linear-gradient(to right, var(--main-theme-color), transparent);
    -webkit-mask-image: linear-gradient(to right, var(--main-theme-color), transparent);
    pointer-events: none;
    clip-path: inset(0 100% 0 0); /* začíná zcela oříznutý */
    transition: clip-path 0.5s ease; /* plynulý přechod */
}

.poll-option-bar-container:hover::after {
    clip-path: inset(0 0 0 0); /* zobrazuje celou plochu */
}


.bottom-list-container {
    flex-flow: row;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bottom-list-container.align-end {
    justify-content: flex-end;
}

.new-todo-button {
    margin-top: 0.3rem;
    margin-left: 0rem;
    box-shadow: 0.2rem 0.2rem 0 var(--shadow-color);
}

.arrow-box {
    display: flex;
    flex-direction: row;
}


.all-users-container {
    border-style: dotted;
    border-radius: 0.2rem;
    margin: 1rem;
    border-color: var(--button-tab-color);
}

.one-user-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.2rem;
    flex-wrap: nowrap;
}

.nickname-container {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 1;
    min-width: 3rem;
    max-width: 12rem;
}

.nickname {
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--main-theme-color);
    border: none;
    text-align: right;
    resize: none;
    cursor: text;
    width: 100%;
    min-width: 3rem;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-y: hidden;
    field-sizing: content;
}


.vote-controls {
    display: flex;
    margin: 0.2rem;
    font-size: 1rem;
    align-items: baseline; 
}

.vote-mode-toggle {
    justify-content: center;
    text-align: center;
    margin-right: 0.6rem;
    opacity: 0.85;
    cursor: pointer;
}

.total-votes-label {
    opacity: 0.8;
    display: flex;          /* Přidej toto */
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: color-mix(in srgb, var(--main-theme-color) 60%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    align-items: flex-start;
    padding-top: 5vh;
    padding-bottom: 5vh;
}

.modal-dialog {
    position: relative;
    background: var(--main-modal-background-color);
    padding: 2rem;
    padding-bottom: 3rem;
    border-radius: 0.2rem;
    min-width: 20rem;
    max-width: 40rem;
    font-weight: normal;
    border-width: 0.3rem;
    border-style: solid;
    border-color: var(--shadow-color);
    max-height: 80vh;
    overflow-y: auto;
    color: var(--main-theme-color);
}


.modal-message-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-paragraph {
    font-family: var(--font-family);
    margin: 0.5rem;
    width: auto;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.4;
}

.modal-setting-container {
    display: flex;
    flex-direction: column;
    border: 0.2rem var(--option-bar-bg-color) dotted;
    border-radius: 0.2rem;
}

.modal-setting-element {
    font-family: var(--font-family);
    justify-content: center;
    margin: 0.5rem;
    width: auto;
    display: flex;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0;
}

.modal-button-container {
    position: absolute;
    top: 0em;
    right: 0em;
    margin: 1em;
}


.modal-yes-no-button-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    gap: 1em;  /* mezera mezi buttony */
}

.modal-close {
    box-shadow: 0.2rem 0.2rem 0 var(--shadow-color);;
}

.modal-url-button {
    font-size: 0.9rem;
    padding: 0.3rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    background: var(--modal-url-button-bg-color);
    box-shadow: 0.2rem 0.2rem 0 var(--shadow-color);;
}

.footnote {
    font-family: var(--font-family);
    font-size: 0.8rem;
    bottom: 0;
    right: 0;
    margin-bottom: 0.3rem;
    margin-right: 1.2rem;
    color: var(--option-bar-bg-color);
    position: absolute;   
}

.footnote a:visited { 
    color: var(--option-bar-bg-color) !important;
}

.footnote a {
    color: var(--option-bar-bg-color);
}

.iframe  {
    position: relative;
    font-size: 0.9em;
    text-align: center;
    opacity: 0.6;
}