/* ===== CSS Variables ===== */
:root {
    --primary-purple: #8b5cf6;
    --primary-pink: #ec4899;
    --primary-blue: #3b82f6;
    --primary-green: #10b981;
    --dark-bg: #0f0f23;
    --darker-bg: #050510;
    --card-bg: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --gradient-1: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    --gradient-2: linear-gradient(135deg, var(--primary-blue), var(--primary-green));
    --gradient-3: linear-gradient(135deg, var(--primary-pink), var(--primary-blue));
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-brand h2 {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.15), transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(236, 72, 153, 0.15), transparent 50%);
    z-index: -1;
}

.hero-content {
    text-align: center;
    z-index: 1;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease;
}

.glitch {
    position: relative;
}

.subtitle {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease 0.6s backwards;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--gradient-1);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

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

.btn-secondary:hover {
    background: var(--primary-purple);
    transform: translateY(-2px);
}

/* ===== Section Styles ===== */
section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-1);
    border-radius: 2px;
}

/* ===== About Section ===== */
.about {
    background: var(--darker-bg);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.lead {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 1.5rem;
}

/* ===== Skills Section ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.skill-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-purple);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.skill-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary-purple);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--primary-purple);
    color: var(--text-primary);
}

/* ===== Projects Section ===== */
.projects {
    background: var(--darker-bg);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-pink);
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    flex: 1;
}

.project-links {
    display: flex;
    gap: 0.5rem;
}

.project-link {
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.project-link:hover {
    color: var(--primary-purple);
    transform: scale(1.1);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: rgba(236, 72, 153, 0.2);
    color: var(--primary-pink);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

/* ===== Contact Section ===== */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-intro {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-link:hover {
    background: var(--gradient-1);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

/* ===== Footer ===== */
.footer {
    background: var(--darker-bg);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.footer p {
    color: var(--text-secondary);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(15, 15, 35, 0.98);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .hero h1 {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .section-title {
        font-size: 2rem;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

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

    .hero h1 {
        font-size: 2.5rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .profile-main-card {
        padding: 2rem;
    }

    .profile-greeting {
        font-size: 2rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .dashboard {
        padding: 80px 1rem 2rem;
    }
}

/* ===== Dashboard & Profile Styles ===== */

.edit-profile-btn {
    margin-top: 1rem;
    background: var(--gradient-2);
    color: var(--text-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.spacer {
    height: 20px; /* Height of the navbar */
}

.dashboard {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 2rem 2rem;
    background: var(--darker-bg);
}

.profile-card-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.profile-main-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(139, 92, 246, 0.1);
    transition: all 0.3s ease;
}

.profile-main-card:hover {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

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

.profile-greeting {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.profile-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.profile-divider {
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(139, 92, 246, 0.5),
        transparent);
    margin: 2rem 0;
}

.profile-section {
    margin-top: 2rem;
}

.section-heading {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-heading::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--gradient-1);
    border-radius: 2px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.label-icon {
    font-size: 1.2rem;
}

.form-input {
    padding: 1rem;
    background: rgba(15, 15, 35, 0.5);
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-input:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: rgba(15, 15, 35, 0.8);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.form-actions .btn {
    flex: 1;
    text-align: center;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

/* ===== Logs Page Styles ===== */
.logs-section {
    min-height: 100vh;
    padding: 120px 1rem 2rem;
    background: var(--darker-bg);
}

.logs-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.logs-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(139, 92, 246, 0.1);
    transition: all 0.3s ease;
}

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

.logs-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.logs-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.table-container {
    overflow-x: auto;
    margin-top: 2rem;
}

.logs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.logs-table thead {
    background: rgba(139, 92, 246, 0.1);
}

.logs-table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

.logs-table thead th:first-child {
    border-top-left-radius: 10px;
}

.logs-table thead th:last-child {
    border-top-right-radius: 10px;
}

.logs-table tbody tr {
    transition: all 0.2s ease;
}

.logs-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.logs-table tbody td {
    padding: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.logs-table tbody tr:last-child td {
    border-bottom: none;
}

.ip-badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-blue);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.time-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

.url-text {
    color: var(--primary-green);
    font-size: 0.9rem;
    word-break: break-all;
}

/* Responsive table */
@media (max-width: 1024px) {
    .logs-card {
        padding: 2rem;
    }

    .logs-table {
        font-size: 0.9rem;
    }

    .logs-table thead th,
    .logs-table tbody td {
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .logs-title {
        font-size: 2rem;
    }

    .logs-card {
        padding: 1.5rem;
    }

    .logs-table {
        font-size: 0.85rem;
    }

    .logs-table thead th,
    .logs-table tbody td {
        padding: 0.5rem;
    }
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-purple);
}

/* Scrollbar for table container */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--gradient-1);
    border-radius: 4px;
}

/* ===== Scan IP Button & Loader ===== */
.scan-ip-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.scan-ip-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.scan-ip-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loader {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Modal Styles ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    margin: auto;
    padding: 0;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7),
                0 0 0 1px rgba(139, 92, 246, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.modal-close {
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0 0.5rem;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--primary-purple);
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
}

.scan-result-item {
    padding: 1rem;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.scan-result-item:last-child {
    margin-bottom: 0;
}

.scan-result-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.scan-result-item strong {
    color: var(--text-primary);
    margin-right: 0.5rem;
}

.port-list {
    color: var(--primary-green);
    font-weight: 500;
}

.scan-error {
    padding: 1.5rem;
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: 10px;
    text-align: center;
}

.scan-error p {
    margin: 0;
    color: var(--primary-pink);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem auto;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }
}
