/*
* HARUN RAHAHLA PORTFOLIO WEBSITE
* Main Stylesheet
*/

/* 
* ========================================
* VARIABLES
* ========================================
*/
:root {
    /* Base Colors */
    --primary-color: #6366f1;       /* Indigo */
    --primary-dark: #4f46e5;        /* Darker indigo for hover states */
    --primary-light: #a5b4fc;       /* Light indigo */
    --secondary-color: #10b981;     /* Emerald */
    --accent-color: #f59e0b;        /* Amber */
    
    /* Dark Theme Colors */
    --dark-bg: #0f172a;             /* Dark blue/slate */
    --dark-bg-secondary: #1e293b;   /* Slightly lighter blue/slate */
    --dark-card-bg: #1e293b;        /* Card background */
    --dark-surface: #334155;        /* Surface elements */
    --dark-border: #475569;         /* Border color */
    
    /* Text Colors */
    --text-primary: #f8fafc;        /* Nearly white */
    --text-secondary: #cbd5e1;      /* Light gray */
    --text-muted: #94a3b8;          /* Muted text */
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --dark-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.20), 0 5px 10px rgba(0, 0, 0, 0.22);
    --shadow-hover: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
    
    /* Transitions */
    --transition-fast: all 0.3s ease;
    --transition-normal: all 0.5s ease;
    --transition-slow: all 0.8s ease;
    
    /* Spacing */
    --section-padding: 100px 0;
    --section-padding-mobile: 60px 0;
    
    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-full: 9999px;
}

/* 
* ========================================
* BASE STYLES
* ========================================
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Offset for fixed header */
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

body.dark-theme {
    background-color: var(--dark-bg);
    color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* Container override for better spacing */
.container {
    padding: 0 2rem;
}

/* 
* ========================================
* PRELOADER
* ========================================
*/
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader {
    width: 50px;
    height: 50px;
    position: relative;
}

.loader-inner {
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--primary-color);
    border-right-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-inner:before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 3px solid transparent;
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.loader-inner:after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 3px solid transparent;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 
* ========================================
* NAVIGATION
* ========================================
*/
.navbar {
    background-color: transparent;
    transition: var(--transition-fast);
    padding: 1.5rem 0;
}

.navbar.scrolled {
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--text-primary) !important;
}

.logo-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 2rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
}

.logo-text:hover {
    text-shadow: 0 0 10px var(--primary-light);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.navbar-nav {
    margin-left: auto;
}

.nav-link {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    color: var(--text-secondary) !important;
    position: relative;
    transition: var(--transition-fast);
}

.nav-link:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary) !important;
}

.nav-link:hover:before, .nav-link.active:before {
    width: 70%;
    left: 15%;
}

.navbar-toggler {
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* 
* ========================================
* BUTTONS
* ========================================
*/
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition-fast);
    z-index: -1;
}

.btn:hover::before {
    width: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* 
* ========================================
* HERO SECTION
* ========================================
*/
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    background-color: var(--dark-bg);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.05) 0%, rgba(15, 23, 42, 0) 70%);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding: 0 5px;
    position: relative;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius-full);
    opacity: 0.3;
}

/* Typing cursor animation */
.cursor {
    display: inline-block;
    width: 2px;
    background-color: var(--text-primary);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Hero Code Block Animation */
.hero-image-container {
    position: relative;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.code-block {
    background-color: var(--dark-card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: float 6s ease-in-out infinite;
    max-width: 100%;
    overflow: auto;
}

.code-block pre {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.code-block code {
    font-family: 'Courier New', monospace;
}

.code-highlight {
    color: var(--primary-color);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    animation: bounce 2s ease infinite;
}

.scroll-indicator a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-full);
    color: var(--text-primary);
    font-size: 1.25rem;
    transition: var(--transition-fast);
}

.scroll-indicator a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

/* 
* ========================================
* SECTION COMMON STYLES
* ========================================
*/
.section-padding {
    padding: var(--section-padding);
}

.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-line {
    height: 4px;
    width: 60px;
    background: var(--primary-gradient);
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius-full);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* 
* ========================================
* ABOUT SECTION
* ========================================
*/
.about-section {
    background-color: var(--dark-bg-secondary);
    position: relative;
    overflow: hidden;
}

.about-image-wrapper {
    position: relative;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-blob-1,
.about-blob-2 {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.15;
    z-index: 1;
}

.about-blob-1 {
    width: 200px;
    height: 200px;
    background-color: var(--primary-color);
    top: 20%;
    left: 20%;
    animation: blob-move-1 10s ease-in-out infinite alternate;
}

.about-blob-2 {
    width: 250px;
    height: 250px;
    background-color: var(--secondary-color);
    bottom: 10%;
    right: 10%;
    animation: blob-move-2 15s ease-in-out infinite alternate;
}

@keyframes blob-move-1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.2); }
}

