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

body {
    font-family: 'Inter', sans-serif;
    background: #f8f9fa;
    color: #1f2937;
    line-height: 1.6;
    min-height: 100vh;
}

.header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #8b5cf6;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.header-search {
    flex: 0 1 350px;
}

.header-search-container {
    position: relative;
    display: flex;
    gap: 0.5rem;
}

.header-search-input {
    flex: 1;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #1f2937;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.header-search-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.header-search-input::placeholder {
    color: #9ca3af;
}

.header-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8b5cf6;
    pointer-events: none;
    font-size: 0.875rem;
}

.search-button {
    padding: 0.625rem 1.25rem;
    background: #8b5cf6;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-button:hover {
    background: #7c3aed;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.container {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
}

.main-content {
    flex: 1;
    padding: 2rem;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #8b5cf6;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1rem;
    color: #6b7280;
    max-width: 700px;
    margin: 0 auto;
}

.category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.tool-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    position: relative;
    overflow: visible;
    text-decoration: none;
    color: inherit;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #8b5cf6;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.15);
    border-color: #8b5cf6;
    background: #faf9fc;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.new-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    animation: pulse 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.6);
    }
}

.tool-icon-wrapper {
    width: 55px;
    height: 55px;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.tool-icon {
    font-size: 1.5rem;
    color: #8b5cf6;
}

.tool-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
}

.sidebar {
    width: 320px;
    background: #ffffff;
    border-left: 1px solid #e5e7eb;
    padding: 2rem 1.5rem;
    height: calc(100vh - 73px);
    overflow-y: auto;
    position: sticky;
    top: 73px;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.popular-tool-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.popular-tool-item:hover {
    padding-left: 0.5rem;
}

.popular-tool-item:hover .popular-tool-name {
    color: #8b5cf6;
}

.popular-tool-dot {
    width: 8px;
    height: 8px;
    background: #8b5cf6;
    border-radius: 50%;
    flex-shrink: 0;
}

.popular-tool-name {
    font-size: 0.875rem;
    color: #6b7280;
    transition: color 0.2s ease;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #8b5cf6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    text-decoration: none;
}

.back-button:hover {
    background: #7c3aed;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.ip-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.ip-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ip-card-header {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ip-card-body {
    padding: 1.5rem;
}

.ip-display {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.ip-address {
    font-size: 2rem;
    font-weight: bold;
    color: #8b5cf6;
    margin: 0.75rem 0;
    word-break: break-all;
}

.ip-label {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #8b5cf6;
}

.info-item-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.info-item-value {
    color: #1f2937;
    font-size: 0.95rem;
    font-weight: 500;
}

#map {
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
}

.buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #8b5cf6;
    color: white;
}

.btn-primary:hover {
    background: #7c3aed;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    color: #8b5cf6;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #8b5cf6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    color: #dc3545;
    background: #f8d7da;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
    display: none;
    border-left: 3px solid #dc3545;
}

.security-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.secure {
    background: #d4edda;
    color: #155724;
    border-left: 3px solid #28a745;
}

.insecure {
    background: #f8d7da;
    color: #721c24;
    border-left: 3px solid #dc3545;
}

@media (max-width: 1200px) {
    .sidebar {
        display: none;
    }

    .ip-dashboard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .header-search {
        width: 100%;
        flex: 1;
    }

    .main-content {
        padding: 1rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.875rem;
    }

    .tool-card {
        padding: 1rem 0.5rem;
        min-height: 120px;
    }

    .tool-icon-wrapper {
        width: 50px;
        height: 50px;
    }

    .tool-icon {
        font-size: 1.35rem;
    }

    .tool-name {
        font-size: 0.75rem;
    }

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

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

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}
