/* IPLookup - Terminal/Hacker Aesthetic */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #0d1117;
    --border-color: #30363d;
    --text-primary: #00ff41;
    --text-secondary: #00cc33;
    --text-muted: #238636;
    --accent: #00ff41;
    --accent-dim: #00aa2a;
    --error: #ff4444;
    --warning: #ffaa00;
    --info: #00aaff;
    --font-mono: 'Courier New', Courier, monospace;
    --font-terminal: 'Lucida Console', Monaco, monospace;
}

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

body {
    font-family: var(--font-mono);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Matrix Background Effect */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        var(--text-primary) 2px,
        var(--text-primary) 4px
    );
    animation: matrix-scroll 20s linear infinite;
}

@keyframes matrix-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.prompt {
    color: var(--text-primary);
}

.cursor {
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

/* Lookup Section */
.lookup-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

#ip-input {
    flex: 1;
    min-width: 250px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#ip-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

#ip-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Buttons */
button {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: bold;
}

.btn-primary:hover {
    background: var(--accent-dim);
    border-color: var(--accent-dim);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

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

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-header h2 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: normal;
}

.timestamp {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem;
    transition: border-color 0.3s, transform 0.2s;
}

.result-card:hover {
    border-color: var(--accent-dim);
    transform: translateY(-2px);
}

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

.card-header .icon {
    font-size: 1.2rem;
}

.card-header h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: normal;
}

.card-body p {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.card-body .subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Map Section */
.map-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

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

.map-header h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: normal;
}

.map-placeholder {
    background: var(--bg-primary);
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.map-grid {
    position: absolute;
    width: 100%;
    height: 100%;
}

.grid-line {
    position: absolute;
    background: var(--border-color);
    opacity: 0.3;
}

.grid-line.horizontal {
    width: 100%;
    height: 1px;
}

.grid-line.horizontal:nth-child(1) { top: 25%; }
.grid-line.horizontal:nth-child(2) { top: 50%; }
.grid-line.horizontal:nth-child(3) { top: 75%; }

.grid-line.vertical {
    width: 1px;
    height: 100%;
}

.grid-line.vertical:nth-child(4) { left: 25%; }
.grid-line.vertical:nth-child(5) { left: 50%; }
.grid-line.vertical:nth-child(6) { left: 75%; }

.target-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.marker {
    font-size: 2rem;
    color: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.marker-label {
    font-size: 0.7rem;
    color: var(--accent);
    margin-top: 0.25rem;
    letter-spacing: 2px;
}

.map-note {
    position: absolute;
    bottom: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Security Section */
.security-section {
    margin-bottom: 2rem;
}

.security-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem;
}

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

.security-header h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: normal;
}

.security-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: pulse-status 2s ease-in-out infinite;
}

.status-indicator.safe {
    background: var(--accent);
    animation: none;
}

.status-indicator.warning {
    background: var(--warning);
    animation: none;
}

.status-indicator.danger {
    background: var(--error);
    animation: none;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-text {
    font-size: 1rem;
    color: var(--text-primary);
}

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

/* Actions */
.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.actions button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading Section */
.loading-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
}

.terminal-loader {
    font-family: var(--font-terminal);
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.loader-line {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.loader-line.blink {
    animation: blink 0.7s step-end infinite;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success {
    border-color: var(--accent);
}

.toast.error {
    border-color: var(--error);
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    #ip-input {
        min-width: 100%;
    }
    
    button {
        width: 100%;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
}
