/**
 * Frontend Tenant Application Form Styles
 * Professional, modern styling for the shortcode form
 */

/* Main Wrapper */
.pm-frontend-application-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Header */
.pm-application-form-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid #3498db;
}

.pm-application-form-header h2 {
    margin: 0 0 15px 0;
    font-size: 32px;
    color: #2c3e50;
    font-weight: 700;
}

.pm-application-subtitle {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.6;
}

.pm-required {
    color: #e74c3c;
    font-weight: 700;
}

/* Form Sections */
.pm-form-section {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.pm-form-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pm-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.pm-section-title .dashicons {
    color: #3498db;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.pm-section-description {
    margin: -15px 0 20px 0;
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.5;
}

/* Form Groups */
.pm-form-group {
    margin-bottom: 20px;
}

.pm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.pm-form-group input[type="text"],
.pm-form-group input[type="email"],
.pm-form-group input[type="tel"],
.pm-form-group input[type="date"],
.pm-form-group input[type="number"],
.pm-form-group textarea,
.pm-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.pm-form-group input:focus,
.pm-form-group textarea:focus,
.pm-form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.pm-form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.pm-form-group.has-error input,
.pm-form-group.has-error textarea,
.pm-form-group.has-error select {
    border-color: #e74c3c;
}

.pm-form-group.has-error label {
    color: #e74c3c;
}

/* Form Rows */
.pm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

.pm-form-row-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 0;
}

/* Reference Blocks */
.pm-reference-block {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.pm-reference-block h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

/* Checkbox Groups */
.pm-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.pm-checkbox-group:hover {
    border-color: #3498db;
    background: #e8f4f8;
}

.pm-checkbox-group input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.pm-checkbox-group label {
    margin: 0 !important;
    font-weight: normal !important;
    cursor: pointer;
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.pm-checkbox-group input[type="checkbox"]:checked + label {
    font-weight: 500;
}

/* Agreement Section */
.pm-agreement-section {
    background: #fff9e6;
    border: 2px solid #f39c12;
}

.pm-agreement-section .pm-checkbox-group {
    background: #fff;
}

/* Submit Button */
.pm-form-actions {
    text-align: center;
    margin-top: 40px;
}

.pm-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.pm-submit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

.pm-submit-btn:active {
    transform: translateY(0);
}

.pm-submit-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pm-submit-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Loading Spinner */
.pm-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pm-spin 0.8s linear infinite;
}

@keyframes pm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Response Messages */
.pm-application-response {
    margin-top: 30px;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    line-height: 1.6;
    animation: slideDown 0.4s ease-out;
}

.pm-application-response.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.pm-application-response.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.pm-application-response.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 2px solid #bee5eb;
}

.pm-application-response p {
    margin: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Bar */
.pm-progress-container {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.pm-progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.pm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.pm-progress-text {
    display: block;
    text-align: center;
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 600;
}

/* Character Counter */
.pm-char-counter {
    text-align: right;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

.pm-char-counter.warning {
    color: #e74c3c;
    font-weight: 600;
}

/* Tooltip */
.pm-tooltip {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: #3498db;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
    margin-left: 5px;
}

/* Collapsible Sections */
.pm-form-section.collapsed .pm-form-group,
.pm-form-section.collapsed .pm-form-row,
.pm-form-section.collapsed .pm-reference-block,
.pm-form-section.collapsed .pm-checkbox-group {
    display: none;
}

.pm-form-section .pm-section-title {
    cursor: pointer;
    user-select: none;
}

.pm-form-section .pm-section-title::after {
    content: '\f347';
    font-family: 'dashicons';
    margin-left: auto;
    transition: transform 0.3s ease;
}

.pm-form-section.collapsed .pm-section-title::after {
    transform: rotate(180deg);
}

/* Print Styles */
@media print {
    .pm-submit-btn,
    .pm-application-response,
    .pm-progress-container {
        display: none !important;
    }
    
    .pm-form-section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .pm-frontend-application-wrapper {
        padding: 20px 15px;
    }
    
    .pm-application-form-header h2 {
        font-size: 24px;
    }
    
    .pm-application-subtitle {
        font-size: 14px;
    }
    
    .pm-form-section {
        padding: 20px 15px;
    }
    
    .pm-section-title {
        font-size: 18px;
    }
    
    .pm-form-row,
    .pm-form-row-3 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pm-submit-btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .pm-checkbox-group {
        padding: 12px;
    }
    
    .pm-reference-block {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .pm-frontend-application-wrapper {
        padding: 15px 10px;
    }
    
    .pm-application-form-header {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }
    
    .pm-application-form-header h2 {
        font-size: 20px;
    }
    
    .pm-form-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .pm-section-title {
        font-size: 16px;
    }
    
    .pm-form-group input,
    .pm-form-group textarea,
    .pm-form-group select {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* Accessibility Improvements */
.pm-form-group input:focus,
.pm-form-group textarea:focus,
.pm-form-group select:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.pm-checkbox-group input[type="checkbox"]:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .pm-form-section {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .pm-section-title,
    .pm-form-group label {
        color: #ecf0f1;
    }
    
    .pm-form-group input,
    .pm-form-group textarea,
    .pm-form-group select {
        background: #34495e;
        border-color: #445566;
        color: #ecf0f1;
    }
    
    .pm-checkbox-group,
    .pm-reference-block {
        background: #34495e;
        border-color: #445566;
    }
    
    .pm-progress-container {
        background: #34495e;
        border-color: #445566;
    }
}

/* Animation for form sections */
.pm-form-section {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom scrollbar for long forms */
.pm-frontend-application-wrapper::-webkit-scrollbar {
    width: 10px;
}

.pm-frontend-application-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.pm-frontend-application-wrapper::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

.pm-frontend-application-wrapper::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Success checkmark animation */
@keyframes checkmark {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.pm-application-response.success::before {
    content: '✓';
    display: inline-block;
    font-size: 24px;
    margin-right: 10px;
    animation: checkmark 0.5s ease-out;
}