body {
    font-family: 'Montserrat', sans-serif;
    background-color: #ffffff; 
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 550px;
}

h1 {
    color: #2c3e50;
    font-size: 2em;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

#ip-input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    border-radius: 6px;
    font-size: 1em;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.3s, color 0.3s;
}

#ip-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

#search-button {
    padding: 12px 24px;
    border: none;
    background-color: #3498db;
    color: white;
    border-radius: 6px;
    font-size: 1em;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

#search-button:hover {
    background-color: #2980b9;
}

#loading-message {
    font-size: 1.1em;
    text-align: center;
}

.error-message {
    color: #e74c3c;
}

#ip-details {
    text-align: left;
    margin-top: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f0f2f5;
    font-size: 1em;
    transition: border-color 0.3s;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 700;
    color: #34495e;
    margin-right: 15px;
    flex-shrink: 0;
}

.info-value {
    color: #2980b9;
    word-break: break-all;
    text-align: right;
    font-weight: 500;
}

footer {
    padding: 20px;
    text-align: center;
    font-size: 0.8em;
    color: #95a5a6;
    flex-shrink: 0;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@keyframes pulse {
    0% { background-color: #f0f2f5; }
    50% { background-color: #e6e8eb; }
    100% { background-color: #f0f2f5; }
}

.skeleton-value {
    height: 1em;
    width: 50%;
    border-radius: 4px;
    animation: pulse 1.5s infinite ease-in-out;
}
.info-row:nth-of-type(2) .skeleton-value { width: 40%; }
.info-row:nth-of-type(4) .skeleton-value { width: 20%; }
.info-row:nth-of-type(7) .skeleton-value { width: 30%; }

@media (min-width: 769px) {
    main {
        align-items: center;
    }
    .container {
        border: 1px solid #ddd;
        border-radius: 10px;
        padding: 40px;
    }
}

@media (prefers-color-scheme: dark) {
    body { background-color: #121212; color: #e0e0e0; }
    h1 { color: #f5f5f5; }
    #ip-input { background-color: #2a2a2a; border-color: #555; color: #e0e0e0; }
    #ip-input::placeholder { color: #888; }
    #ip-input:focus { border-color: #3498db; box-shadow: 0 0 5px rgba(52, 152, 219, 0.5); }
    #search-button { background-color: #3498db; }
    #search-button:hover { background-color: #2980b9; }
    .info-row { border-bottom-color: #3a3a3a; }
    .info-label { color: #bbb; }
    .info-value { color: #58a6ff; }
    footer, #loading-message { color: #888; }
    footer a { color: #58a6ff; }
    .error-message { color: #ff7b72; }
    
    @keyframes pulse-dark {
        0% { background-color: #2a2a2a; }
        50% { background-color: #3a3a3a; }
        100% { background-color: #2a2a2a; }
    }

    .skeleton-value {
        animation-name: pulse-dark;
    }

    @media (min-width: 769px) {
        .container {
            background-color: #1e1e1e;
            border-color: #444;
        }
    }
}