/* Color Scheme - Matching consulting.muftiev.com */
:root {
    --primary-color: #667eea;
    --secondary-color: #6c757d;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
    --transition-speed: 0.3s;
    --text-dark: #212529;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --bg-dark: #212529;
    --bg-white: #ffffff;
    --gold: #ffc107;
    --white: #ffffff;
    --border-color: #dee2e6;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --text-dark: #e9ecef;
    --text-light: #adb5bd;
    --bg-light: #1a1d20;
    --bg-white: #121416;
    --bg-dark: #0d0f11;
    --border-color: #2d3238;
    --dark-color: #e9ecef;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-white);
    padding-top: 76px; /* Account for fixed navbar */
    scroll-behavior: smooth;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Navigation */
.navbar {
    background-color: rgba(33, 37, 41, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed) ease;
    padding: 1rem 0;
}

.navbar-brand {
    color: var(--white) !important;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--white) !important;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    position: relative;
    overflow: hidden;
    padding-top: 76px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: var(--white);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1.1s ease;
}

.hero-section h1 {
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
    animation: fadeInUp 0.8s ease;
}

.hero-section .lead {
    color: var(--white);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-size: 1.5rem;
    animation: fadeInUp 1s ease;
}

/* Dark mode text color adjustments */
[data-theme="dark"] .text-muted {
    color: var(--text-light) !important;
}

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

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 1.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gradient-end) 0%, var(--gradient-start) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-outline-primary {
    color: var(--white);
    border-color: var(--white);
    border-width: 2px;
    padding: 12px 30px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all var(--transition-speed) ease;
    background-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 1.2s ease;
}

.btn-outline-primary:hover {
    background-color: var(--white);
    color: var(--gradient-start);
    border-color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-outline-primary.active {
    background-color: var(--white);
    border-color: var(--white);
    color: var(--gradient-start);
}

/* Career Section Toggle Buttons */
#careerSection .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
}

#careerSection .btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

#careerSection .btn-outline-primary.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Studies Section Load More Button */
#studiesSection .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
}

#studiesSection .btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Container */
.mxw-1400 {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Career Section */
#careerSection {
    background-color: var(--bg-white);
    transition: background-color var(--transition-speed) ease;
}

.career-container {
    margin-top: 2rem;
}

.career-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

[data-theme="dark"] .career-item {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.career-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.career-item.expanded {
    padding: 2rem;
}

.career-item-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.career-item-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-light);
    padding: 8px;
    flex-shrink: 0;
}

.career-item-info {
    flex: 1;
}

.career-item-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.career-item-company {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
}

.career-item-location {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: none;
}

.career-item.expanded .career-item-location {
    display: block;
}

.career-item-time {
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
}

.career-item-description {
    margin-bottom: 0;
}

.career-item-short {
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.career-item-full {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.8;
    display: none;
}

.career-item.expanded .career-item-full {
    display: block;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.career-item-tags {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.project-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 1rem;
}

.status-ongoing {
    background: #d4edda;
    color: #155724;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-delegated {
    background: #fff3cd;
    color: #856404;
}

.status-closed {
    background: #f8d7da;
    color: #721c24;
}

/* Publications Section */
#publicationsSection {
    background-image: url('https://muftiev.com/images/pub.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    position: relative;
}

#publicationsSection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%),
                rgba(255, 255, 255, 0.7);
    z-index: 0;
    transition: background var(--transition-speed) ease;
}

[data-theme="dark"] #publicationsSection::before {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%),
                rgba(18, 20, 22, 0.85);
}

#publicationsSection .container,
#publicationsSection .mxw-1400 {
    position: relative;
    z-index: 1;
}

#publicationsSection .list-group-item h5 {
    color: var(--text-dark);
    font-weight: 600;
}

[data-theme="dark"] #publicationsSection .list-group-item .text-muted {
    color: var(--text-light) !important;
}

