/* =====================================
   GLOBAL TONE
===================================== */

:root {
    --color-bg: #f9fafb;
    --color-card: #ffffff;
    --color-border: #e5e7eb;

    --color-text-primary: #1f2937;
    --color-text-secondary: #6b7280;

    --color-accent: #d11f1f;        /* hlavní REDA */
    --color-accent-dark: #a31818;   /* hover */

    --color-success-bg: #e6f4ea;
    --color-success-text: #166534;

    --color-warning-bg: #fff4e5;
    --color-warning-text: #9a3412;

    --color-danger-bg: #fde8e8;
    --color-danger-text: #991b1b;
}

body {
    background: var(--color-bg);
    color: var(--color-text-primary);
}


/* =====================================
   TOPBAR
===================================== */

.app-topbar {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    padding: 18px 0;
}

.app-topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-brand {
    font-weight: 600;
    font-size: 18px;
    color: var(--color-text-primary);
    letter-spacing: 0.3px;
}

.app-brand-link {
    text-decoration: none;
    color: inherit;
}

.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-user {
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.app-nav-link {
    position: relative;
    text-decoration: none;
    padding: 6px 4px;
    color: var(--color-text-primary);
    transition: color 0.2s ease;
}

.app-nav-link:hover {
    color: var(--color-accent);
}

.app-nav-link.active {
    color: var(--color-accent);
    font-weight: 600;
}

.app-nav-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    background: var(--color-accent);
    border-radius: 2px;
}

/* Language */

.app-lang {
    display: inline-flex;
    gap: 6px;
}

.lang-link {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    color: var(--color-text-secondary);
    transition: background 0.2s ease;
}

.lang-link:hover {
    background: #f3f4f6;
}

.lang-link.active-lang {
    background: #e5e7eb;
    font-weight: 600;
}

/* Logout */

.logout-link {
    font-size: 14px;
    color: var(--color-danger-text);
    text-decoration: none;
}

.logout-link:hover {
    text-decoration: underline;
}

/* =====================================
   PAGE HEADER (TITLE + BACK BUTTON)
===================================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-header .page-title {
    margin: 0;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-secondary {
    background: #1f3a8a;
    color: #ffffff;
    border: 1px solid #1f3a8a;
    box-shadow: 0 2px 6px rgba(31, 58, 138, 0.25);
}

.btn-secondary:hover {
    background: #1e40af;
    border-color: #1e40af;
    transform: translateY(-1px);
}

/* =====================================
   USER COMMENT (ANKETA)
===================================== */

.komentar-wrapper {
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: left;
}

.komentar-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-text-secondary);
}

.komentar-textarea {
    width: 100%;
    resize: vertical;
    min-height: 90px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: #ffffff;
    color: var(--color-text-primary);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.komentar-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(55, 65, 81, 0.08);
}

/* tlačítka pod komentářem odděleně */

.hlasovani-buttons {
    display: flex;
    gap: 16px;
    margin-top: 25px;
}

.hlasovani-karta .komentar-wrapper {
    text-align: left;
    width: 100%;
}

@media (max-width: 640px) {
    .hlasovani-buttons {
        flex-direction: column;
    }
}



/* =====================================
   MAIN CONTAINER
===================================== */

.app-main {
    max-width: 920px;
    margin: 60px auto;
    padding: 0 28px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
}


/* =====================================
   CARD
===================================== */

.card {
    background: var(--color-card);
    padding: 28px;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 25px rgba(0,0,0,0.04);
    margin-bottom: 28px;
}


/* =====================================
   OVERVIEW SECTION
===================================== */

.voting-overview-wrapper {
    max-width: 880px;
    margin: 0 auto;
}

.voting-overview-header {
    margin-bottom: 40px;
}

