/* Správa Poptávek - CSS styly pro formulář */

.poptavky-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    /*background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);*/
}

.poptavky-form .form-group {
    margin-bottom: 20px;
    position: relative;
}

.poptavky-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.poptavky-form input[type="text"],
.poptavky-form input[type="email"],
.poptavky-form input[type="tel"],
.poptavky-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.poptavky-form input[type="text"]:focus,
.poptavky-form input[type="email"]:focus,
.poptavky-form input[type="tel"]:focus,
.poptavky-form textarea:focus {
    outline: none;
    border-color: #ed0000;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.3);
}

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

/* File upload styling */
.file-upload-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
}

.poptavky-form input[type="file"] {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.btn-attach {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #000;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-attach:hover {
    background: #111;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.btn-attach:active {
    transform: translateY(0);
}

.btn-location {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #555;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.btn-location:hover {
    background: #777;
}

.btn-location.loading {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* File info text */
.file-info {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* File preview */
.file-preview {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.file-preview-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    background: #f9f9f9;
    text-align: center;
    transition: all 0.3s ease;
}

.file-preview-item:hover {
    border-color: #ed0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.file-preview-item img {
    max-width: 100%;
    max-height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 5px;
}

.file-preview-item .file-info {
    max-width: 100px;
    font-size: 11px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    margin: 5px 0 0 0;
}

.file-preview-item .remove-file {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ed0000;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.file-preview-item .remove-file:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Upload progress */
.upload-progress {
    margin: 20px 0;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ed0000, #c0392b);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 12px;
}

.progress-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Checkbox styling */
.form-group--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-group--checkbox input[type="checkbox"] {
    margin-top: 3px;
    transform: scale(1.2);
    accent-color: #ed0000;
}

.form-group--checkbox label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
    line-height: 1.4;
}

.form-group--checkbox a {
    color: #ed0000;
    text-decoration: none;
}

.form-group--checkbox a:hover {
    text-decoration: underline;
}

/* reCAPTCHA */
.recaptcha-wrapper {
    text-align: center;
    margin: 20px 0;
}

/* Submit button */
.form-group--submit {
    text-align: center;
    margin-top: 30px;
}

.btn {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

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

.btn--primary:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn--primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn--primary.loading {
    background: #bdc3c7;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Messages */
#form-messages {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Dashicons fallback */
.dashicons {
    font-family: dashicons;
    display: inline-block;
    line-height: 1;
    font-weight: normal;
    font-style: normal;
    speak: none;
    text-decoration: inherit;
    text-transform: none;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.dashicons-location:before { content: "\f230"; }
.dashicons-paperclip:before { content: "\f546"; }
.dashicons-pdf:before { content: "\f120"; }
.dashicons-media-document:before { content: "\f128"; }
.dashicons-media-default:before { content: "\f126"; }

/* Error styling */
.form-group.error input,
.form-group.error textarea {
    border-color: #ed0000;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
}

.form-group .error-message {
    color: #ed0000;
    font-size: 13px;
    margin-top: 5px;
    display: block;
    font-weight: 500;
}

/* Success styling */
.form-group.success input,
.form-group.success textarea {
    border-color: #27ae60;
    box-shadow: 0 0 5px rgba(39, 174, 96, 0.3);
}

/* Loading animations */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ed0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive design */
@media (max-width: 768px) {
    .poptavky-form {
        margin: 10px;
        padding: 15px;
    }
    
    .poptavky-form input[type="text"],
    .poptavky-form input[type="email"],
    .poptavky-form input[type="tel"],
    .poptavky-form textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .file-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .btn-attach {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .btn {
        width: 100%;
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .file-preview {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .file-preview-item {
        padding: 5px;
    }
    
    .file-preview-item img {
        max-height: 60px;
    }
}

/* Print styles */
@media print {
    .poptavky-form {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .btn-attach,
    .btn-location,
    .upload-progress,
    #form-messages {
        display: none !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
.poptavky-form input:focus,
.poptavky-form textarea:focus,
.poptavky-form button:focus {
    outline: 2px solid #ed0000;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .poptavky-form {
        border: 2px solid #000;
    }
    
    .btn--primary {
        border: 2px solid #000;
    }
    
    .file-preview-item {
        border: 2px solid #000;
    }
}