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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 10px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
    overflow: visible;
}

header {
    background: #fff;
    color: #333;
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

header h1 {
    font-size: 22px;
    font-weight: 600;
}

main {
    padding: 20px;
}

.task-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #666;
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600 !important;
    cursor: pointer;
    padding: 10px 14px;
    border: 1px solid #d7d7d7;
    border-radius: 999px;
    background: #fafafa;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.radio-option input[type="radio"] {
    margin: 0;
    accent-color: #333;
    transform: scale(1.05);
}

.checkbox-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.checkbox-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600 !important;
    cursor: pointer;
    min-width: 72px;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid #d7d7d7;
    border-radius: 999px;
    background: #fafafa;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.checkbox-option input[type="checkbox"] {
    margin: 0;
    accent-color: #333;
    transform: scale(1.05);
}

.radio-option:hover,
.checkbox-option:hover {
    border-color: #999;
    background: #f2f2f2;
}

.radio-option:has(input:checked),
.checkbox-option:has(input:checked) {
    border-color: #333;
    background: #efefef;
    box-shadow: inset 0 0 0 1px #333;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 0;
}

.btn {
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.btn-primary {
    background: #333;
    color: white;
    border-color: #333;
}

.btn-primary:hover {
    background: #555;
    border-color: #555;
}

.btn-primary:active {
    background: #222;
}

.btn-secondary {
    background: #fff;
    color: #333;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.message {
    margin: 20px 0;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
    text-align: center;
    font-weight: 500;
    width: 100%;
    clear: both;
}

.message-text {
    width: 100%;
}

.message-actions {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.btn-report-error {
    flex: 0 1 auto;
    min-width: 240px;
}

.message-report-status {
    margin-top: 10px;
    font-size: 13px;
}

.message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    display: block;
}

.message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    display: block;
}

.message.info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    display: block;
}

.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* File upload styles */
.file-input-wrapper {
    position: relative;
}

.form-file-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.btn-file {
    padding: 10px 20px;
    background: white;
    color: #333;
    border: 2px dashed #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.btn-file:hover {
    border-color: #666;
    background: #f9f9f9;
}

.field-hint {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.file-preview-area {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.file-preview-area .no-files {
    color: #999;
    font-size: 13px;
    text-align: center;
    margin: 10px 0;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    margin-bottom: 8px;
    gap: 10px;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-name {
    flex: 1;
    font-size: 13px;
    color: #333;
    word-break: break-all;
}

.file-size {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.btn-remove-file {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 3px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-file:hover {
    background: #cc0000;
}

/* Field error styles */
.field-error {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 5px;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea,
.form-group.has-error .btn-file {
    border-color: #d32f2f;
}

.required {
    color: #d32f2f;
}

/* Project Selector Styles */
.project-selector {
    padding: 30px 20px;
    overflow: visible;
}

.project-selector h2 {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
}

.projects-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
    overflow: visible;
}

.projects-grid.main {
    grid-template-columns: repeat(3, 1fr);
}

.projects-grid.secondary {
    grid-template-columns: repeat(5, 1fr);
}

/* Homepage needs more width for 5 secondary cards on desktop */
.home-page .container {
    max-width: 1200px;
}

.home-page .projects-grid.secondary {
    gap: 16px;
}

.home-page .project-card.secondary {
    min-height: 130px;
    padding: 16px 14px;
}

.home-page .project-card.secondary .project-icon {
    font-size: 34px;
}

.home-page .project-card.secondary .project-title {
    font-size: 15px;
}

.home-page .project-card.secondary .project-description {
    font-size: 11px;
    line-height: 1.35;
}

.project-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    color: #333 !important;
}

.project-card:hover {
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    text-decoration: none !important;
}

.page-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding: 10px 20px;
    color: #666;
    font-size: 11px;
}

.page-footer-version {
    white-space: nowrap;
    order: 2;
}

.page-footer-contact {
    text-align: center;
    order: 1;
}

.page-footer-contact a {
    color: #007bff;
    text-decoration: none;
}

.project-card * {
    text-decoration: none !important;
}

.project-card.main {
    min-height: 180px;
    padding: 32px;
}

.project-card.secondary {
    min-height: 140px;
    padding: 20px;
}

.project-icon {
    font-size: 48px;
    line-height: 1;
}

.project-card.main .project-icon {
    font-size: 56px;
}

.project-card.secondary .project-icon {
    font-size: 40px;
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.project-card.main .project-title {
    font-size: 20px;
}

.project-card.secondary .project-title {
    font-size: 16px;
}

.project-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

.project-card.secondary .project-description {
    font-size: 12px;
}

/* Tooltip styles */
.project-card.has-tooltip {
    position: relative;
    overflow: visible;
}

.project-card.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, top 0.25s ease;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.project-card.has-tooltip::before {
    content: '';
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, top 0.25s ease;
    z-index: 9999;
}

.project-card.has-tooltip:hover::after {
    opacity: 1;
    top: calc(100% + 16px);
}

.project-card.has-tooltip:hover::before {
    opacity: 1;
    top: calc(100% + 8px);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 15px;
}

.back-button:hover {
    background: #e0e0e0;
    border-color: #999;
}

.section-divider {
    margin: 40px 0 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}

/* Hidden state */
.hidden {
    display: none !important;
}

/* Responsive design */
@media (max-width: 1024px) {
    /* Vypnout tooltip na tabletech a mobilech (dotyková zařízení) */
    .project-card.has-tooltip::after,
    .project-card.has-tooltip::before {
        display: none !important;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    /* Tablet - zachovat stejné rozložení */
    .projects-grid.main {
        grid-template-columns: repeat(3, 1fr);
    }
    .projects-grid.secondary {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    main {
        padding: 20px;
    }

    header h1 {
        font-size: 22px;
    }

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

    .btn {
        width: 100%;
    }

    .projects-grid.main,
    .projects-grid.secondary {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .project-card.main,
    .project-card.secondary {
        width: 100%;
        min-height: 140px;
    }

    .project-selector {
        padding: 20px 15px;
    }

    .project-selector h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .page-footer-contact {
        text-align: center;
    }
}
