/* Microsoft Forms inspired design */

:root {
    --primary-color: #1BA5B8;
    --primary-hover: #158a9a;
    --background: #f3f2f1;
    --card-bg: #ffffff;
    --text-color: #323130;
    --text-secondary: #605e5c;
    --border-color: #edebe9;
    --error-color: #a4262c;
    --success-color: #107c10;
    --input-border: #8a8886;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header - kompaktnejsi */
.form-header {
    background: var(--primary-color);
    color: white;
    padding: 16px 20px;
    text-align: center;
}

.form-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 0;
}

.form-header p {
    opacity: 0.9;
    font-size: 13px;
}

/* Sticky header pro formulář */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 20px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sticky-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.sticky-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.sticky-header .header-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sticky-header .save-status {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.sticky-header .save-status.saving {
    background: #fff3cd;
    color: #856404;
}

.sticky-header .save-status.saved {
    background: #d4edda;
    color: #155724;
}

.sticky-header .save-status.error {
    background: #f8d7da;
    color: #721c24;
}

.sticky-header .save-status.sync {
    background: #cce5ff;
    color: #004085;
}

/* Status badge - stav odeslání formuláře */
.status-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.status-badge.draft {
    background: #f39c12;
    color: white;
}

.status-badge.submitted {
    background: #27ae60;
    color: white;
}

/* Navigation buttons in header */
.header-nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}

.nav-btn:active {
    background: rgba(255,255,255,0.35);
}

.nav-btn svg {
    flex-shrink: 0;
}

/* Button group for prev/next */
.nav-btn-group {
    display: flex;
}

.nav-btn-group .nav-btn-left {
    border-radius: 16px 0 0 16px;
    border-right: none;
    padding: 6px 8px;
}

.nav-btn-group .nav-btn-right {
    border-radius: 0 16px 16px 0;
    padding: 6px 12px 6px 10px;
}

@media (max-width: 640px) {
    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .nav-btn span {
        display: none;
    }

    .nav-btn {
        padding: 8px;
        border-radius: 50%;
    }

    .nav-btn-group .nav-btn-left {
        border-radius: 16px 0 0 16px;
        padding: 6px 6px;
    }

    .nav-btn-group .nav-btn-right {
        border-radius: 0 16px 16px 0;
        padding: 6px 6px;
    }
}

/* Progress bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.progress-bar {
    height: 100%;
    background: white;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 6px rgba(255,255,255,0.5);
}

.progress-text {
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Odsazení kontejneru pod sticky header */
.form-container {
    padding-top: 16px;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

/* Question Card - kompaktni design */
.question-card {
    background: var(--card-bg);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.question-card.required .question-text::after {
    content: ' *';
    color: var(--error-color);
}

.question-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    flex: 1;
    min-width: 200px;
    margin: 0;
}

/* Informacni texty kurzivou */
.form-description {
    font-size: 15px;
    color: var(--text-color);
    background: linear-gradient(135deg, #e8f7f9 0%, #f0fbfc 100%);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(27, 165, 184, 0.1);
}

.form-description a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.form-description a:hover {
    border-bottom-color: var(--primary-color);
}

.question-description {
    font-size: 13px;
    font-style: italic;
    color: var(--text-secondary);
    width: 100%;
    margin-top: 4px;
}

/* Skupina otazek */
.question-group {
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    padding: 16px 20px;
    margin: 24px 0 12px 0;
}

.question-group:first-child {
    margin-top: 0;
}

.group-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.group-description {
    font-size: 13px;
    font-style: italic;
    opacity: 0.9;
    margin-top: 8px;
    line-height: 1.5;
}

/* Rating select - rolovaci pole */
.rating-select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-family: inherit;
    min-width: 180px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.rating-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.rating-select:hover {
    border-color: var(--primary-color);
}

/* Input styles */
.text-input,
.textarea-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--input-border);
    border-radius: 2px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.text-input:focus,
.textarea-input:focus {
    outline: none;
    border-color: var(--primary-color);
    border-width: 2px;
    padding: 7px 11px;
}

.textarea-input {
    min-height: 100px;
    resize: vertical;
}

/* Radio and Checkbox */
.option-list {
    list-style: none;
}

.option-item {
    margin-bottom: 12px;
}

.option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.option-label:hover {
    background: var(--background);
}

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    accent-color: var(--primary-color);
}

