/* Portfolio Page Styles */

/* 3D Canvas */
#portfolio-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Portfolio Hero Section */
.portfolio-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    margin-top: 5rem;
}

.portfolio-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.title-word {
    display: inline-block;
    padding: 0 0.5rem;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.title-word:nth-child(1) {
    animation-delay: 0.1s;
}

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

.title-word:nth-child(3) {
    animation-delay: 0.3s;
}

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

.portfolio-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

/* Portfolio Scene */
.portfolio-scene {
    min-height: 100vh;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.scene-info {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
}

.scene-info h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scene-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

#projects-container {
    width: 100%;
    max-width: 1200px;
    height: 600px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
}

/* 3D Project Cards */
.project-card {
    position: absolute;
    width: 200px;
    height: 250px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(10px);
}

.project-card:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
}

.project-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    flex-grow: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.3s ease-out;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

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

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%;
}

@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .carousel-container {
        height: 300px;
    }

    .modal-content {
        max-width: 95vw;
        margin: 0 auto;
    }
}

.modal-image {
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-text {
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modal-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modal-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modal-description {
    font-weight: 500;
}

.modal-tags {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.tag-primary {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.tag-secondary {
    background: rgba(139, 92, 246, 0.2);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 10px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.modal-details-text {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.modal-technologies {
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.modal-technologies h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-badge {
    background: rgba(139, 92, 246, 0.2);
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Portfolio Grid */
.portfolio-grid {
    padding: 4rem 2rem;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.02) 0%, transparent 100%);
}

.grid-projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.grid-project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.grid-project-card:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.grid-project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

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

.grid-project-card:hover .grid-project-image img {
    transform: scale(1.05);
}

.portfolio-icon-large {
    font-size: 3rem;
}

.grid-project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.grid-project-card:hover .grid-project-image::after {
    transform: translateX(100%);
}

.grid-project-info {
    padding: 1.5rem;
}

.grid-project-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-category {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.grid-project-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.grid-project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Portfolio Stats */
.portfolio-stats {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-desc {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Portfolio CTA */
.portfolio-cta {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    text-align: center;
    color: white;
}

.portfolio-cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.portfolio-cta p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* Portfolio Preview on Homepage */
.portfolio-preview {
    padding: 4rem 2rem;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.05) 0%, transparent 100%);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.portfolio-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.portfolio-card:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.portfolio-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.portfolio-info {
    padding: 1.5rem;
}

.portfolio-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.portfolio-category {
    color: var(--secondary-color);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.portfolio-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.portfolio-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.portfolio-cta {
    text-align: center;
    margin-top: 3rem;
}

/* Carousel Styles */
.modal-image-carousel {
    width: 100%;
    position: relative;
    margin-bottom: 1rem;
    box-sizing: border-box;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-sizing: border-box;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.carousel-container:active {
    cursor: grabbing;
}

.carousel-images {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
    width: 100%;
}

.carousel-images img {
    min-width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

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

.carousel-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.carousel-arrow.hidden {
    display: none;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: #6366f1;
    transform: scale(1.3);
}

.carousel-counter {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    color: #64748b;
}

.modal-website-link {
    margin: 15px 0;
}

.modal-website-link .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.image-count-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
    .portfolio-title {
        font-size: 3rem;
    }

    .scene-info h2 {
        font-size: 2rem;
    }

    #projects-container {
        height: 500px;
    }

    .project-card {
        width: 180px;
        height: 220px;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .modal {
        padding: 1rem;
    }

    .modal-content {
        max-width: 95vw;
        width: 95vw;
        max-height: 95vh;
        border-radius: 15px;
    }

    .portfolio-hero {
        padding: 1rem;
        min-height: 80vh;
    }

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

    .portfolio-subtitle {
        font-size: 1rem;
    }

    .scene-info {
        margin-bottom: 2rem;
    }

    #projects-container {
        height: 400px;
    }

    .modal-body {
        padding: 1.5rem;
        gap: 1rem;
    }

    .modal-image-carousel {
        margin-bottom: 1rem;
    }

    .carousel-container {
        height: 250px;
    }

    .modal-text h2 {
        font-size: 1.5rem;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .grid-projects {
        grid-template-columns: 1fr;
    }

    .portfolio-cta h2 {
        font-size: 1.8rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}
