/* ===== CSS Variables ===== */
:root {
    --primary: #64ffda;
    --primary-dark: #4fd1c5;
    --secondary: #8892b0;
    --bg-dark: #0a192f;
    --bg-light: #112240;
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --text-muted: #64ffda;
    --python: #3776ab;
    --php: #777bb4;
    --js: #f7df1e;
    --html: #e34f26;
    --css: #1572b6;
    --react: #61dafb;
    --mysql: #4479a1;
    --mongodb: #4db33d;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-dark);
    overflow-x: hidden;
}

code, pre {
    font-family: 'Fira Code', monospace;
}

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

/* ===== Loading Screen ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.code-container {
    margin-bottom: 30px;
}

.code-line {
    font-size: 14px;
    color: var(--text-primary);
    text-align: right;
    opacity: 0;
    animation: slideInRight 0.5s ease forwards;
}

.code-line:nth-child(1) { animation-delay: 0.1s; }
.code-line:nth-child(2) { animation-delay: 0.3s; }
.code-line:nth-child(3) { animation-delay: 0.5s; }
.code-line:nth-child(4) { animation-delay: 0.7s; }
.code-line:nth-child(5) { animation-delay: 0.9s; }

.keyword { color: #c678dd; }
.string { color: #98c379; }
.class-name { color: #e5c07b; }
.function-name { color: #61afef; }
.indent { margin-right: 20px; }
.indent.double { margin-right: 40px; }

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 25, 47, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 15px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Fira Code', monospace;
}

.nav-menu {
    display: flex;
    gap: 40px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

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

.nav-link.active {
    color: var(--primary);
}

.nav-link.active .nav-text {
    border-bottom: 2px solid var(--primary);
}

.nav-number {
    color: var(--primary);
    font-family: 'Fira Code', monospace;
    font-size: 12px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.nav-toggle span {
    width: 30px;
    height: 3px;
    background: var(--primary);
    transition: var(--transition);
}

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

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.grid-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(100, 255, 218, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 255, 218, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.hero-left {
    animation: slideInUp 1s ease;
}

.hero-greeting {
    margin-bottom: 20px;
}

.greeting-label {
    color: var(--primary);
    font-size: 16px;
    font-family: 'Fira Code', monospace;
    animation: fadeIn 0.8s ease;
}

.hero-title {
    font-size: clamp(40px, 8vw, 70px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.title-line {
    display: block;
    opacity: 0;
    animation: slideInLeft 0.6s ease forwards;
}

.title-line:nth-child(1) { animation-delay: 0.2s; }
.title-line:nth-child(2) { animation-delay: 0.4s; }

.title-line.subtitle {
    color: var(--text-secondary);
    font-size: clamp(30px, 6vw, 60px);
    animation-delay: 0.6s;
}

.hero-description {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 500px;
    animation: fadeIn 0.8s ease 0.8s both;
}

.hero-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    animation: fadeIn 0.8s ease 1s both;
}

.skill-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: var(--primary);
    font-size: 14px;
    transition: var(--transition);
    animation: scaleIn 0.4s ease both;
}

.skill-tag:nth-child(1) { animation-delay: 1.1s; }
.skill-tag:nth-child(2) { animation-delay: 1.2s; }
.skill-tag:nth-child(3) { animation-delay: 1.3s; }
.skill-tag:nth-child(4) { animation-delay: 1.4s; }
.skill-tag:nth-child(5) { animation-delay: 1.5s; }

.skill-tag:hover {
    background: rgba(100, 255, 218, 0.2);
    transform: translateY(-2px);
}

.hero-actions {
    display: flex;
    gap: 16px;
    animation: fadeIn 0.8s ease 1.2s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: rgba(100, 255, 218, 0.1);
    transform: translateY(-3px);
}

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

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

/* ===== Code Editor ===== */
.hero-right {
    animation: slideInRight 1s ease;
}

.code-editor {
    background: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(100, 255, 218, 0.1);
    animation: float 6s ease-in-out infinite;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

.editor-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27ca40; }

.editor-title {
    color: var(--text-secondary);
    font-size: 14px;
    font-family: 'Fira Code', monospace;
}

.editor-content {
    padding: 20px;
    overflow-x: auto;
}

.code-block {
    font-size: 14px;
    line-height: 1.6;
}

.code-block code {
    color: var(--text-primary);
}

