/**
 * Frontend styles for Privacy Policy Generator
 * 
 * @package Privacy_Policy_Generator
 */

/* Container */
.ppg-form-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header */
.ppg-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.ppg-form-header h2 {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.2;
}

.ppg-form-header p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Form */
.ppg-form {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
}

/* Message */
.ppg-message {
    display: none;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 15px;
    line-height: 1.5;
}

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

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

/* Section */
.ppg-section {
    margin-bottom: 35px;
    padding-bottom: 35px;
    border-bottom: 1px solid #e9ecef;
}

.ppg-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ppg-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ppg-section-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Form row */
.ppg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.ppg-form-row:last-child {
    margin-bottom: 0;
}

/* Form group */
.ppg-form-group {
    display: flex;
    flex-direction: column;
}

.ppg-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ppg-required {
    color: #dc3545;
    font-weight: 700;
}

/* Input */
.ppg-input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.ppg-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.ppg-input::placeholder {
    color: #adb5bd;
}

/* Checkbox grid */
.ppg-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.ppg-checkbox-item {
    position: relative;
}

.ppg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.ppg-checkbox-label:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.ppg-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #0073aa;
}

.ppg-checkbox-label input[type="checkbox"]:checked + .ppg-checkbox-text {
    font-weight: 600;
}

.ppg-checkbox-label:has(input[type="checkbox"]:checked) {
    background: #e7f5ff;
    border-color: #0073aa;
}

.ppg-checkbox-text {
    font-size: 14px;
    color: #495057;
    line-height: 1.4;
}

/* Form actions */
.ppg-form-actions {
    margin-top: 35px;
    text-align: center;
}

/* Submit button */
.ppg-submit-btn,
#ppg-submit-btn,
.ppg-form button[type="submit"] {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    background: linear-gradient(135deg, #2d1b4e 0%, #1a1a2e 100%);
    color: #ffffff;
    border: none;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(26, 26, 46, 0.3);
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.ppg-submit-btn:hover:not(:disabled),
#ppg-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3d2b5e 0%, #2a2a3e 100%);
    box-shadow: 0 6px 20px rgba(26, 26, 46, 0.4);
    transform: translateY(-2px);
}

.ppg-submit-btn:active:not(:disabled),
#ppg-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(26, 26, 46, 0.3);
}

.ppg-submit-btn:disabled,
#ppg-submit-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.ppg-submit-btn.ppg-loading .ppg-btn-text {
    visibility: hidden;
}

.ppg-submit-btn.ppg-loading .ppg-btn-loader {
    display: block;
}

.ppg-btn-loader {
    display: none;
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ppg-spin 0.8s linear infinite;
}

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

/* Form footer */
.ppg-form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
}

/* Responsive design */
@media (max-width: 768px) {
    .ppg-form-container {
        margin: 20px auto;
    }
    
    .ppg-form {
        padding: 30px 20px;
        border-radius: 8px;
    }
    
    .ppg-form-header h2 {
        font-size: 24px;
    }
    
    .ppg-form-header p {
        font-size: 14px;
    }
    
    .ppg-form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ppg-checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .ppg-submit-btn {
        width: 100%;
        min-width: 0;
    }
    
    .ppg-thank-you-page .ppg-header h1 {
        font-size: 24px;
    }
    
    .ppg-thank-you-page .ppg-header p {
        font-size: 14px;
    }
    
    .ppg-actions-bar {
        padding: 15px 20px;
    }
    
    .ppg-btn {
        width: 100%;
        justify-content: center;
    }
    
    .ppg-policy-content {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .ppg-form {
        padding: 20px 15px;
    }
    
    .ppg-section {
        margin-bottom: 25px;
        padding-bottom: 25px;
    }
    
    .ppg-section-title {
        font-size: 18px;
    }
    
    .ppg-input {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .ppg-checkbox-label {
        padding: 12px 14px;
    }
    
    .ppg-submit-btn {
        padding: 14px 30px;
        font-size: 15px;
    }
}

/* Radio group */
.ppg-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ppg-radio-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.ppg-radio-label:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.ppg-radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #0073aa;
}

.ppg-radio-label:has(input[type="radio"]:checked) {
    background: #e7f5ff;
    border-color: #0073aa;
}

.ppg-radio-text {
    font-size: 14px;
    color: #495057;
    line-height: 1.4;
}

.ppg-radio-label input[type="radio"]:checked + .ppg-radio-text {
    font-weight: 600;
}

/* Thank you page styles */
.ppg-thank-you-page {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.ppg-thank-you-page .ppg-header {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.ppg-thank-you-page .ppg-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.ppg-thank-you-page .ppg-header p {
    font-size: 16px;
    margin: 0;
    opacity: 0.95;
}

.ppg-actions-bar {
    background: #f8f9fa;
    padding: 20px 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    border-bottom: 1px solid #e9ecef;
}

.ppg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ppg-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.ppg-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.ppg-btn-secondary {
    background: white;
    color: #0073aa;
    border: 2px solid #0073aa;
}

.ppg-btn-secondary:hover {
    background: #0073aa;
    color: white;
}

.ppg-btn-primary {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.ppg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 115, 170, 0.4);
}

.ppg-policy-content {
    padding: 40px 30px;
    font-size: 15px;
    line-height: 1.8;
}

.ppg-policy-content h2 {
    color: #0073aa;
    font-size: 24px;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.ppg-policy-content h2:first-child {
    margin-top: 0;
}

.ppg-policy-content h3 {
    color: #005177;
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.ppg-policy-content p {
    margin-bottom: 15px;
}

.ppg-policy-content ul,
.ppg-policy-content ol {
    margin-left: 30px;
    margin-bottom: 15px;
}

.ppg-policy-content li {
    margin-bottom: 8px;
}

.ppg-policy-content strong {
    color: #495057;
}

/* Accessibility */
.ppg-input:focus-visible,
.ppg-checkbox-label:focus-within,
.ppg-radio-label:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Optional badge */
.ppg-optional-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
    text-transform: uppercase;
}

/* Optional sections */
.ppg-section-optional {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    padding: 20px;
    border-radius: 8px;
}

/* Help text */
.ppg-help-text {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
    color: #856404;
    border-radius: 4px;
}

/* Select dropdown */
.ppg-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.ppg-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Field wrapper */
.ppg-field {
    margin-bottom: 0;
}

/* Print styles */
@media print {
    .ppg-form-container {
        box-shadow: none;
    }
    
    .ppg-submit-btn {
        display: none;
    }
    
    .ppg-actions-bar {
        display: none;
    }
    
    .ppg-thank-you-page .ppg-header {
        background: #0073aa;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}
