/* IP Lookup Tool Styles */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #16161f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left,
.header-right {
    flex: 1;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

.header-center h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-center h1 i {
    -webkit-text-fill-color: var(--accent);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--accent-glow);
}

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

.btn-secondary:hover {
    background: var(--border);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

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

.search-input-wrapper i {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrapper input {
    width: 100%;
    padding: 1rem 3rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.clear-btn {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: var(--text-primary);
}

.search-hints {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.hint {
    padding: 0.4rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.hint:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Results Section */
.results-section {
    animation: fadeIn 0.3s ease;
}

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

.results-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Map Panel */
.map-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    position: sticky;
    top: 80px;
    height: fit-content;
}

.map-container {
    height: 350px;
    min-height: 350px;
    max-height: 350px;
    background: var(--bg-tertiary);
}

.map-coords {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
}

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

.coord-value {
    color: var(--accent);
}

/* Info Panels */
.info-panels {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header h3 i {
    color: var(--accent);
}

.card-content {
    padding: 1rem 1.25rem;
}

.copy-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.copy-btn.small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Query Card */
.query-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.query-type {
    padding: 0.25rem 0.6rem;
    background: var(--accent);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

.ip-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.ip-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.ip-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--success);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item.full {
    grid-column: 1 / -1;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    word-break: break-word;
}

/* Flags Grid */
.flags-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.flag-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.flag-item i {
    font-size: 1rem;
}

.flag-item.active {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.flag-item.inactive {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--success);
    color: var(--success);
}

/* DNS Card */
.dns-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.dns-tab {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.dns-tab:hover {
    background: var(--border);
}

.dns-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.dns-tab.has-records {
    position: relative;
}

.dns-tab.has-records::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

.dns-content {
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
}

.dns-records {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dns-record {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    word-break: break-all;
}

.dns-record.mx {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dns-record .priority {
    color: var(--warning);
    font-size: 0.8rem;
}

.no-records {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

/* Loading Section */
.loading-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
}

.loader {
    text-align: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loader p {
    color: var(--text-secondary);
}

/* Error Section */
.error-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
}

.error-content {
    text-align: center;
    max-width: 400px;
}

.error-content i {
    font-size: 3rem;
    color: var(--error);
    margin-bottom: 1rem;
}

.error-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .results-layout {
        grid-template-columns: 1fr;
    }

    .map-panel {
        position: static;
    }

    .map-container {
        height: 300px;
        min-height: 300px;
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .header-left,
    .header-right {
        flex: none;
    }

    .header-center {
        order: -1;
        flex-basis: 100%;
        text-align: center;
    }

    .main-content {
        padding: 1rem;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box .btn {
        width: 100%;
        justify-content: center;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .flags-grid {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 250px;
        min-height: 250px;
        max-height: 250px;
    }
}

/* Leaflet Custom Styles */
.leaflet-container {
    background: var(--bg-tertiary);
}

.leaflet-popup-content-wrapper {
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}

.leaflet-popup-tip {
    background: var(--bg-card);
}

.leaflet-popup-content {
    margin: 0.75rem;
}

.leaflet-popup-content strong {
    color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}
