/**
 * Frontend Styles for Email Deliverability Report
 *
 * @package EmailDeliverabilityReport
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

.edr-shortcode-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}

.edr-form-container {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
}

.edr-form-container h3 {
    margin: 0 0 25px 0;
    color: #23282d;
    font-size: 1.5em;
    font-weight: 600;
}

.edr-form-group {
    margin-bottom: 20px;
}

.edr-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.edr-form-group input,
.edr-form-group textarea,
.edr-form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.edr-form-group input:focus,
.edr-form-group textarea:focus,
.edr-form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.edr-form-group input.error,
.edr-form-group textarea.error,
.edr-form-group select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 1px #dc3545;
}

.edr-form-group input.error:focus,
.edr-form-group textarea.error:focus,
.edr-form-group select.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 1px #dc3545;
}

.edr-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.edr-submit-btn {
    background-color: #0073aa;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.edr-submit-btn:hover {
    background-color: #005a87;
}

.edr-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.edr-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.4;
    text-align: center;
    min-width: 120px;
}

.edr-btn-primary {
    background: #0073aa;
    color: white;
}

.edr-btn-primary:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.edr-btn-secondary {
    background: #f1f1f1;
    color: #23282d;
    border: 1px solid #ccd0d4;
}

.edr-btn-secondary:hover:not(:disabled) {
    background: #e8e8e8;
    border-color: #999;
}

.edr-btn-small {
    padding: 8px 16px;
    font-size: 14px;
    min-width: 80px;
}

.edr-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.edr-loading {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
}

.edr-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: edr-spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

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

.edr-loading p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* ==========================================================================
   Error States
   ========================================================================== */

.edr-error {
    background: #ffeaea;
    border: 1px solid #ffb3b3;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.edr-error-content {
    color: #721c24;
    font-size: 16px;
    margin: 0;
}

/* ==========================================================================
   Results Styling
   ========================================================================== */

.edr-results-container {
    margin-top: 30px;
}

.edr-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
}

.edr-results-header h4 {
    margin: 0;
    color: #23282d;
    font-size: 1.4em;
    font-weight: 600;
}

.edr-results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.edr-summary {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.edr-domain-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.edr-domain-info h4 {
    margin: 0;
    color: #23282d;
    font-size: 1.2em;
}

.edr-overall-grade {
    font-size: 18px;
    font-weight: 700;
}

.edr-grade-pass {
    color: #28a745;
}

.edr-grade-warn {
    color: #ffc107;
}

.edr-grade-fail {
    color: #dc3545;
}

.edr-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.edr-result-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.edr-result-card h5 {
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #23282d;
    font-size: 1.1em;
    font-weight: 600;
}

.edr-record {
    margin: 15px 0;
}

.edr-record strong {
    display: block;
    margin-bottom: 8px;
    color: #23282d;
}

.edr-record code {
    display: block;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    word-break: break-all;
    line-height: 1.4;
    color: #495057;
}

.edr-policy {
    margin: 15px 0;
    color: #495057;
}

.edr-issues {
    margin: 15px 0 0 0;
    padding-left: 20px;
}

.edr-issues li {
    margin-bottom: 8px;
    color: #495057;
    line-height: 1.5;
}

.edr-dkim-result {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.edr-dkim-result:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.edr-selector-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.edr-key-size {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.edr-mx-records ul,
.edr-rbl-hits ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.edr-mx-records li,
.edr-rbl-hits li {
    margin-bottom: 5px;
    color: #495057;
    line-height: 1.4;
}

.edr-rbl-result {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.edr-rbl-result:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.edr-ip-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

/* ==========================================================================
   Badge Styles
   ========================================================================== */

.edr-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.edr-badge-success {
    background: #d1e7dd;
    color: #0f5132;
}

.edr-badge-warning {
    background: #fff3cd;
    color: #664d03;
}

.edr-badge-error {
    background: #f8d7da;
    color: #721c24;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .edr-form-container {
        padding: 20px;
    }
    
    .edr-results-grid {
        grid-template-columns: 1fr;
    }
    
    .edr-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .edr-domain-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .edr-actions {
        flex-direction: column;
    }
    
    .edr-btn {
        width: 100%;
    }
    
    .edr-results-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .edr-form-container {
        padding: 15px;
    }
    
    .edr-result-card {
        padding: 15px;
    }
    
    .edr-field input,
    .edr-field textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
