/*
 * CyberSys Developer Portfolio
 * Cybersecurity and Low-Level Programming Theme
 */

/* ========== CSS Variables ========== */
:root {
    /* Base Colors - Light Mode */
    --primary-color: #2563eb;
    --secondary-color: #4f46e5;
    --accent-color: #10b981;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #f8fafc;
    --bg-card: #ffffff;
    --bg-alt: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* Other Variables */
    --header-height: 4rem;
    --section-padding: 5rem 0;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    
    /* Typography */
    --font-primary: 'Roboto', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Dark Mode Variables */
.dark-mode {
    --primary-color: #3b82f6;
    --secondary-color: #6366f1;
    --accent-color: #10b981;
    --text-color: #f1f5f9;
    --text-light: #cbd5e1;
    --bg-color: #0f172a;
    --bg-card: #1e293b;
    --bg-alt: #1e293b;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* ========== Base Styles ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 62.5%; /* 1rem = 10px */
}

body {
    font-family: var(--font-primary);
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, textarea {
    font-family: inherit;
    font-size: inherit;
}

section {
    padding: var(--section-padding);
}

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

.btn {
    display: inline-block;
    padding: 1.2rem 2.4rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

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

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

/* ========== Theme Toggle ========== */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
}

.theme-switch {
    display: none;
}

.switch-label {
    display: block;
    width: 6rem;
    height: 3rem;
    background-color: var(--bg-card);
    border-radius: 5rem;
    position: relative;
    cursor: pointer;
    box-shadow: 0 0.5rem 1rem var(--shadow-color);
    overflow: hidden;
    transition: var(--transition);
}

.fa-sun, .fa-moon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    transition: var(--transition);
}

.fa-sun {
    left: 0.8rem;
    color: #f59e0b;
}

.fa-moon {
    right: 0.8rem;
    color: #6366f1;
}

.toggle-ball {
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    width: 2.4rem;
    height: 2.4rem;
    background-color: var(--primary-color);
    border-radius: 50%;
    transition: var(--transition);
}

.theme-switch:checked + .switch-label .toggle-ball {
    transform: translateX(3rem);
}

/* ========== Header & Navigation ========== */
header {
    height: var(--header-height);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99;
    background-color: var(--bg-color);
    box-shadow: 0 0.5rem 1rem var(--shadow-color);
    transition: var(--transition);
}

.scrolled {
    height: calc(var(--header-height) - 1rem);
    box-shadow: 0 1rem 2rem var(--shadow-color);
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo a {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.logo span {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 2.4rem;
    cursor: pointer;
}

/* ========== Hero Section ========== */
.hero {
    min-height: 100vh;
    padding-top: calc(var(--header-height) + 5rem);
    display: flex;
    align-items: center;
    position: relative;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 4.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-text h2 {
    font-size: 2.4rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.hero-text p {
    font-size: 1.8rem;
    margin-bottom: 3rem;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    width: 4.5rem;
    height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--bg-alt);
    color: var(--primary-color);
    font-size: 1.8rem;
    transition: var(--transition);
}

.social-icon:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

.hero-image {
    flex: 1;
}

.code-block {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 1rem 3rem var(--shadow-color);
    overflow: hidden;
    position: relative;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3rem;
    background-color: var(--bg-alt);
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.code-block::after {
    content: '● ● ●';
    position: absolute;
    top: 0.8rem;
    left: 1.5rem;
    font-size: 1.2rem;
    color: var(--text-light);
}

.code-block pre {
    margin-top: 2rem;
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--text-color);
    line-height: 1.8;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.mouse {
    display: block;
    width: 3rem;
    height: 5rem;
    border: 2px solid var(--text-light);
    border-radius: 2rem;
    margin: 0 auto 1rem;
    position: relative;
}

.wheel {
    display: block;
    width: 0.6rem;
    height: 0.6rem;
    background-color: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

.arrow {
    display: block;
    font-size: 1.4rem;
    color: var(--text-light);
    animation: bounce 2s infinite;
}

@keyframes scroll {
    0% {
        opacity: 1;
        top: 1rem;
    }
    100% {
        opacity: 0;
        top: 3rem;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-1rem);
    }
    60% {
        transform: translateY(-0.5rem);
    }
}

/* ========== Section Headers ========== */
.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-title {
    font-size: 3.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.underline {
    width: 6rem;
    height: 0.4rem;
    background-color: var(--primary-color);
    margin: 0 auto;
    border-radius: 2rem;
}

/* ========== About Section ========== */
.about-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 5rem;
}

.about-image {
    flex: 0 0 40%;
}

.image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, transparent 50%);
    opacity: 0.3;
}

.about-text {
    flex: 0 0 55%;
}

.about-text h3 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

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

.about-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 3rem 0;
}

.detail {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 0.5rem 1.5rem var(--shadow-color);
    transition: var(--transition);
}

.detail:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 2rem var(--shadow-color);
}

.detail i {
    font-size: 2.4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.detail h4 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ========== Skills Section ========== */
.skills-categories {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.skill-category h3 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.skill-category h3 i {
    color: var(--primary-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr));
    gap: 2rem;
}

.skill-item {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 0.5rem 1.5rem var(--shadow-color);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 2rem var(--shadow-color);
}

.skill-icon {
    width: 4.5rem;
    height: 4.5rem;
    background-color: var(--bg-alt);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
}

.skill-info {
    flex: 1;
}

.skill-info h4 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.skill-level {
    width: 100%;
    height: 0.8rem;
    background-color: var(--bg-alt);
    border-radius: 5rem;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 5rem;
}

/* ========== Projects Section ========== */
.projects-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 4rem;
}

.filter-btn {
    padding: 0.8rem 1.6rem;
    background-color: var(--bg-card);
    border: none;
    border-radius: 5rem;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(35rem, 1fr));
    gap: 3rem;
}

