/* Tools Common Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e293b;
    --background-light: #f8fafc;
    --background-dark: #f0f4f8;
    --text-color: #475569;
}

/* Page Title Bar */
.page-title-bar {
    background-color: var(--secondary-color);
    color: var(--background-light);
    padding: 2.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    margin-bottom: 2rem;
}

/* Lookup Form Section */
.lookup-form-section {
    padding-top: 2rem;
    padding-bottom: 4rem;
    background-image: linear-gradient(to bottom, #f0f4f8, #e2e8f0);
    border-radius: 0.75rem;
    margin: 0 1rem 2rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Results Section */
.results-section-outer {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease-in-out, max-height 0.7s ease-in-out;
    margin-bottom: 2rem;
}

.results-section-outer.results-visible {
    opacity: 1;
    max-height: 2000px;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background-color: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    color: #1e3a8a;
    font-size: 1.125rem;
    font-weight: 500;
    gap: 1rem;
    max-width: 48rem;
    margin: 0 auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Message Cards */
.message-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-width: 48rem;
    margin: 0 auto;
}

.message-card.error-card {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* Results Card */
.results-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* DNS Record Table */
.dns-record-table-wrapper {
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.dns-record-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    width: 25%;
    white-space: nowrap;
}

.dns-record-table-value {
    position: relative;
    word-break: break-all;
    white-space: normal;
}

/* Copy Button */
.copy-button {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background-color: #e0e7ff;
    color: #2563eb;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.copy-button:hover {
    background-color: #bfdbfe;
    color: #1d4ed8;
}

.copied-tooltip {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background-color: #1e293b;
    color: #ffffff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    animation: fadeInOut 2s forwards;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(0px);
    }

    10% {
        opacity: 1;
        transform: translateY(-5px);
    }

    90% {
        opacity: 1;
        transform: translateY(-5px);
    }

    100% {
        opacity: 0;
        transform: translateY(0px);
    }
}

/* Details List */
.details-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .details-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Badges */
.badge {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid;
    white-space: nowrap;
}

.badge-none {
    background-color: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.badge-quarantine {
    background-color: #fef9c3;
    color: #b45309;
    border-color: #fcd34d;
}

.badge-reject {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* Risk Assessment */
.risk-assessment {
    padding: 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.risk-assessment-Low {
    background-color: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

.risk-assessment-Medium {
    background-color: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.risk-assessment-High {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.risk-assessment-Info {
    background-color: #e0f2fe;
    border-color: #93c5fd;
    color: #1e40af;
}

.risk-level-icon {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 1rem;
    margin-top: 0.25rem;
}

.risk-level-HighIconOnly {
    color: #ef4444;
}

/* Policy Tags */
.policy-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.policy_reject {
    background-color: #fee2e2;
    color: #991b1b;
}

.policy_quarantine {
    background-color: #fffbeb;
    color: #92400e;
}

.policy_none,
.policy_invalid,
.policy_not-found,
.policy_na {
    background-color: #e5e7eb;
    color: #4b5563;
}

/* Raw Record Box */
.raw-record-box {
    position: relative;
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: monospace;
    word-break: break-all;
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
}

/* Feature Item Card (Why Our Tool Section) */
.feature-item-card {
    border: 1px solid #e2e8f0;
}

/* Circular Progress Bar (Score) */
.progress-circle {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--score-color) var(--progress, 0deg), #e0e0e0 var(--progress, 0deg) 360deg);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
    transition: background 0.5s ease-in-out;
}

.progress-circle-inner {
    background-color: white;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
}

#score-value {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.score-circle-container .text-lg {
    font-size: 1.25rem;
}

/* Status Icons */
.status-icon-small {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
    vertical-align: middle;
}

.valid-yes-icon {
    color: #10b981;
}

.valid-no-icon {
    color: #ef4444;
}

.valid-warn-icon {
    color: #f59e0b;
}

.valid-yes {
    color: #10b981;
    font-weight: bold;
}

.valid-no {
    color: #ef4444;
    font-weight: bold;
}

.valid-warn {
    color: #f59e0b;
    font-weight: bold;
}

/* --- SPF Tool Specific Styles --- */
/* Custom Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-slide-up {
    animation: fadeInSlideUp 0.5s ease-out forwards;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Details/Summary overrides */
details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary .chevron-icon {
    transition: transform 0.3s ease-in-out;
}

details[open] summary .chevron-icon {
    transform: rotate(180deg);
}

/* SPF Record Rendering Levels */
.indent-0 {
    margin-left: 0;
}

.indent-1 {
    margin-left: 1rem;
}

.indent-2 {
    margin-left: 2rem;
}

.indent-3 {
    margin-left: 3rem;
}

.indent-4 {
    margin-left: 4rem;
}

.border-level-0 {
    border-color: #e2e8f0;
}

.border-level-1 {
    border-color: #c7d2fe;
}

.border-level-2 {
    border-color: #e9d5ff;
}

.text-level-0 {
    color: #1d4ed8;
}

.text-level-1 {
    color: #4338ca;
}

.text-level-2 {
    color: #7e22ce;
}

/* Colors */
.lookup-red {
    color: #dc2626;
    font-weight: 500;
}

.lookup-orange {
    color: #ea580c;
    font-weight: 500;
}

.lookup-gray {
    color: #6b7280;
}

.status-valid {
    color: #16a34a;
}

.status-warning {
    color: #a16207;
}

.status-error {
    color: #b91c1c;
}

.status-info {
    color: #374151;
}

.status-icon-idle {
    color: #9ca3af;
}

.status-icon-checking {
    color: #3b82f6;
    animation: spin 1s linear infinite;
}

.status-icon-listed {
    color: #dc2626;
}

.status-icon-not-listed {
    color: #16a34a;
}

.status-icon-error {
    color: #f97316;
}

/* Mechanism backgrounds */
.mech-version {
    background-color: rgba(239, 246, 255, 0.5);
}

.mech-unknown {
    background-color: #fff7ed;
}

.mech-default {
    background-color: rgba(249, 250, 251, 0.7);
}

/* Qualifiers */
.qualifier-fail {
    background-color: #fecaca;
    color: #b91c1c;
}

.qualifier-softfail {
    background-color: #fde68a;
    color: #92400e;
}

.qualifier-neutral {
    background-color: #e5e7eb;
    color: #374151;
}

.qualifier-pass {
    background-color: #bbf7d0;
    color: #16a34a;
}

/* Blacklist Items */
.blacklist-item-listed {
    background-color: #fef2f2;
}

.blacklist-item-not-listed {
    background-color: #f9fafb;
}

.blacklist-item-checking {
    background-color: #e0f2fe;
}

.blacklist-item-error {
    background-color: #fefce8;
}

.blacklist-item-idle {
    background-color: #f3f4f6;
}

/* Layout & Components */
.spf-page-container {
    padding: 3rem 0;
}

@media (min-width: 1024px) {
    .spf-page-container {
        padding: 4rem 0;
    }
}

.spf-content-wrapper {
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.spf-form-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.15), 0 6px 10px -3px rgba(0, 0, 0, 0.08);
}

.spf-submit-button:not(.loading) {
    background-image: linear-gradient(to right, #2563eb, #16a34a);
}

.spf-submit-button:not(.loading):hover {
    background-image: linear-gradient(to right, #1d4ed8, #15803d);
}

.spf-blacklist-button:not(.checking) {
    background-color: #e0e7ff;
    color: #4338ca;
}

.spf-blacklist-button:not(.checking):hover {
    background-color: #c7d2fe;
}

.spf-record-card:hover,
.spf-summary-card:hover,
.spf-details-summary:hover,
.spf-blacklist-results-card:hover,
.collapsible-section-block:hover,
.tip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 10px -3px rgba(0, 0, 0, 0.1), 0 3px 6px -2px rgba(0, 0, 0, 0.08);
}

.section-block:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
}

.toggle-button:hover {
    background-color: #e5e7eb;
}

.spf-copy-button:hover {
    color: #2563eb;
}

.spf-record-card {
    border: 1px solid;
}