/**
 * Family Tree Frontend Events Styles
 * Professional styling for frontend event submission form
 */

/* Container and Layout */
.family-tree-event-submit {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.family-tree-event-form {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e1e5e9;
    padding: 40px;
}

/* Form Header */
.family-tree-event-form::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: -40px -40px 30px -40px;
}

/* Form Rows */
.form-row {
    margin-bottom: 24px;
}

.form-row:last-child {
    margin-bottom: 0;
}

/* Labels */
.form-row label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input Fields */
.form-row input[type="text"],
.form-row input[type="date"],
.form-row input[type="url"],
.form-row input[type="time"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: #fafbfc;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* Uppercase styling for event title */
.form-row input[name="title"] {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.form-row input[type="text"]:focus,
.form-row input[type="date"]:focus,
.form-row input[type="url"]:focus,
.form-row input[type="time"]:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Grid Layout for Date/Time */
.form-row.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Time Selector Styling */
.time-selector {
    position: relative;
}

.time-selector select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Textarea */
.form-row textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* Submit Button */
.form-row .submit-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.form-row .submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.form-row .submit-button:active {
    transform: translateY(0);
}

.form-row .submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.form-row .submit-button.loading {
    color: transparent;
}

.form-row .submit-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Alert Messages */
.family-tree-alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-weight: 500;
    border-left: 4px solid;
}

.family-tree-alert-error {
    background: #fef2f2;
    color: #dc2626;
    border-left-color: #dc2626;
}

.family-tree-alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border-left-color: #16a34a;
}

.family-tree-alert-info {
    background: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
}

/* Popup Modal */
.family-tree-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.family-tree-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.family-tree-popup {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.family-tree-popup-overlay.show .family-tree-popup {
    transform: scale(1);
}

.family-tree-popup-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
}

.family-tree-popup-icon.success {
    background: #dcfce7;
    color: #16a34a;
}

.family-tree-popup-icon.error {
    background: #fef2f2;
    color: #dc2626;
}

.family-tree-popup h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.family-tree-popup p {
    margin: 0 0 24px 0;
    color: #6b7280;
    line-height: 1.6;
}

.family-tree-popup-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.family-tree-popup-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* reCAPTCHA Styling */
.recaptcha-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.recaptcha-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin: 10px 0;
    text-align: center;
    font-weight: 500;
}

.recaptcha-info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    margin: 10px 0;
    text-align: center;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .family-tree-event-submit {
        padding: 10px;
    }
    
    .family-tree-event-form {
        padding: 24px;
    }
    
    .form-row.grid-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .family-tree-popup {
        padding: 24px;
        margin: 20px;
    }
}

/* Required Field Indicator */
.form-row label[for*="title"],
.form-row label[for*="date"] {
    position: relative;
}

.form-row label[for*="title"]::after,
.form-row label[for*="date"]::after {
    content: '*';
    color: #dc2626;
    margin-left: 4px;
    font-weight: bold;
}

/* Focus States */
.form-row input:focus + label,
.form-row select:focus + label,
.form-row textarea:focus + label {
    color: #667eea;
}

/* Hover Effects */
.form-row input:hover,
.form-row select:hover,
.form-row textarea:hover {
    border-color: #cbd5e0;
}

/* Placeholder Styling */
.form-row input::placeholder,
.form-row textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

/* Google Maps Field Styling */
.google-maps-field {
    position: relative;
}

.google-maps-field .field-description {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.google-maps-field .field-description strong {
    color: #1f2937;
    font-weight: 600;
}

/* Tooltip Styling */
.field-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    cursor: help;
}

.field-tooltip .tooltip-icon {
    width: 16px;
    height: 16px;
    background: #6b7280;
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.field-tooltip:hover .tooltip-icon {
    background: #3b82f6;
    transform: scale(1.1);
}

.field-tooltip .tooltip-content {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.field-tooltip .tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}

.field-tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* URL Field Styling - Make it less prominent since it's optional */
.form-row input[name="url"] {
    border-style: dashed;
    background: #f9fafb;
}

.form-row input[name="url"]:focus {
    border-style: solid;
    background: #ffffff;
}

/* Google Maps URL Field Styling */
.form-row input[name="google_maps_url"] {
    border-color: #10b981;
    background: #f0fdf4;
}

.form-row input[name="google_maps_url"]:focus {
    border-color: #059669;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
