/**
 * Email Header Analyzer - Styles
 * Works for both admin and frontend
 */

/* Main Container */
.eha-wrap {
    margin: 20px 20px 0 0;
}

.eha-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.eha-main-content {
    flex: 1;
    min-width: 0;
}

.eha-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* Cards */
.eha-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    padding: 20px;
    margin-bottom: 20px;
}

.eha-card h2 {
    margin-top: 0;
    font-size: 18px;
    font-weight: 600;
}

.eha-card h3 {
    margin-top: 0;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.eha-card .description {
    color: #646970;
    font-size: 13px;
    margin-bottom: 15px;
}

/* Form Elements */
#eha-header-input {
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 15px;
}

#eha-header-input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.eha-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.eha-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.eha-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Loading State */
.eha-loading {
    text-align: center;
    padding: 40px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 20px;
}

.eha-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: eha-spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Results Container */
.eha-results {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
}

.eha-result-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.eha-result-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.eha-result-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 10px;
}

.eha-result-section h4 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 15px;
    color: #2c3338;
}

/* Status Badges */
.eha-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.eha-badge-success {
    background: #00a32a;
    color: #fff;
}

.eha-badge-warning {
    background: #dba617;
    color: #fff;
}

.eha-badge-error {
    background: #d63638;
    color: #fff;
}

.eha-badge-info {
    background: #2271b1;
    color: #fff;
}

.eha-badge-neutral {
    background: #8c8f94;
    color: #fff;
}

/* Security Score */
.eha-security-score {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
    margin-bottom: 15px;
}

.eha-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
}

.eha-score-high {
    background: linear-gradient(135deg, #00a32a 0%, #008a20 100%);
}

.eha-score-medium {
    background: linear-gradient(135deg, #dba617 0%, #c69214 100%);
}

.eha-score-low {
    background: linear-gradient(135deg, #d63638 0%, #b32d2e 100%);
}

.eha-score-details {
    flex: 1;
}

.eha-score-details h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.eha-score-details p {
    margin: 0;
    color: #646970;
    font-size: 13px;
}

/* Info Grid */
.eha-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.eha-info-item {
    padding: 12px;
    background: #f6f7f7;
    border-radius: 4px;
    border-left: 3px solid #2271b1;
}

.eha-info-item strong {
    display: block;
    margin-bottom: 5px;
    color: #1d2327;
    font-size: 13px;
}

.eha-info-item span {
    color: #2c3338;
    font-size: 13px;
    word-break: break-all;
}

/* Authentication Results */
.eha-auth-item {
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
    margin-bottom: 10px;
    border-left: 4px solid #8c8f94;
}

.eha-auth-item.eha-auth-pass {
    border-left-color: #00a32a;
    background: #f0f6f0;
}

.eha-auth-item.eha-auth-fail {
    border-left-color: #d63638;
    background: #f9f0f0;
}

.eha-auth-item.eha-auth-warning {
    border-left-color: #dba617;
    background: #f9f6f0;
}

.eha-auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.eha-auth-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.eha-auth-details {
    font-size: 13px;
    color: #646970;
}

.eha-auth-details p {
    margin: 5px 0;
}

/* Routing Hops */
.eha-hop {
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
    margin-bottom: 10px;
    position: relative;
    padding-left: 50px;
}

.eha-hop-number {
    position: absolute;
    left: 15px;
    top: 15px;
    width: 30px;
    height: 30px;
    background: #2271b1;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.eha-hop-details {
    font-size: 13px;
}

.eha-hop-details p {
    margin: 5px 0;
}

.eha-hop-details strong {
    color: #1d2327;
}

/* Warnings List */
.eha-warnings {
    background: #fcf3cd;
    border-left: 4px solid #dba617;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.eha-warnings ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.eha-warnings li {
    margin-bottom: 5px;
    color: #2c3338;
}

/* Sidebar Info Cards */
.eha-info-card ul,
.eha-info-card ol {
    margin: 10px 0;
    padding-left: 20px;
}

.eha-info-card li {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.eha-info-card code {
    display: block;
    background: #f6f7f7;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13px;
}

/* Frontend Specific Styles */
.eha-frontend-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.eha-frontend-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.eha-frontend-header {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    padding: 30px;
    text-align: center;
}

.eha-frontend-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.eha-description {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.eha-frontend-form {
    padding: 30px;
}

.eha-frontend-form label {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
}

.eha-analyze-btn {
    background: #2271b1 !important;
    border-color: #2271b1 !important;
    color: #fff !important;
    padding: 10px 20px !important;
    font-size: 15px !important;
    height: auto !important;
}

.eha-analyze-btn:hover {
    background: #135e96 !important;
    border-color: #135e96 !important;
}

.eha-frontend-info {
    padding: 0 30px 30px;
}

.eha-frontend-info details {
    background: #f6f7f7;
    border-radius: 4px;
    padding: 15px;
}

.eha-frontend-info summary {
    cursor: pointer;
    font-weight: 600;
    color: #2271b1;
    user-select: none;
}

.eha-frontend-info summary:hover {
    color: #135e96;
}

.eha-info-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.eha-info-content h4 {
    margin: 15px 0 10px 0;
    font-size: 14px;
    color: #1d2327;
}

.eha-info-content ol {
    margin: 0;
    padding-left: 20px;
}

.eha-info-content li {
    margin-bottom: 5px;
    font-size: 13px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .eha-container {
        flex-direction: column;
    }
    
    .eha-sidebar {
        width: 100%;
    }
    
    .eha-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .eha-wrap {
        margin: 10px;
    }
    
    .eha-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .eha-actions .button {
        width: 100%;
        justify-content: center;
    }
    
    .eha-security-score {
        flex-direction: column;
        text-align: center;
    }
    
    .eha-hop {
        padding-left: 15px;
    }
    
    .eha-hop-number {
        position: static;
        margin-bottom: 10px;
    }
}

/* Print Styles */
@media print {
    .eha-sidebar,
    .eha-actions,
    #eha-analyzer-form {
        display: none;
    }
    
    .eha-results {
        border: none;
        box-shadow: none;
    }
}