/**
 * Pride Discrimination Reporter - Public Styles
 *
 * @package Pride_Discrimination_Reporter
 */

/* Form Container */
.pdr-form-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Form Header */
.pdr-form-header {
    margin-bottom: 30px;
}

.pdr-form-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 15px;
}

.pdr-form-description {
    font-size: 16px;
    color: #555;
    margin: 0 0 20px;
    line-height: 1.6;
}

/* Confidentiality Notice */
.pdr-confidentiality-notice {
    display: flex;
    gap: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #24408e;
    padding: 20px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 20px;
}

.pdr-notice-icon {
    flex-shrink: 0;
    color: #24408e;
}

.pdr-notice-content strong {
    display: block;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.pdr-notice-content p {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

/* Messages */
.pdr-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

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

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

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

/* Fieldset */
.pdr-fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    background-color: #fff;
}

.pdr-fieldset legend {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    padding: 0 10px;
}

/* Fields */
.pdr-field {
    margin-bottom: 20px;
}

.pdr-field:last-child {
    margin-bottom: 0;
}

/* Reduce spacing after radio groups */
.pdr-field:has(.pdr-radio-group) {
    margin-bottom: 15px;
}

.pdr-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.pdr-required {
    color: #dc3545;
}

.pdr-field-description {
    font-size: 13px;
    color: #666;
    margin: 0 0 8px;
}

/* Input Fields */
.pdr-input,
.pdr-select,
.pdr-textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.pdr-input:focus,
.pdr-select:focus,
.pdr-textarea:focus {
    outline: none;
    border-color: #24408e;
    box-shadow: 0 0 0 3px rgba(36, 64, 142, 0.1);
}

.pdr-input::placeholder,
.pdr-textarea::placeholder {
    color: #999;
}

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

.pdr-select {
    cursor: pointer;
}

/* Character Count */
.pdr-char-count {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    text-align: right;
}

.pdr-char-count.pdr-char-valid {
    color: #28a745;
}

/* Checkbox & Radio Groups */
.pdr-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pdr-radio-group {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 10px;
    vertical-align: middle;
}

.pdr-checkbox-label,
.pdr-radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
    margin: 0;
}

.pdr-checkbox-label:hover,
.pdr-radio-label:hover {
    background-color: #e9ecef;
}

.pdr-checkbox-label:has(:checked),
.pdr-radio-label:has(:checked) {
    background-color: #e7f1ff;
    border-color: #24408e;
}

.pdr-radio-group .pdr-radio-label {
    margin-bottom: 0;
    line-height: 1.4;
}

/* Override any theme styles on radio inputs */
.pdr-form .pdr-radio-group input[type="radio"] {
    margin: 0;
    padding: 0;
    width: auto;
    height: auto;
}

.pdr-form .pdr-radio-group label {
    margin-bottom: 0;
}

.pdr-checkbox,
.pdr-radio {
    margin: 0;
    flex-shrink: 0;
}

/* Consent Label */
.pdr-consent-label {
    background-color: #fff8e1;
    border: 1px solid #ffcc80;
    padding: 15px;
}

.pdr-consent-label span {
    line-height: 1.5;
}

/* Conditional Field */
.pdr-conditional-field {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 3px solid #24408e;
}

/* Map */
.pdr-map-container {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #d0d0d0;
}

.pdr-map {
    height: 250px;
    width: 100%;
}

/* Location Search */
.pdr-location-search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 15px center;
    background-size: 16px 16px;
    padding-left: 42px !important;
    text-indent: 0;
}

/* Honeypot Field */
.pdr-hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* Form Actions */
.pdr-form-actions {
    margin-top: 30px;
}

.pdr-submit-button {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #24408e 0%, #1a2f6e 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pdr-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(36, 64, 142, 0.3);
}

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

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

/* Loading Spinner */
.pdr-spinner {
    animation: pdr-rotate 2s linear infinite;
    width: 20px;
    height: 20px;
}

.pdr-spinner .path {
    stroke: #fff;
    stroke-linecap: round;
    animation: pdr-dash 1.5s ease-in-out infinite;
}

@keyframes pdr-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pdr-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Form Footer */
.pdr-form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #666;
}

.pdr-form-footer p {
    margin: 0;
}

/* Success Message */
.pdr-success-message {
    text-align: center;
    padding: 40px 20px;
    background-color: #d4edda;
    border-radius: 12px;
    border: 1px solid #c3e6cb;
}

.pdr-success-icon {
    color: #28a745;
    margin-bottom: 20px;
}

.pdr-success-message h3 {
    font-size: 24px;
    color: #155724;
    margin: 0 0 15px;
}

.pdr-success-message p {
    color: #155724;
    font-size: 16px;
    margin: 0 0 10px;
    line-height: 1.6;
}

.pdr-success-message .pdr-note {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Error Message */
.pdr-error-message {
    padding: 15px 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    margin-top: 20px;
}

/* Field Validation States */
.pdr-field-error .pdr-input,
.pdr-field-error .pdr-select,
.pdr-field-error .pdr-textarea {
    border-color: #dc3545;
    background-color: #fff8f8;
}

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

/* Google Places Autocomplete Dropdown */
.pac-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
}

.pac-item {
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
}

.pac-item:hover {
    background-color: #f0f0f0;
}

.pac-item-selected {
    background-color: #e7f1ff;
}

.pac-icon {
    margin-right: 10px;
}

/* Ensure location input placeholder doesn't overlap icon */
#pdr_location_search {
    padding-left: 42px !important;
}

#pdr_location_search::placeholder {
    padding-left: 0;
}

/* Responsive */
@media (max-width: 600px) {
    .pdr-form-container {
        padding: 15px;
    }

    .pdr-form-title {
        font-size: 24px;
    }

    .pdr-fieldset {
        padding: 20px 15px;
    }

    .pdr-confidentiality-notice {
        flex-direction: column;
        gap: 10px;
    }

    .pdr-checkbox-group {
        flex-direction: column;
    }

    .pdr-checkbox-label,
    .pdr-radio-label {
        width: 100%;
        box-sizing: border-box;
    }

    .pdr-submit-button {
        padding: 14px 20px;
    }
}

/* Print Styles */
@media print {
    .pdr-form-container {
        max-width: none;
    }

    .pdr-submit-button,
    .pdr-map-container {
        display: none;
    }
}

/* Accessibility */
.pdr-input:focus-visible,
.pdr-select:focus-visible,
.pdr-textarea:focus-visible,
.pdr-checkbox:focus-visible,
.pdr-radio:focus-visible,
.pdr-submit-button:focus-visible {
    outline: 2px solid #24408e;
    outline-offset: 2px;
}

/* Error state */
.pdr-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
}
