/**
 * ConvMaster - DNS Lookup Styles v1.0
 * 
 * @package    ConvMaster
 * @version    1.0.0
 */

/* =====================================================
   TOOL PAGE LAYOUT
   ===================================================== */
.tool-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tool-header__icon {
    font-size: 2.5rem;
}

.tool-header__icon .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    font-size: 2rem;
}

.tool-header__icon .icon--indigo {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.tool-header__text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.tool-header__text p {
    margin: 0;
    color: var(--text-secondary);
}

/* =====================================================
   CURRENT DATE
   ===================================================== */
.dns-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.dns-date__icon {
    font-size: 1rem;
}

.dns-date__text {
    color: var(--text-secondary);
}

/* =====================================================
   FORMAT BADGES
   ===================================================== */
.format-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.format-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
}

.format-badge--dns {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.format-badge--web {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.format-badge--dev {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* =====================================================
   DNS LOOKUP WIDGET
   ===================================================== */
.dns-lookup {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* =====================================================
   DOMAIN INPUT
   ===================================================== */
.dns-input {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dns-input__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dns-input__header label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dns-input__samples {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dns-input__field {
    display: flex;
    gap: 0.75rem;
}

.dns-input__text {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s ease;
}

.dns-input__text:focus {
    outline: none;
    border-color: #6366f1;
}

.dns-input__text::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* =====================================================
   RECORD TYPE SELECTION
   ===================================================== */
.dns-types {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dns-types__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dns-types__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}

.dns-type-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dns-type-checkbox:hover {
    border-color: #6366f1;
}

.dns-type-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.dns-type-checkbox__box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.dns-type-checkbox input:checked + .dns-type-checkbox__box {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.dns-type-checkbox__desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dns-types__actions {
    display: flex;
    gap: 0.5rem;
}

/* =====================================================
   ERROR MESSAGE
   ===================================================== */
.dns-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: #ef4444;
}

.dns-error[hidden] {
    display: none !important;
}

.dns-error__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.dns-error__text {
    flex: 1;
    font-size: 0.9rem;
}

.dns-error__close {
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.dns-error__close:hover {
    opacity: 1;
}

/* =====================================================
   LOADING STATE
   ===================================================== */
.dns-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--text-secondary);
}

.dns-loading[hidden] {
    display: none !important;
}

.dns-loading__spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* =====================================================
   RESULTS SECTION
   ===================================================== */
.dns-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dns-results[hidden] {
    display: none !important;
}

.dns-results__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dns-results__header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.dns-results__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-radius: 50%;
    font-size: 0.9rem;
}

.dns-results__actions {
    display: flex;
    gap: 0.5rem;
}

/* =====================================================
   QUERY INFO
   ===================================================== */
.dns-query-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.dns-query-info__item {
    display: flex;
    gap: 0.5rem;
}

.dns-query-info__label {
    color: var(--text-muted);
}

.dns-query-info__value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* =====================================================
   DNS RECORDS
   ===================================================== */
.dns-records {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dns-record-group {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.dns-record-group__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.dns-record-group__type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: #6366f1;
    color: white;
    border-radius: var(--radius-sm);
}

.dns-record-group__count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dns-record-list {
    display: flex;
    flex-direction: column;
}

.dns-record {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dns-record:last-child {
    border-bottom: none;
}

.dns-record__main {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.dns-record__value {
    flex: 1;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-all;
}

.dns-record__value--ip {
    color: #22c55e;
}

.dns-record__value--target {
    color: #3b82f6;
}

.dns-record__meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.dns-record__meta-item {
    display: flex;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.dns-record__meta-label {
    color: var(--text-muted);
}

.dns-record__meta-value {
    font-weight: 500;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* SOA Record Specific */
.dns-record--soa .dns-record__details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

.dns-record__detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dns-record__detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dns-record__detail-value {
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-primary);
}

/* TXT Record Specific */
.dns-record--txt .dns-record__value {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    font-size: 0.85rem;
}

/* No Records */
.dns-no-records {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =====================================================
   HISTORY SECTION
   ===================================================== */
.dns-history {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.dns-history[hidden] {
    display: none !important;
}

.dns-history__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.dns-history__header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.dns-history__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dns-history__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dns-history__item:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.dns-history__item-domain {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-primary);
}

.dns-history__item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn--primary {
    background: #6366f1;
    color: white;
}

.btn--primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn--secondary:hover {
    background: var(--bg-secondary);
    border-color: #6366f1;
}

.btn--small {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn--large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn--success {
    background: #22c55e !important;
    border-color: #22c55e !important;
    color: white !important;
}

.btn svg {
    flex-shrink: 0;
}

.btn[hidden] {
    display: none !important;
}

/* =====================================================
   PRIVACY NOTICE
   ===================================================== */
.dns-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
}

.dns-privacy span {
    font-size: 1rem;
}

.dns-privacy p {
    font-size: 0.85rem;
    color: #6366f1;
    margin: 0;
}

/* =====================================================
   SEO CONTENT
   ===================================================== */
.tool-content {
    margin-top: 3rem;
}

.tool-section {
    margin-bottom: 2.5rem;
}

.tool-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tool-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.feature-card__icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* DNS Types Grid */
.dns-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.dns-type-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.dns-type-card code {
    padding: 0.25rem 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    border-radius: var(--radius-sm);
    min-width: 55px;
    text-align: center;
}

.dns-type-card span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.step-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #6366f1;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.step-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.faq-item summary {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-muted);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 1.5rem 1rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* =====================================================
   HIDDEN ELEMENTS
   ===================================================== */
[hidden] {
    display: none !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 640px) {
    .tool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .dns-input__header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dns-input__field {
        flex-direction: column;
    }
    
    .dns-input__text {
        width: 100%;
    }
    
    .dns-types__grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .dns-type-checkbox__desc {
        display: none;
    }
    
    .dns-results__header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dns-results__actions {
        width: 100%;
    }
    
    .dns-results__actions .btn {
        flex: 1;
    }
    
    .dns-record__main {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dns-query-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn--large {
        width: 100%;
    }
    
    .format-badges {
        justify-content: center;
    }
    
    .dns-history__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* =====================================================
   LIGHT THEME ADJUSTMENTS
   ===================================================== */
[data-theme="light"] .dns-input__text {
    background: var(--bg-primary);
}

[data-theme="light"] .dns-type-checkbox {
    background: var(--bg-primary);
}

[data-theme="light"] .dns-type-checkbox__box {
    background: white;
}

[data-theme="light"] .dns-record--txt .dns-record__value {
    background: var(--bg-primary);
}

[data-theme="light"] .dns-history__item {
    background: var(--bg-primary);
}

[data-theme="light"] .dns-query-info {
    background: var(--bg-primary);
}