/* Studies Section */
#studiesSection {
    background-color: var(--bg-white);
    transition: background-color var(--transition-speed) ease;
}

.study-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

[data-theme="dark"] .study-item {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.study-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.study-item.expanded {
    padding: 2rem;
}

.study-item-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.study-item-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-light);
    padding: 8px;
    flex-shrink: 0;
}

.study-item-info {
    flex: 1;
}

.study-item-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.study-item-type {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.study-item-university {
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.study-item-location {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.study-item-thesis {
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 0.5rem;
    display: none;
}

.study-item.expanded .study-item-thesis {
    display: block;
}

.study-item-grade {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: none;
}

.study-item.expanded .study-item-grade {
    display: block;
}

.study-item-time {
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
}

.study-item-tags {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.study-item.expanded .study-item-tags {
    display: block;
}

/* Certifications Section */
#certificationsSection {
    background-color: var(--bg-light);
}

.cert-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
}

[data-theme="dark"] .cert-card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cert-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

/* Skills Section */
#skillsSection {
    background-image: url('https://muftiev.com/images/cer.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    position: relative;
}

#skillsSection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%),
                rgba(255, 255, 255, 0.7);
    z-index: 0;
    transition: background var(--transition-speed) ease;
}

[data-theme="dark"] #skillsSection::before {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%),
                rgba(18, 20, 22, 0.85);
}

#skillsSection .container,
#skillsSection .mxw-1400 {
    position: relative;
    z-index: 1;
}

.list-group-item.no-border {
    border: none;
    padding: 0.75rem 0;
    background: transparent;
    color: var(--text-dark);
}

[data-theme="dark"] .list-group-item.no-border {
    color: var(--white);
}

.gold {
    color: var(--gold);
}

/* CV Download Section */
#cv-download {
    background-image: url('https://muftiev.com/images/res.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    position: relative;
}

#cv-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%),
                rgba(255, 255, 255, 0.7);
    z-index: 0;
    transition: background var(--transition-speed) ease;
}

[data-theme="dark"] #cv-download::before {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%),
                rgba(18, 20, 22, 0.85);
}

#cv-download .container,
#cv-download .mxw-1400 {
    position: relative;
    z-index: 1;
}

/* Dark Mode Toggle Button */
.theme-toggle {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-size: 1.1rem;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

[data-theme="dark"] .theme-toggle {
    border-color: var(--white);
    color: var(--white);
}

/* Footer */
footer {
    background-color: var(--bg-dark) !important;
    transition: background-color var(--transition-speed) ease;
}

footer .social-link {
    text-decoration: none;
    transition: color var(--transition-speed) ease;
    display: inline-block;
}

footer .social-link:hover {
    color: var(--gradient-start) !important;
    transform: scale(1.1);
    text-decoration: none;
}

/* Footer text-primary override */
footer .text-primary {
    color: var(--gradient-start) !important;
}

[data-theme="dark"] footer .text-primary {
    color: var(--gradient-start) !important;
}

/* Responsive Design */
@media (max-width: 992px) {
    .study-item {
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .profile-image {
        width: 150px;
        height: 150px;
    }

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

    .hero-section .lead {
        font-size: 1.2rem;
    }

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

    .career-item-header,
    .study-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .career-item-image,
    .study-item-image {
        width: 50px;
        height: 50px;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .d-flex.gap-3 {
        flex-direction: column;
        align-items: center;
    }

    .d-flex.gap-3 .btn {
        width: 100%;
        max-width: 300px;
    }

    .career-item,
    .study-item {
        padding: 1.5rem;
    }

    .cert-card {
        padding: 1rem;
        font-size: 0.9rem;
    }

    #skillsSection .col-sm-4 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }

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

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

    .career-item-title,
    .study-item-name {
        font-size: 1.25rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 76px;
}

/* Section Spacing */
section {
    scroll-margin-top: 76px;
}

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

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.career-item,
.study-item {
    animation: fadeIn 0.5s ease-out;
}