@keyframes blob-move-2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, -20px) scale(0.8); }
}

.about-image {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background-color: var(--dark-card-bg);
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--dark-gradient);
    font-size: 4rem;
    color: var(--text-muted);
}

.section-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* 
* ========================================
* TECHNOLOGIES SECTION
* ========================================
*/
.technologies-section {
    background-color: var(--dark-bg);
    position: relative;
    overflow: hidden;
}

.tech-slider-container {
    overflow: hidden;
    padding: 2rem 0;
    position: relative;
}

.tech-slider {
    display: flex;
    gap: 2rem;
    animation: slide 20s linear infinite;
}

.tech-item {
    flex: 0 0 auto;
    width: 150px;
    text-align: center;
    padding: 1.5rem;
    background-color: var(--dark-card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.tech-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
    background-color: var(--dark-surface);
}

.tech-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.tech-item h3 {
    font-size: 1rem;
    margin-bottom: 0;
    color: var(--text-primary);
}

@keyframes slide {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-150px * 4 - 8rem)); } /* 4 items with 2rem gap */
}

/* 
* ========================================
* PROJECTS SECTION
* ========================================
*/
.projects-section {
    background-color: var(--dark-bg-secondary);
    position: relative;
}

.project-card {
    background-color: var(--dark-card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    height: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.project-header {
    position: relative;
}

.project-thumbnail {
    position: relative;
    overflow: hidden;
    height: 240px;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.project-card:hover .project-thumbnail img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition-normal);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    transform: translateY(20px);
    opacity: 0;
    transition: var(--transition-normal);
}

.project-card:hover .project-link {
    transform: translateY(0);
    opacity: 1;
}

.project-body {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.project-techs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-badge {
    padding: 0.25rem 0.75rem;
    background-color: var(--dark-surface);
    border-radius: var(--border-radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.project-buttons {
    display: flex;
    gap: 0.75rem;
}

/* 
* ========================================
* CALL TO ACTION SECTION
* ========================================
*/
.cta-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--dark-bg) 0%, rgba(99, 102, 241, 0.2) 100%);
    position: relative;
    overflow: hidden;
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.cta-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* 
* ========================================
* FOOTER
* ========================================
*/
.footer {
    padding-top: 4rem;
    background-color: var(--dark-bg);
    color: var(--text-secondary);
}

.footer-brand {
    margin-bottom: 1.5rem;
}

.footer-text {
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.footer-heading {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius-full);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: var(--dark-surface);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.social-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

.footer-bottom {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--dark-border);
    text-align: center;
}

.copyright {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* 
* ========================================
* BACK TO TOP BUTTON
* ========================================
*/
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-fast);
    opacity: 0;
    visibility: hidden;
    z-index: 99;
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-5px);
}

/* 
* ========================================
* MEDIA QUERIES
* ========================================
*/
@media (max-width: 1199.98px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .code-block {
        font-size: 0.8rem;
    }
}

@media (max-width: 991.98px) {
    :root {
        --section-padding: 80px 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-image-wrapper {
        margin-top: 3rem;
    }
    
    .about-image {
        width: 280px;
        height: 280px;
    }
}

@media (max-width: 767.98px) {
    :root {
        --section-padding: 60px 0;
    }
    
    .hero-section {
        min-height: 600px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .tech-slider {
        animation: slide 15s linear infinite;
    }
}

@media (max-width: 575.98px) {
    :root {
        --section-padding: 50px 0;
    }
    
    .container {
        padding: 0 1.5rem;
    }
    
    .hero-section {
        min-height: 500px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .logo-text {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .about-image {
        width: 240px;
        height: 240px;
    }
    
    .tech-item {
        width: 120px;
    }
    
    .tech-icon {
        font-size: 2rem;
    }
    
    @keyframes slide {
        0% { transform: translateX(0); }
        100% { transform: translateX(calc(-120px * 4 - 8rem)); }
    }
    
    .cta-title {
        font-size: 1.8rem;
    }
    
    .back-to-top-btn {
        right: 1rem;
        bottom: 1rem;
        width: 40px;
        height: 40px;
    }
}