:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #818cf8;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 100%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

.app-wrapper {
    display: flex;
    width: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    transition: all 0.3s ease;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.sidebar-logo h2 {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.nav-link svg {
    width: 20px;
    height: 20px;
}

/* Main Content area */
.main-content {
    flex-grow: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 900px;
}

header {
    text-align: left;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

p.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.tool-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: none;
}

.tool-card.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

.input-group {
    margin-bottom: 2rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: white;
    font-size: 1.1rem;
    font-family: 'Fira Code', monospace;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"].with-actions {
    padding: 1rem 4.5rem 1rem 1.25rem;
}

.input-actions {
    position: absolute;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.05);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

input:focus,
select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    height: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.result-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    position: relative;
    transition: all 0.2s ease;
}

.result-item:hover {
    background: rgba(15, 23, 42, 0.6);
    transform: translateY(-2px);
}

.result-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.result-value {
    font-family: 'Fira Code', monospace;
    font-size: 1.1rem;
    color: var(--accent-color);
    word-break: break-all;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.copy-btn svg {
    width: 18px;
    height: 18px;
}

footer {
    margin-top: 3rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subnet Calculator Specifics */
.ip-input-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* DNS Lookup Specifics */
.dns-results {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dns-record {
    background: rgba(15, 23, 42, 0.4);
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    border-radius: 0 12px 12px 0;
}

.dns-type {
    font-weight: 700;
    color: var(--accent-color);
    margin-right: 0.5rem;
}

/* Mobile adjustments */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 2rem 0.75rem;
    }

    .sidebar-logo h2,
    .nav-link span {
        display: none;
    }

    .nav-link {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .app-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        position: relative;
    }

    .sidebar-logo {
        margin-bottom: 0;
        margin-right: auto;
    }

    .nav-links {
        display: flex;
        gap: 0.5rem;
    }

    .nav-item {
        margin-bottom: 0;
    }

    .main-content {
        padding: 1.5rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .ip-input-row {
        grid-template-columns: 1fr;
    }
}