/**
 * Puzzi Rent - Form Shortcode Styles
 * Modern, responsive design prema screenshot-u
 */

/* Reset i osnovni wrapper */
#puzzi-rent-form-wrapper {
    max-width: 800px;
    margin: 115px auto 40px;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #333;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

#puzzi-rent-form-wrapper * {
    box-sizing: border-box;
}

/* Form header */
.form-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.form-header h3 {
    font-size: 24px;
    color: #333;
    font-weight: 600;
    margin: 0;
}

/* Yellow highlight effect */
.text-highlight {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.text-highlight::before {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    bottom: 8px;
    height: 12px;
    background: rgba(254, 238, 0, 0.3);
    z-index: -1;
    transform: skewY(-1deg);
    transition: all 0.3s ease;
}

.text-highlight:hover::before {
    height: 16px;
    bottom: 6px;
    background: rgba(254, 238, 0, 0.4);
}

/* Form sections */
.form-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: block;
}

/* Form rows i fields */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-field {
    flex: 1;
    position: relative;
}

.form-field.full-width {
    flex: 1 1 100%;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Input i select stilovi */
.puzzi-rent-form input[type="text"],
.puzzi-rent-form input[type="email"],
.puzzi-rent-form input[type="tel"],
.puzzi-rent-form select,
.puzzi-rent-form textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
    font-family: inherit;
}

.puzzi-rent-form input[type="text"]:focus,
.puzzi-rent-form input[type="email"]:focus,
.puzzi-rent-form input[type="tel"]:focus,
.puzzi-rent-form select:focus,
.puzzi-rent-form textarea:focus {
    outline: none;
    border-color: #FEEE00;
    box-shadow: 0 0 0 3px rgba(254, 238, 0, 0.1);
}

.puzzi-rent-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Placeholder stilovi */
.puzzi-rent-form input::placeholder,
.puzzi-rent-form textarea::placeholder {
    color: #999;
}

/* Paketi grid */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.package-option {
    position: relative;
}