.option-label input[type="radio"]:focus,
.option-label input[type="checkbox"]:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.option-label:has(input:focus) {
    background: var(--primary-color);
    background: rgba(27, 165, 184, 0.1);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.option-label span {
    font-size: 14px;
}

/* Focus styles pro rating select */
.rating-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(27, 165, 184, 0.2);
}

/* Focus styles pro textové pole */
.text-input:focus,
.textarea-input:focus {
    box-shadow: 0 0 0 3px rgba(27, 165, 184, 0.2);
}

/* Zvýraznění karty otázky při focusu uvnitř */
.question-card:focus-within {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 0 0 2px var(--primary-color);
}

/* Submit button */
.submit-section {
    margin-top: 24px;
    text-align: center;
}

.btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    background: #c8c6c4;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    margin-left: 8px;
}

.btn-secondary:hover {
    background: rgba(27, 165, 184, 0.1);
}

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

.action-btn .icon {
    font-size: 14px;
    line-height: 1;
}

/* Přehled - statistiky formuláře */
.action-btn-stats {
    background: linear-gradient(135deg, #e8f4fd 0%, #d1e9f6 100%);
    color: #0078d4;
    border: 1px solid #b3d7f0;
}

.action-btn-stats:hover {
    background: linear-gradient(135deg, #d1e9f6 0%, #b3d7f0 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 120, 212, 0.2);
}

/* Odpovědi - seznam odpovědí */
.action-btn-responses {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.action-btn-responses:hover {
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(46, 125, 50, 0.2);
}

/* Detail uživatele */
.action-btn-detail {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
    border: 1px solid #ffcc80;
}

.action-btn-detail:hover {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(230, 81, 0, 0.2);
}

/* Tooltip */
.action-btn[data-tooltip] {
    position: relative;
}

.action-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: #333;
    color: white;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    pointer-events: none;
}

.action-btn[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    pointer-events: none;
}

.action-btn[data-tooltip]:hover::after,
.action-btn[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Action buttons wrapper */
.action-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Status messages */
.save-status {
    text-align: center;
    padding: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.save-status.saving {
    color: var(--primary-color);
}

.save-status.saved {
    color: var(--success-color);
}

.save-status.error {
    color: var(--error-color);
}

/* Error message */
.error-message {
    background: #fde7e9;
    color: var(--error-color);
    padding: 16px 20px;
    border-radius: 4px;
    margin-bottom: 16px;
    text-align: center;
}

/* Success page */
.success-page {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.success-page h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.success-page p {
    color: var(--text-secondary);
}

/* Deadline notice */
.deadline-notice {
    background: #e7f3ff;
    color: #0066cc;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 8px;
    text-align: center;
    font-size: 14px;
}

/* Expired notice */
.expired-notice {
    background: #f8d7da;
    color: #721c24;
    padding: 16px 20px;
    border-radius: 4px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 500;
}

/* Already submitted */
.submitted-notice {
    background: #fff4ce;
    color: #8a6914;
    padding: 16px 20px;
    border-radius: 4px;
    margin-bottom: 16px;
    text-align: center;
}

/* Login page */
.login-card {
    background: var(--card-bg);
    border-radius: 4px;
    box-shadow: 0 1.6px 3.6px rgba(0,0,0,0.13), 0 0.3px 0.9px rgba(0,0,0,0.1);
    padding: 40px;
    max-width: 400px;
    margin: 60px auto;
    text-align: center;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 16px;
}

.login-card h2 {
    margin-bottom: 24px;
}

.login-card .text-input {
    margin-bottom: 16px;
}

/* Admin styles */
.admin-header {
    background: var(--primary-color);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-header-actions a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    background: rgba(255,255,255,0.15);
    transition: background 0.2s;
}

.admin-header-actions a:hover {
    background: rgba(255,255,255,0.25);
}

.admin-nav-wrapper {
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 24px;
}

.admin-nav {
    display: flex;
    gap: 4px;
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: auto;
    padding: 8px 0;
}

.admin-nav a {
    color: #444;
    text-decoration: none;
    transition: all 0.2s;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav a:hover {
    background: #e8e8e8;
    color: #222;
}

.admin-nav a.active {
    background: var(--primary-color);
    color: white;
}

.admin-nav .nav-separator {
    width: 1px;
    background: #ddd;
    margin: 4px 8px;
    align-self: stretch;
}

.admin-nav .nav-icon {
    font-size: 18px;
    line-height: 1;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 4px;
    box-shadow: 0 1.6px 3.6px rgba(0,0,0,0.13);
    padding: 24px;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Table */
.data-table {
    width: 100%;
    background: var(--card-bg);
    border-radius: 4px;
    box-shadow: 0 1.6px 3.6px rgba(0,0,0,0.13);
    border-collapse: collapse;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: #e8e6e4;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.data-table th a {
    color: inherit;
    text-decoration: none;
}

.data-table th a:hover {
    color: var(--primary-color);
}

.data-table tr:hover {
    background: var(--background);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-color);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Form group */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 2px;
}

.badge-success {
    background: #dff6dd;
    color: var(--success-color);
}

.badge-warning {
    background: #fff4ce;
    color: #8a6914;
}

/* Responsive */
@media (max-width: 640px) {
    .form-header {
        padding: 16px;
    }

    .form-header h1 {
        font-size: 18px;
    }

    /* Sticky header na mobilu - zajistit viditelnost */
    .sticky-header {
        position: sticky;
        position: -webkit-sticky;
        top: 0;
        padding: 10px 12px 8px;
    }

    .sticky-header .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .sticky-header h1 {
        font-size: 16px;
        text-align: center;
    }

    .sticky-header .header-status {
        justify-content: center;
        flex-wrap: wrap;
    }

    .sticky-header .save-status {
        font-size: 11px;
        padding: 4px 10px;
        max-width: 100%;
        text-align: center;
    }

    .container {
        padding: 8px;
    }

    .question-card {
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
    }

    .question-text {
        min-width: auto;
    }

    .rating-select {
        width: 100%;
    }

    .admin-header {
        flex-direction: column;
        text-align: center;
        padding: 12px 16px;
    }

    .admin-nav-wrapper {
        padding: 0 12px;
    }

    .admin-nav a {
        padding: 10px 14px;
        font-size: 13px;
    }

    .admin-nav .nav-icon {
        font-size: 16px;
    }
}

/* Landing page */
.landing-page {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 48px 40px;
    max-width: 700px;
    margin: 40px auto;
    text-align: center;
}

.landing-icon {
    margin-bottom: 24px;
}

.landing-page h2 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.landing-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.landing-info {
    background: var(--background);
    border-radius: 8px;
    padding: 24px 32px;
    text-align: left;
    margin-bottom: 32px;
}

.landing-info h3 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 16px;
}

.landing-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.landing-info li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 15px;
    color: var(--text-color);
    line-height: 1.6;
}

.landing-info li:last-child {
    border-bottom: none;
}

.landing-info li strong {
    color: var(--primary-color);
}

.landing-contact {
    color: var(--text-secondary);
    font-size: 14px;
}

.landing-contact p {
    margin-bottom: 8px;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Sync notifikace - plovouci okno dole */
.sync-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.sync-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #0066cc;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    max-width: 90%;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.sync-notification span {
    font-size: 15px;
    line-height: 1.4;
}

.sync-notification button {
    background: white;
    color: #0066cc;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.sync-notification button:hover {
    background: #f0f0f0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

