/**
 * PericialMed - Tracker Pro - Frontend Styles
 * Professional form and tracking styles
 */

/* Form Wrapper */
.pm-form-wrapper {
    max-width: 600px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.pm-form-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    text-align: center;
}

.pm-form-description {
    font-size: 16px;
    color: #6c757d;
    margin: 0 0 25px 0;
    text-align: center;
    line-height: 1.5;
}

/* Theme Styles */
.pm-theme-default {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pm-theme-modern {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.pm-theme-minimal {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 20px;
    box-shadow: none;
}

.pm-theme-professional {
    background: white;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

/* Form Fields */
.pm-tracking-form {
    width: 100%;
}

.pm-field {
    margin-bottom: 20px;
}

.pm-field label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.pm-field input,
.pm-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.pm-field input:focus,
.pm-field textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pm-field input[required] {
    background-image: linear-gradient(45deg, transparent 40%, #ff6b6b 40%, #ff6b6b 60%, transparent 60%);
    background-size: 8px 8px;
    background-position: right 10px center;
    background-repeat: no-repeat;
}

.pm-field input[required]:valid {
    background-image: linear-gradient(45deg, transparent 40%, #4caf50 40%, #4caf50 60%, transparent 60%);
}

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

/* Submit Button */
.pm-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pm-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

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

.pm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pm-btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.pm-btn-loader {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pm-submit-btn.loading .pm-btn-text {
    opacity: 0;
}

.pm-submit-btn.loading .pm-btn-loader {
    opacity: 1;
}

/* Button Sizes */
.pm-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.pm-btn-medium {
    padding: 12px 24px;
    font-size: 15px;
}

.pm-btn-large {
    padding: 18px 36px;
    font-size: 18px;
}

/* Payment Button */
.pm-payment-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.pm-payment-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
    color: white;
    text-decoration: none;
}

.pm-payment-btn .pm-icon {
    font-size: 18px;
}

/* Status Messages */
.pm-status-messages {
    margin-top: 20px;
}

.pm-loading,
.pm-success,
.pm-error {
    padding: 15px 20px;
    border-radius: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.pm-loading {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.pm-success {
    background: #e8f5e8;
    color: #2e7d2e;
    border: 1px solid #c8e6c9;
}

.pm-error {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

.pm-success-icon,
.pm-error-icon {
    font-size: 18px;
}

/* Loading Spinner */
.pm-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e3f2fd;
    border-top: 2px solid #1976d2;
    border-radius: 50%;
    animation: pm-spin 1s linear infinite;
}

@keyframes pm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.pm-error-message {
    background: #ffebee;
    color: #d32f2f;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #ffcdd2;
    margin: 15px 0;
    font-weight: 500;
}

/* Stats Widget */
.pm-stats-widget {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pm-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
}

.pm-stat-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.pm-stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.pm-stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.pm-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

/* Icons */
.pm-icon {
    display: inline-block;
    font-style: normal;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pm-form-wrapper {
        margin: 10px;
        max-width: none;
    }
    
    .pm-theme-default,
    .pm-theme-modern,
    .pm-theme-professional {
        padding: 20px;
    }
    
    .pm-form-title {
        font-size: 20px;
    }
    
    .pm-field input,
    .pm-field textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .pm-stats-summary {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .pm-stat-item {
        padding: 12px;
    }
    
    .pm-stat-value {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .pm-stats-summary {
        grid-template-columns: 1fr;
    }
    
    .pm-submit-btn,
    .pm-payment-btn {
        padding: 15px 20px;
        font-size: 16px;
    }
}

/* Animation Classes */
.pm-fade-in {
    animation: pmFadeIn 0.5s ease-in-out;
}

.pm-slide-up {
    animation: pmSlideUp 0.5s ease-out;
}

@keyframes pmFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Form Validation */
.pm-field.has-error input,
.pm-field.has-error textarea {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.pm-field.has-success input,
.pm-field.has-success textarea {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.pm-field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.pm-field-success {
    color: #28a745;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .pm-theme-default {
        background: #2c3e50;
        border-color: #34495e;
        color: white;
    }
    
    .pm-field label {
        color: #ecf0f1;
    }
    
    .pm-field input,
    .pm-field textarea {
        background: #34495e;
        border-color: #4a6741;
        color: white;
    }
    
    .pm-field input::placeholder,
    .pm-field textarea::placeholder {
        color: #95a5a6;
    }
    
    .pm-stats-widget {
        background: #2c3e50;
        border-color: #34495e;
        color: white;
    }
    
    .pm-stat-item {
        background: #34495e;
        border-color: #4a6741;
    }
}

/* Print Styles */
@media print {
    .pm-submit-btn,
    .pm-payment-btn,
    .pm-status-messages {
        display: none;
    }
    
    .pm-form-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
}