:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}

.navbar {
    transition: all 0.3s ease;
    padding: 1rem 0;
}

.navbar .navbar-brand {
    color: white !important;
    transition: color 0.3s ease;
}

.navbar .nav-link {
    color: white !important;
    transition: color 0.3s ease;
}

.navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar .navbar-toggler-icon {
    filter: invert(1);
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
}

.navbar.scrolled .navbar-brand {
    color: var(--dark-color) !important;
}

.navbar.scrolled .nav-link {
    color: var(--dark-color) !important;
}

.navbar.scrolled .navbar-toggler {
    border-color: rgba(0, 0, 0, 0.3);
}

.navbar.scrolled .navbar-toggler-icon {
    filter: none;
}

.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="white" opacity="0.1"/><circle cx="80" cy="40" r="1" fill="white" opacity="0.1"/><circle cx="40" cy="80" r="1.5" fill="white" opacity="0.1"/></svg>');
    animation: float 20s ease-in-out infinite;
}

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

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.3s both;
}

.btn-custom {
    padding: 12px 30px;
    border-radius: 50px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.6s both;
}

.btn-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.section-padding {
    padding: 80px 0;
}

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

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

.card {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.skill-item {
    background: var(--light-color);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.skill-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 30px rgba(0, 123, 255, 0.1);
}

.skill-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.progress-bar {
    transition: width 2s ease-in-out;
}

.contact-form {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 2rem;
}

.social-links a {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    margin: 0 10px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-5px);
    background: #0056b3;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    height: 100%;
}

.portfolio-item .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.portfolio-item .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.9), rgba(0, 86, 179, 0.9));
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay:hover {
    color: white;
    text-decoration: none;
}

/* Modern Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-fade-in {
    opacity: 1;
}

.lightbox-fade-out {
    opacity: 0;
}

.lightbox-content {
    background: white;
    border-radius: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.lightbox-fade-in .lightbox-content {
    transform: scale(1);
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 15px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.lightbox-header h3 {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: #e9ecef;
    color: var(--dark-color);
    transform: rotate(90deg);
}

.gallery-container {
    padding: 0 30px 30px;
    overflow-y: auto;
    flex-grow: 1;
}

.gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 25px 0;
    padding: 10px 0;
}

.gallery-image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    aspect-ratio: 16/10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
}

.image-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Gallery Image Expansion Styles */
.gallery-image-container.expanded {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10001 !important;
    background: rgba(0, 0, 0, 0.95) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    animation: expandContainer 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    overflow: hidden !important;
}

.gallery-image-container.expanded .gallery-image {
    max-width: 90vw !important;
    max-height: 80vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    cursor: default !important;
    display: block !important;
    margin: 0 auto !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Info positioned below image */
.image-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    pointer-events: none;
    opacity: 1;
    z-index: 10;
}

.gallery-image-container.expanded .image-counter {
    display: none;
}

.image-nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.image-nav-overlay .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 1.4rem;
    cursor: pointer;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: slideInBtn 0.5s ease forwards;
}

.image-nav-overlay .nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
}

.image-nav-overlay .prev-btn {
    left: 30px;
    animation-delay: 0.1s;
}

.image-nav-overlay .next-btn {
    right: 30px;
    animation-delay: 0.2s;
}

.close-expanded-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 1.2rem;
    cursor: pointer;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: slideInBtn 0.5s ease forwards;
    animation-delay: 0.3s;
}

.image-info.info-loaded {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    animation: infoSlideIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.image-info span {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.image-info p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.image-info span {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.image-info p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

@keyframes expandContainer {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInBtn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Image Viewer Styles */
.image-viewer {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    opacity: 0;
    transition: opacity 0.3s ease;
    justify-content: center;
    align-items: center;
}

.viewer-fade-in {
    opacity: 1;
}

.viewer-fade-out {
    opacity: 0;
}

.viewer-content {
    width: 95vw;
    height: 95vh;
    max-width: 1200px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.viewer-info h4 {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.3rem;
}

.viewer-info span {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.viewer-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.viewer-close:hover {
    background-color: #e9ecef;
    color: var(--dark-color);
    transform: rotate(90deg);
}

.viewer-main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    position: relative;
    background: #000;
}

.viewer-image-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 100%;
}

.viewer-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--dark-color);
    transition: all 0.3s ease;
    z-index: 10;
}

.viewer-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.viewer-prev {
    left: 20px;
}

.viewer-next {
    right: 20px;
}

.viewer-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.viewer-footer p {
    margin: 0 0 15px 0;
    color: var(--dark-color);
    font-weight: 500;
    text-align: center;
}

.viewer-thumbnails {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    max-height: 80px;
    overflow-y: auto;
}

.thumbnail {
    width: 60px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.thumbnail:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.gallery-footer .btn {
    padding: 12px 24px;
    font-weight: 500;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.gallery-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

.error-message {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ffc107;
}

.error-message p {
    margin: 0;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 20px;
    }
    
    .lightbox-header {
        padding: 20px;
    }
    
    .gallery-container {
        padding: 0 20px 20px;
    }
    
    .gallery-images {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }
    
    .lightbox-header h3 {
        font-size: 1.25rem;
    }
    
    /* Image Viewer Responsive */
    .viewer-content {
        width: 98vw;
        height: 98vh;
        border-radius: 10px;
    }
    
    .viewer-header {
        padding: 15px 20px;
    }
    
    .viewer-header h4 {
        font-size: 1.1rem;
    }
    
    .viewer-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .viewer-prev {
        left: 10px;
    }
    
    .viewer-next {
        right: 10px;
    }
    
    .viewer-footer {
        padding: 15px 20px;
    }
    
    .viewer-thumbnails {
        gap: 8px;
    }
    
    .thumbnail {
        width: 50px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .lightbox-content {
        border-radius: 15px;
    }
    
    .lightbox-header {
        padding: 15px;
    }
    
    .gallery-container {
        padding: 0 15px 15px;
    }
    
    /* Image Viewer Mobile */
    .viewer-content {
        border-radius: 8px;
    }
    
    .viewer-nav {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .viewer-prev {
        left: 5px;
    }
    
    .viewer-next {
        right: 5px;
    }
    
    .viewer-footer p {
        font-size: 0.9rem;
    }
    
    .thumbnail {
        width: 45px;
        height: 30px;
    }
}

/* Additional responsive styles */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .skill-item {
        padding: 1.5rem;
    }
    
    .contact-form {
        padding: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-padding {
        padding: 60px 0;
    }
    
    .btn-custom {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Loading animation */
.loading {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Form focus styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