.project-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 0.5rem 1.5rem var(--shadow-color);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 1.5rem 3rem var(--shadow-color);
}

.project-image {
    width: 100%;
    height: 22rem;
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

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

.project-link {
    width: 4.5rem;
    height: 4.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: var(--transition);
}

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

.project-content {
    padding: 2rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.tag {
    padding: 0.5rem 1rem;
    background-color: var(--bg-alt);
    border-radius: 5rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.project-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-description {
    color: var(--text-light);
    font-size: 1.5rem;
}

/* ========== Contact Section ========== */
.contact-content {
    display: flex;
    justify-content: space-between;
    gap: 5rem;
}

.contact-info {
    flex: 0 0 45%;
}

.contact-info h3 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.contact-info p {
    margin-bottom: 3rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.contact-item i {
    width: 4.5rem;
    height: 4.5rem;
    background-color: var(--bg-alt);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary-color);
}

.contact-item h4 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-link {
    width: 4.5rem;
    height: 4.5rem;
    background-color: var(--bg-alt);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

/* Email protection */
.protected-email {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.contact-form {
    flex: 0 0 45%;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-card);
    color: var(--text-color);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.error-message {
    display: block;
    color: #ef4444;
    font-size: 1.4rem;
    margin-top: 0.5rem;
}

/* ========== Footer ========== */
.footer {
    background-color: var(--bg-alt);
    padding: 5rem 0 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo a {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.footer-nav ul {
    display: flex;
    gap: 2rem;
}

.footer-nav a {
    color: var(--text-color);
    transition: var(--transition);
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* ========== Scroll to Top ========== */
.scroll-top {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    width: 4.5rem;
    height: 4.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 0.5rem 1.5rem var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
}

.scroll-top.active {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-5px);
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-2rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(2rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== Media Queries ========== */
@media screen and (max-width: 992px) {
    html {
        font-size: 55%;
    }
    
    .hero-content,
    .about-content,
    .contact-content {
        flex-direction: column;
    }
    
    .about-text,
    .about-image,
    .contact-info,
    .contact-form {
        flex: 0 0 100%;
    }
    
    .about-image {
        margin-bottom: 4rem;
    }
    
    .contact-info {
        margin-bottom: 4rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr));
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr));
    }
}

@media screen and (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--bg-card);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4rem;
        transition: var(--transition);
        box-shadow: -1rem 0 2rem var(--shadow-color);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        font-size: 2rem;
    }
    
    .about-details {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-nav ul {
        justify-content: center;
    }
    
    .theme-toggle {
        top: auto;
        bottom: 2rem;
    }
}

@media screen and (max-width: 576px) {
    html {
        font-size: 50%;
    }
    
    .hero-text h1 {
        font-size: 3.6rem;
    }
    
    .hero-text h2 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        text-align: center;
    }
    
    .scroll-top {
        bottom: 2rem;
        right: 2rem;
    }
}
