/* Google Fonts — moved to head.ejs as <link> for faster loading */

:root {
    --primary-color: #4a6fa5;
    --secondary-color: #162447;
    --accent-color: #e43f5a;
    --light-bg: #f8f9fa;
    --dark-bg: #1f4068;
    --text-color: #333;
    --text-light: #f8f9fa;
    --card-bg: #ffffff;
    --section-bg: #f8f9fa;
}

[data-theme="dark"] {
    --primary-color: #6c91c9;
    --secondary-color: #0b1221;
    --accent-color: #ff5e78;
    --light-bg: #121212;
    --dark-bg: #0b1221;
    --text-color: #e0e0e0;
    --text-light: #e0e0e0;
    --card-bg: #1e1e1e;
    --section-bg: #121212;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-bg);
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100vw;
    min-height: 100vh;
}

/* Only animate during theme toggle — not on every scroll repaint */
body.theme-transitioning,
body.theme-transitioning * {
    transition: background-color 0.3s ease, color 0.3s ease !important;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}


/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .navbar {
    background: rgba(18, 18, 18, 0.95);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--text-color);
}

[data-theme="dark"] .nav-link {
    color: var(--text-light);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--dark-bg) 100%);
    color: var(--text-light);
    padding: 150px 0 100px;
    position: relative;
    overflow-x: hidden;
    min-height: auto;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.9;
    color: #e0e0e0;
}

.btn-primary-custom {
    background-color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 12px 30px;
    font-weight: 600;
    transition: transform 0.2s ease;
    color: white;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(228, 63, 90, 0.4);
    background-color: #d02e48;
    border-color: #d02e48;
}

/* Outline button — hero alanındaki ikinci butonun tutarlılığı için */
.btn-outline-custom {
    border: 2px solid white;
    padding: 12px 30px;
    font-weight: 600;
    color: white;
    background: transparent;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-outline-custom:hover {
    background-color: white;
    color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

/* Section Styling */
section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-weight: 700;
    color: var(--secondary-color);
    position: relative;
    display: inline-block;
}

[data-theme="dark"] .section-title h2 {
    color: var(--text-light);
}

.section-title h2::after {
    content: '';
    display: block;
    width: 50%;
    height: 3px;
    background: var(--accent-color);
    margin: 10px auto 0;
}

/* About Section */
#about {
    background-color: var(--section-bg);
}

/* Services / Skills */
.skill-card {
    border: none;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: transform 0.2s ease;
    background: var(--card-bg);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    height: 100%;
    color: var(--text-color);
}

[data-theme="dark"] .skill-card {
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.05);
}

.skill-card h4 {
    color: var(--text-color);
}

.skill-card p {
    color: var(--text-color);
    opacity: 0.8;
}

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

.skill-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.bg-white {
    background-color: var(--card-bg) !important;
}

/* Portfolio */
#portfolio {
    background-color: var(--section-bg) !important;
}

.portfolio-item {
    margin-bottom: 30px;
}

.portfolio-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
    background-color: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] .portfolio-card {
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.05);
}

.portfolio-card .card-text {
    color: var(--text-color);
    opacity: 0.8;
}

.portfolio-card .card-title {
    color: var(--text-color);
}

.portfolio-card:hover {
    transform: translateY(-5px);
}

.portfolio-img {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

/* Contact */
#contact {
    background-color: var(--secondary-color);
    color: var(--text-light);
}

#contact .section-title h2 {
    color: white;
}

.contact-form .form-control {
    padding: 12px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white !important;
}

.contact-form .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    border-color: var(--primary-color);
    color: white;
}

.contact-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
    opacity: 1;
}