.package-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.package-label {
    display: block;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.package-option input[type="radio"]:checked + .package-label {
    border-color: #F5C500;
    background: #FFF8E1;
    box-shadow: 0 0 0 3px rgba(245, 197, 0, 0.25);
}

.package-label:hover {
    border-color: #F5C500;
    background: #FFFCF0;
}

.package-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.package-price {
    font-size: 18px;
    color: #E5B800;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.package-days {
    font-size: 14px;
    color: #666;
}

/* Datepicker stilovi */
.datepicker {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px !important;
    cursor: pointer;
}

/* jQuery UI datepicker override */
.ui-datepicker {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif !important;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 15px;
}

.ui-datepicker-header {
    background: #FEEE00;
    border: none;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.ui-datepicker-title {
    color: #333;
    font-weight: 600;
}

.ui-datepicker td a {
    text-align: center;
    padding: 8px;
    border-radius: 4px;
}

.ui-datepicker td a:hover {
    background: #FEEE00;
    color: #333;
}

.ui-datepicker-current-day a {
    background: #FEEE00 !important;
    color: #333 !important;
    font-weight: 600;
}

/* Warning message */
.warning-message {
    background: #FFF3CD;
    border: 1px solid #FFEAA7;
    color: #856404;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-icon {
    font-size: 16px;
}

/* Checkbox stilovi */
.checkbox-group {
    margin: 15px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    padding: 10px 0;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #FEEE00;
}

/* Price summary */
.price-summary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin: 30px 0;
    border: 1px solid #e9ecef;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
}

.price-row:not(:last-child) {
    border-bottom: 1px solid #e9ecef;
}

.total-row {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    padding-top: 15px;
    border-top: 2px solid #ddd;
    margin-top: 10px;
}

/* GDPR checkbox */
.gdpr-checkbox {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.gdpr-checkbox label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.gdpr-checkbox input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
}

.gdpr-checkbox a {
    color: #E5B800;
    text-decoration: underline;
    font-weight: 600;
}

.gdpr-checkbox a:hover {
    color: #333;
    text-decoration: underline;
}

/* Info box */
.info-box {
    background: #E8F5FF;
    border: 1px solid #B3D9FF;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #0066CC;
}

.info-box p {
    margin: 0 0 10px 0;
}

.info-box p:last-child {
    margin-bottom: 0;
}

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

.submit-button {
    background: #F4D03F;
    color: #1F1F1F;
    border: none;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(244, 208, 63, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.submit-button:hover {
    background: #e5c230;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(244, 208, 63, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Button loader */
.button-loader {
    display: none;
    align-items: center;
    gap: 8px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form messages */
.form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    position: relative;
    z-index: 999;
}

.form-message.success {
    background: #D4EDDA !important;
    color: #155724 !important;
    border: 1px solid #C3E6CB !important;
    padding: 30px !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix for success message content visibility */
.form-message.success * {
    color: #155724 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.form-message.success h3 {
    font-size: 24px !important;
    margin-bottom: 15px !important;
}

.form-message.success p {
    font-size: 18px !important;
    margin-bottom: 20px !important;
}

.form-message.error {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

/* Success message button */
.form-message .button-primary,
.form-message button {
    background: #FEEE00 !important;
    color: #333 !important;
    border: none !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 50px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 10px rgba(254, 238, 0, 0.3) !important;
    display: inline-block !important;
    text-decoration: none !important;
}

.form-message .button-primary:hover {
    background: #f5e500;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(254, 238, 0, 0.4);
}

/* Validation errors */
.form-field.error input,
.form-field.error select,
.form-field.error textarea {
    border-color: #dc3545;
}

.field-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
}

/* Responsive dizajn */
@media (max-width: 768px) {
    #puzzi-rent-form-wrapper {
        padding: 15px;
    }
    
    .form-header h3 {
        font-size: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .packages-grid {
        grid-template-columns: 1fr;
    }
    
    .price-summary {
        padding: 20px 15px;
    }
    
    .submit-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .form-header h3 {
        font-size: 18px;
    }
    
    .puzzi-rent-form input[type="text"],
    .puzzi-rent-form input[type="email"],
    .puzzi-rent-form input[type="tel"],
    .puzzi-rent-form select,
    .puzzi-rent-form textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Print stilovi */
@media print {
    #puzzi-rent-form-wrapper {
        box-shadow: none;
    }
    
    .submit-button {
        display: none;
    }
}

/* Animacije */
.form-section {
    animation: fadeInUp 0.5s ease-out;
}

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

/* Focus vidljivost za pristupačnost */
.puzzi-rent-form :focus-visible {
    outline: 2px solid #FEEE00;
    outline-offset: 2px;
}

/* Custom scrollbar */
.puzzi-rent-form textarea::-webkit-scrollbar {
    width: 8px;
}

.puzzi-rent-form textarea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.puzzi-rent-form textarea::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.puzzi-rent-form textarea::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    max-width: 250px;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
}

/* Help icon */
.help-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #666;
    color: white;
    text-align: center;
    line-height: 16px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    margin-left: 5px;
}

/* Required indicator */
.required-star {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* Loading state for inputs */
.form-field.loading input,
.form-field.loading select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23FEEE00" stroke-width="2"><circle cx="12" cy="12" r="10" stroke-dasharray="60" stroke-dashoffset="20"><animateTransform attributeName="transform" type="rotate" dur="1s" from="0 12 12" to="360 12 12" repeatCount="indefinite"/></circle></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

/* Success state */
.form-field.success input,
.form-field.success select {
    border-color: #28a745;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%2328a745" stroke-width="2"><polyline points="20 6 9 17 4 12"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

/* Progress indicator */
.form-progress {
    margin-bottom: 30px;
}

.progress-bar {
    background: #f0f0f0;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    background: #FEEE00;
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
}

/* Floating labels effect */
.form-field.floating-label {
    position: relative;
    padding-top: 20px;
}

.form-field.floating-label label {
    position: absolute;
    top: 32px;
    left: 16px;
    font-size: 15px;
    color: #999;
    pointer-events: none;
    transition: all 0.2s ease;
}

.form-field.floating-label input:focus + label,
.form-field.floating-label input:not(:placeholder-shown) + label {
    top: 8px;
    font-size: 12px;
    color: #FEEE00;
}

/* Pulse animation for important elements */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(254, 238, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(254, 238, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(254, 238, 0, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}