/**
 * Frontend CSS for DNS Email Checker
 */

.dns-email-checker-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dns-checker-title {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}

.dns-checker-form {
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    max-width: 400px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

/* Captcha Styling */
.captcha-group {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 25px 0;
}

.captcha-main-label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 20px;
    text-align: center;
}

.captcha-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.captcha-question-box {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border: 2px solid #2271b1;
    border-radius: 10px;
    padding: 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
}

.question-icon {
    font-size: 24px;
    background: linear-gradient(135deg, #2271b1, #1a5a8a);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.3);
}

.question-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.question-text {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
}

.question-hint {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.refresh-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.refresh-btn:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.refresh-icon {
    font-size: 16px;
    animation: none;
}

.refresh-btn:hover .refresh-icon {
    animation: spin 0.5s ease-in-out;
}

.captcha-answer-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e9ecef;
}

.answer-label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
}

.answer-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.captcha-answer-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.captcha-answer-input:focus {
    outline: none;
    border-color: #2271b1;
    background: white;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.input-indicator {
    position: absolute;
    right: 15px;
    font-size: 20px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.captcha-answer-input:focus + .input-indicator {
    opacity: 1;
    transform: scale(1.1);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .captcha-question-box {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 15px;
    }
    
    .question-icon {
        justify-self: center;
    }
    
    .refresh-btn {
        justify-self: center;
        width: fit-content;
    }
    
    .captcha-group {
        padding: 20px 15px;
    }
}

/* Question update animation */
.question-updated {
    animation: questionHighlight 1s ease-out;
}

@keyframes questionHighlight {
    0% { background: linear-gradient(135deg, #fff, #f8f9fa); }
    50% { background: linear-gradient(135deg, #e3f2fd, #bbdefb); }
    100% { background: linear-gradient(135deg, #fff, #f8f9fa); }
}

/* Input feedback styles */
.captcha-answer-input.has-content {
    border-color: #28a745;
    background: #f8fff9;
}

.captcha-answer-input.has-content:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.dns-checker-submit {
    background: linear-gradient(135deg, #2271b1, #1a5a8a);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dns-checker-submit:hover {
    background: linear-gradient(135deg, #1a5a8a, #2271b1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 113, 177, 0.3);
}

.dns-checker-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Results Styling */
.dns-checker-results {
    margin-top: 30px;
    animation: fadeIn 0.5s ease-in;
}

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

.results-header h4 {
    background: linear-gradient(135deg, #2271b1, #1a5a8a);
    color: white;
    padding: 20px 25px;
    margin: 0 0 25px 0;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(34, 113, 177, 0.3);
    text-align: center;
}

.domain-name {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.7);
}

.record-section {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e1e5e9;
    background: white;
}

.record-section h5 {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    margin: 0;
    padding: 18px 20px;
    border-bottom: 1px solid #dee2e6;
    font-size: 16px;
    color: #495057;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-section.found h5 {
    background: linear-gradient(135deg, #d1f2eb, #a7f3d0);
    color: #065f46;
    border-bottom-color: #6ee7b7;
}

.record-section.not-found h5 {
    background: linear-gradient(135deg, #fce8e6, #f8d7da);
    color: #991b1b;
    border-bottom-color: #f87171;
}

.record-content {
    padding: 25px;
}

.records-found > p {
    color: #065f46;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 16px;
}

.record-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.record-item {
    background: #ffffff;
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.record-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.record-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #2271b1, #1a5a8a);
    border-radius: 8px 0 0 8px;
}

/* MX Record Specific Styling */
.record-item .mx-record-container {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 15px;
    align-items: center;
}

.record-item .priority-badge {
    background: linear-gradient(135deg, #2271b1, #1a5a8a);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    min-width: 80px;
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.3);
}

.record-item .target-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.record-item .target-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.record-item .record-value {
    font-family: 'Courier New', Consolas, Monaco, monospace;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    word-break: break-all;
    border: 1px solid #e9ecef;
    font-size: 14px;
    color: #495057;
    margin: 0;
}

.record-priority {
    font-weight: 600;
    color: #2271b1;
    font-size: 14px;
}

/* DKIM Record Styling */
.record-item .dkim-record-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.record-item .selector-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 12px;
    align-self: flex-start;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* SPF and DMARC Record Styling */
.record-item .simple-record-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-item .record-type-label {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .record-item .mx-record-container {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }
    
    .record-item .priority-badge {
        justify-self: center;
        margin-bottom: 5px;
    }
    
    .record-item {
        padding: 15px;
    }
}

.dkim-parsed {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f8ff, #e6f3ff);
    border-radius: 8px;
    border: 1px solid #b3d9ff;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dkim-tag {
    display: inline-block;
    margin-bottom: 5px;
    color: #333;
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
}

.dkim-tag em {
    color: #666;
    font-size: 11px;
}

.explanation {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.explanation h6 {
    margin: 0 0 8px 0;
    color: #495057;
    font-weight: 600;
}

.explanation p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.explanation p:last-child {
    margin-bottom: 0;
}

.recommendation {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #f0c674;
    padding: 15px 18px;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.recommendation.success {
    background: linear-gradient(135deg, #d1f2eb, #a7f3d0);
    border-color: #6ee7b7;
    color: #065f46;
}

.recommendation.warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
    color: #92400e;
}

.recommendation.error {
    background: linear-gradient(135deg, #fce8e6, #f8d7da);
    border-color: #f87171;
    color: #991b1b;
}

.results-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    color: #666;
}

/* Error Styling */
.dns-checker-error {
    margin-top: 20px;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    color: #721c24;
}

.error-message {
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dns-email-checker-container {
        padding: 15px;
        margin: 10px;
    }
    
    .dns-checker-title {
        font-size: 20px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="number"] {
        max-width: 100%;
    }
    
    .captcha-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .captcha-input-group input {
        max-width: 100%;
    }
    
    .record-item .record-value {
        font-size: 12px;
    }
    
    .results-header h4 {
        font-size: 16px;
    }
}

/* Accessibility */
.form-group input:invalid {
    border-color: #dc3545;
}

.form-group input:invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Loading state */
.dns-checker-form.loading input,
.dns-checker-form.loading button {
    pointer-events: none;
    opacity: 0.7;
}