/* Footer */
footer {
    padding: 30px 0;
    background: #101a33;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

[data-theme="dark"] footer {
    background: #050912;
}

/* Detail Page specific fixes */
[data-theme="dark"] .list-group-item {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .text-muted {
    color: #a0a0a0 !important;
}

/* ===== LOADING ANIMATION ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--dark-bg) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(228, 63, 90, 0.3);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: #d02e48;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(228, 63, 90, 0.4);
}

/* ===== LANGUAGE TOGGLE ===== */
.lang-toggle {
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

/* Dark Mode Button - Force Round */
#theme-toggle {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50% !important;
}

/* Spacing between dark mode and language buttons */
.nav-item.d-flex {
    gap: 12px !important;
}

[data-theme="dark"] .lang-toggle {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-light);
}

/* ===== PREMIUM UI TOUCHES ===== */

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Text Selection */
::selection {
    background: var(--accent-color);
    color: white;
}

/* Hero name — single color (no gradient) */
.hero-name {
    color: var(--text-light);
    display: inline-block;
}

/* Button Glow Effect */
.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(228, 63, 90, 0.6);
    background-color: #d02e48;
}

/* Card Hover Premium Effect */
.portfolio-card:hover,
.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .portfolio-card:hover,
[data-theme="dark"] .skill-card:hover {
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.08);
}

/* ===== MOBILE & RESPONSIVE IMPROVEMENTS ===== */

/* Mobile Typography */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p.lead {
        font-size: 1.1rem;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    /* Hero Section Mobile */
    .hero {
        padding: 120px 0 60px;
        text-align: center;
    }

    .hero img {
        margin-top: 30px;
        max-width: 70%;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    /* Mobile Buttons: Always side-by-side and equal width */
    .hero .d-flex-mobile {
        display: flex;
        justify-content: center;
        width: 100%;
        gap: 10px;
        padding: 0 10px;
    }

    .hero .btn {
        flex: 1;
        width: auto;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        padding: 12px 5px;
        margin: 0 !important;
        /* Reset margins as we use gap */
        white-space: nowrap;
        font-size: 0.95rem;
    }

    /* Remove old button margins since we use gap now */
    .hero .btn:last-child {
        margin-bottom: 0;
    }

    /* Fix Skills Card Gap on Mobile */
    .skill-card {
        margin-bottom: 15px;
    }

    #skills .col-md-4 {
        margin-bottom: 0;
        padding-bottom: 0;
    }

    #skills .row {
        gap: 0;
    }

    /* Fix About Section List Gap on Mobile */
    #about .col-md-6 {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    #about .col-md-6 ul {
        margin-bottom: 0 !important;
    }

    #about .row.mt-4 {
        gap: 0;
    }

    /* Cards on Mobile */
    .portfolio-card {
        margin-bottom: 20px;
    }

    /* Contact Form */
    .contact-form {
        padding: 0 10px;
    }

    /* Portfolio Items */
    .portfolio-item {
        margin-bottom: 20px;
    }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 576px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p.lead {
        font-size: 1rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .skill-card,
    .portfolio-card {
        padding: 20px;
    }

    .hero img {
        max-width: 90%;
    }
}

