:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --accent: #3b82f6;
    --link: #60a5fa;
    --border: #e5e7eb;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    --bg-primary: #111111;
    --bg-secondary: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --accent: #60a5fa;
    --link: #93c5fd;
    --border: #2d2d2d;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
}

.title-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.title-link:hover {
    color: var(--accent);
}

h1 {
    font-size: 1.875rem;
    font-weight: 600;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

#theme-toggle:hover {
    background-color: var(--bg-secondary);
}

.moon {
    display: none;
}

[data-theme="dark"] .sun {
    display: none;
}

[data-theme="dark"] .moon {
    display: block;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    width: 100%;
}

.ip-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    width: 100%;
}

.ip-display {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background-color: var(--bg-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

#ip-address {
    font-size: 2rem;
    font-weight: 600;
    font-family: monospace;
    white-space: nowrap;
}

#copy-ip {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#copy-ip:hover {
    color: var(--accent);
    background-color: var(--bg-primary);
}

.location-info {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.network-info {
    text-align: center;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.timestamp {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.share-link {
    font-family: monospace;
    font-size: 1rem;
    color: var(--link);
    text-decoration: none;
    margin-top: 0.5rem;
}

.share-link:hover {
    text-decoration: underline;
}

.refresh-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.refresh-button:hover {
    opacity: 0.9;
}

.refresh-button svg {
    transition: transform 0.3s ease;
}

.refresh-button:active svg {
    transform: rotate(180deg);
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    #ip-address {
        font-size: 1.5rem;
    }

    .ip-card {
        padding: 0.75rem;
    }

    .network-info {
        font-size: 1rem;
    }

    .share-link {
        font-size: 0.9rem;
    }
}