.voting-overview-subtitle {
    margin-top: 8px;
    color: var(--color-text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.voting-grid {
    display: grid;
    gap: 28px;
}


/* =====================================
   OVERVIEW CARD
===================================== */

.voting-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.voting-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.voting-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.voting-card-left {
    flex: 1;
    max-width: 65%;
}

.voting-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.voting-description {
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.voting-card-footer {
    margin-top: 24px;
}

.primary-button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    background: var(--color-accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: background .2s ease;
}

.primary-button:hover {
    background: var(--color-accent-dark);
}


/* =====================================
   MINI PREVIEW
===================================== */

.voting-card-preview {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.voting-preview-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(0,0,0,0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.voting-preview-thumb:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 28px rgba(0,0,0,0.12);
}


/* =====================================
   PROGRESS BAR
===================================== */

.progress-wrapper {
    margin-bottom: 35px;
}

.progress-text {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--color-text-secondary);
}

.progress-track {
    background: var(--color-border);
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 10px;
    background: var(--color-accent);
    border-radius: 999px;
    transition: width 0.4s ease;
}


/* =====================================
   HLASOVÁNÍ DETAIL
===================================== */

.hlasovani-karta {
    text-align: center;
    padding: 50px 40px;
    border-radius: 22px;
    border: 1px solid var(--color-border);
    box-shadow: 0 18px 40px rgba(0,0,0,0.05);
}

.produkt-obrazek {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 16px;
    margin-bottom: 30px;
}

.hlasovani-karta h2 {
    font-size: 24px;
    margin-bottom: 14px;
}

.hlasovani-karta p {
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

.cena {
    font-size: 19px;
    font-weight: 600;
    margin-top: 10px;
    color: var(--color-accent-dark);
}


/* =====================================
   VOTING BUTTONS
===================================== */

.hlasovani-form {
    display: block;
    gap: 16px;
    margin-top: 35px;
}

.hlasovani-form button {
    flex: 1;
    padding: 15px 0;
    border-radius: 14px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-green {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.btn-orange {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.btn-red {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
}

.btn-green:hover { background: #d1fae5; }
.btn-orange:hover { background: #ffedd5; }
.btn-red:hover { background: #fee2e2; }


/* =====================================
   TOAST
===================================== */

.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    min-width: 280px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    animation: toast-in 0.3s ease forwards;
}

.toast-success { background: #2e7d32; }
.toast-error   { background: #b91c1c; }
.toast-warning { background: #c2410c; }
.toast-info    { background: var(--color-accent); }

.toast-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(-20px); }
}

/* =====================================
   MOJE_HLASY
===================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 10px 8px;
    text-align: left;
    vertical-align: middle;
}

.data-table th:first-child,
.data-table td:first-child {
    width: 60px;
}

.data-table tbody tr:not(:last-child) {
    border-bottom: 1px solid var(--color-border);
}

.data-table tbody tr:hover {
    background: rgba(0,0,0,0.02);
}

.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    display: block;
}

.vote-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}

.vote-keep {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.vote-replace {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
}

.vote-remove {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.vote-none {
    background: rgba(107, 114, 128, 0.08);
    color: #6b7280;
}

.page-actions {
    margin-bottom: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-secondary {
    background: #1f3a8a;
    color: #ffffff;
    border: 1px solid #1f3a8a;
    box-shadow: 0 2px 6px rgba(31, 58, 138, 0.25);
}

.btn-secondary:hover {
    background: #1e40af;
    border-color: #1e40af;
}

/* komentáře - moje hlasování - výpis*/

.user-comment {
    max-width: 280px;
    font-size: 13px;
    color: #555;
}

/* ================================
   LOGIN
================================ */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.login-card {
    width: 420px;
    max-width: 90%;
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-header h1 {
    margin: 0;
}

.login-error {
    background: #ffeaea;
    color: #b30000;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-form label {
    font-weight: 600;
    font-size: 14px;
}

.login-form input {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.login-form input:focus {
    outline: none;
    border-color: #d11f1f;
}

.login-form button {
    margin-top: 10px;
}

/* BUTTONS */

.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary {
    background: #d11f1f;
    border: 1px solid #d11f1f;
}
.btn-secondary:hover {
    background: #a31818;
}

/* ================================
   FOOTER
================================ */

.app-footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #777;
}

.app-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

/* =====================================
   MOBILE
===================================== */

@media (max-width: 768px) {

    .voting-card-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .voting-card-left {
        max-width: 100%;
    }

    .voting-card-preview {
        justify-content: flex-start;
    }

    .hlasovani-form {
        flex-direction: column;
    }
}

/*LOGO Hlavička*/

.app-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    max-height: 50px;
}

.app-brand-link {
    display: flex;
    align-items: center;
}