/* iPhone 11 / iPhone XR (414px width) */
@media (min-width: 400px) and (max-width: 430px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero img {
        max-width: 80%;
    }

    /* iPhone 11 specific skill card fix */
    .skill-card {
        margin-bottom: 12px;
        padding: 25px 20px;
    }

    #skills .col-md-4 {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Tablet Portrait (768px - 991px) - Hero Layout Fix */
@media (min-width: 768px) and (max-width: 991px) {
    .hero {
        padding-top: 100px;
        text-align: center;
    }

    .hero .row {
        flex-direction: column;
    }

    .hero .col-lg-6 {
        width: 100%;
        max-width: 100%;
    }

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

    .hero img {
        max-width: 60%;
        margin: 30px auto 0;
    }

    .hero .d-flex-mobile {
        display: flex;
        justify-content: center;
        gap: 15px;
    }

    /* Skill cards 2 columns on tablet */
    #skills .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Ensure Navbar is always visible on mobile/tablet */
@media (max-width: 991px) {
    .navbar {
        background: rgba(255, 255, 255, 0.98) !important;
    }

    [data-theme="dark"] .navbar {
        background: rgba(18, 18, 18, 0.98) !important;
    }

    /* HAMBURGER ICON - Always Visible 3 Bars */
    .navbar-toggler {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        padding: 10px;
        border: none !important;
        background: transparent !important;
        z-index: 1001;
        gap: 5px;
    }

    .navbar-toggler:focus {
        box-shadow: none !important;
        outline: none !important;
    }

    /* Hide Bootstrap's default background-image icon */
    .navbar-toggler-icon {
        background-image: none !important;
        width: 24px;
        height: 3px;
        background-color: var(--text-color) !important;
        border-radius: 2px;
        position: relative;
        display: block !important;
        transition: all 0.3s ease;
    }

    .navbar-toggler-icon::before,
    .navbar-toggler-icon::after {
        content: '';
        position: absolute;
        width: 24px;
        height: 3px;
        background-color: var(--text-color) !important;
        border-radius: 2px;
        left: 0;
        transition: all 0.3s ease;
    }

    .navbar-toggler-icon::before {
        top: -8px;
    }

    .navbar-toggler-icon::after {
        top: 8px;
    }

    /* Dark mode hamburger */
    [data-theme="dark"] .navbar-toggler-icon,
    [data-theme="dark"] .navbar-toggler-icon::before,
    [data-theme="dark"] .navbar-toggler-icon::after {
        background-color: var(--text-light) !important;
    }

    /* Toggle State - X icon */
    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
        background-color: transparent !important;
    }

    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
        transform: rotate(45deg);
        top: 0;
    }

    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
        transform: rotate(-45deg);
        top: 0;
    }
}

.hero img {
    max-width: 80%;
}

/* ===== FULLSCREEN MOBILE MENU OVERLAY ===== */
@media (max-width: 991px) {
    .navbar-collapse {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        z-index: 999;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transition: visibility 0s 0.25s, opacity 0.25s ease;
        /* Delay visibility hide */
    }

    [data-theme="dark"] .navbar-collapse {
        background: rgba(18, 18, 18, 0.98);
    }

    .navbar-collapse.show {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.25s ease;
        /* Instant visibility show */
    }

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

    .nav-item {
        margin: 15px 0;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
        /* Faster item slide */
    }

    /* Staggered animation for links (Faster) */
    .navbar-collapse.show .nav-item:nth-child(1) {
        transition-delay: 0.05s;
        opacity: 1;
        transform: translateY(0);
    }

    .navbar-collapse.show .nav-item:nth-child(2) {
        transition-delay: 0.1s;
        opacity: 1;
        transform: translateY(0);
    }

    .navbar-collapse.show .nav-item:nth-child(3) {
        transition-delay: 0.15s;
        opacity: 1;
        transform: translateY(0);
    }

    .navbar-collapse.show .nav-item:nth-child(4) {
        transition-delay: 0.2s;
        opacity: 1;
        transform: translateY(0);
    }

    .navbar-collapse.show .nav-item:nth-child(5) {
        transition-delay: 0.25s;
        opacity: 1;
        transform: translateY(0);
    }

    .navbar-collapse.show .nav-item:nth-child(6) {
        transition-delay: 0.3s;
        opacity: 1;
        transform: translateY(0);
    }

    /* Mobile Button Group Styling */
    .navbar-collapse.show .nav-item.d-flex {
        justify-content: center;
    }

    .nav-link {
        font-size: 1.5rem;
        font-weight: 700;
    }

    /* Hamburger Button Animation */
    .navbar-toggler {
        z-index: 1000;
        border: none;
        outline: none;
        box-shadow: none !important;
        padding: 8px;
        width: 44px;
        height: 44px;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
img {
    content-visibility: auto;
    contain-intrinsic-size: auto 200px;
}