/* ===== Scroll Indicator ===== */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--primary);
    border-radius: 12px;
    position: relative;
}

.scroll-wheel {
    width: 4px;
    height: 8px;
    background: var(--primary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 1.5s infinite;
}

/* ===== Section Styles ===== */
section {
    padding: 100px 0;
}

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

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
}

.section-number {
    color: var(--primary);
    font-family: 'Fira Code', monospace;
    font-size: 20px;
    font-weight: 700;
}

.section-title {
    font-size: clamp(26px, 5vw, 36px);
    font-weight: 700;
    color: var(--text-primary);
}

.section-line {
    flex: 1;
    height: 1px;
    background: rgba(100, 255, 218, 0.3);
    max-width: 300px;
}

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

.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: start;
}

.about-image {
    position: relative;
}

.image-container {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
}

.image-frame {
    position: relative;
    z-index: 2;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--primary);
    transition: var(--transition);
}

.image-frame:hover {
    transform: translateY(-5px);
}

.developer-avatar {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--bg-light), var(--bg-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: var(--primary);
}

.tech-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tech-icon {
    position: absolute;
    font-size: 24px;
    animation: float 4s ease-in-out infinite;
}

.tech-icon.python {
    top: 20%;
    right: 10%;
    color: var(--python);
    animation-delay: 0s;
}

.tech-icon.php {
    top: 60%;
    right: 5%;
    color: var(--php);
    animation-delay: 0.5s;
}

.tech-icon.js {
    bottom: 30%;
    left: 5%;
    color: var(--js);
    animation-delay: 1s;
}

.tech-icon.html {
    top: 30%;
    left: 10%;
    color: var(--html);
    animation-delay: 1.5s;
}

.tech-icon.css {
    bottom: 20%;
    right: 20%;
    color: var(--css);
    animation-delay: 2s;
}

.about-text h3 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 16px;
}

.about-stats {
    display: flex;
    gap: 40px;
    margin: 30px 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    font-family: 'Fira Code', monospace;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Skills Section ===== */
.skills-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.skills-category {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(100, 255, 218, 0.1);
    transition: var(--transition);
}

.skills-category:hover {
    border-color: rgba(100, 255, 218, 0.3);
    transform: translateY(-5px);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.category-header i {
    font-size: 24px;
    color: var(--primary);
}

.category-header h3 {
    font-size: 20px;
    color: var(--text-primary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.skill-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-dark);
    border-radius: 8px;
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateX(5px);
}

.skill-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.skill-icon.python { background: var(--python); }
.skill-icon.php { background: var(--php); }
.skill-icon.js { background: var(--js); color: #000; }
.skill-icon.html { background: var(--html); }
.skill-icon.css { background: var(--css); }
.skill-icon.react { background: var(--react); }
.skill-icon.mysql { background: var(--mysql); }
.skill-icon.mongodb { background: var(--mongodb); }

.skill-info {
    flex: 1;
}

.skill-info h4 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.skill-bar {
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.skill-progress {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0;
    transition: width 1s ease;
}

.skill-level {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
}

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

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

.project-card {
    background: var(--bg-dark);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(100, 255, 218, 0.1);
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(100, 255, 218, 0.3);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, var(--bg-light), var(--bg-dark));
    position: relative;
    overflow: hidden;
}

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

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

.project-tech span {
    background: var(--bg-dark);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Fira Code', monospace;
}

.project-content {
    padding: 24px;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.project-header i {
    color: var(--primary);
    font-size: 24px;
}

.project-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-links {
    display: flex;
    gap: 16px;
}

.project-link {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.project-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

/* ===== Contact Section ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
}

.contact-subtitle {
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 40px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: rgba(100, 255, 218, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
}

.contact-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.contact-text a {
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition);
}

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

.social-links {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.social-link {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 20px;
    transition: var(--transition);
}

.social-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

/* ===== Contact Form ===== */
.contact-form {
    background: var(--bg-light);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(100, 255, 218, 0.1);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(100, 255, 218, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form .btn {
    width: 100%;
    justify-content: center;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-content i {
    color: var(--primary);
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes scrollWheel {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--bg-light);
        flex-direction: column;
        padding: 100px 30px;
        transition: var(--transition);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .code-editor {
        display: none;
    }
    
    .about-stats {
        flex-direction: column;
        gap: 20px;
    }
}