@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #0f172a;
    color: #e2e8f0;
    overflow-x: hidden;
}

/* Utility Classes */
.gradient-text {
    background: linear-gradient(90deg, #0ea5e9, #cb00fe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.2);
}

/* Navigation */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, #0ea5e9, #7e22ce);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Hero Section */
#home {
    background: linear-gradient(135deg, #1d33b1 0%, #175e7c 30%, #3d6ddc 70%, #5b4f65 100%);
}

/* Timeline */
.timeline-item::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    background: linear-gradient(135deg, #0ea5e9, #7e22ce);
}

@media (max-width: 768px) {
    .timeline-item::before {
        display: none;
    }
}

/* Skills */
.skill-bar {
    height: 8px;
    border-radius: 4px;
    background-color: #1e293b;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #0ea5e9, #7e22ce);
    transition: width 1s ease-in-out;
}

/* Contact Form */
#contact {
    padding-top: 80px !important;
}

.contact-input {
    background-color: #1e293b;
    border: 1px solid #334155;
    transition: all 0.3s ease;
    color: #e2e8f0;
}

.contact-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(90deg, #0ea5e9, #7e22ce);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(14, 165, 233, 0.3);
}

.social-icon {
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
}

/* Scroll Effects */
.scroll-effect {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.scroll-effect.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================
   3D COMPUTER MODEL
======================== */
.computer-3d {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: auto;
}

.computer-3d model-viewer {
    width: 100% !important;
    max-width: 500px !important;
    height: 450px !important;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .computer-3d model-viewer {
        height: 350px !important;
        max-width: 400px !important;
    }
}

@media (max-width: 480px) {
    .computer-3d model-viewer {
        height: 300px !important;
        max-width: 320px !important;
    }
}

/* ========================
   INTERACTIVE CARDS
======================== */
.card-container {
    padding: 40px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.card-wrap {
    margin: 10px;
    perspective: 800px;
    transform-style: preserve-3d;
    cursor: pointer;
}

.card {
    position: relative;
    width: 240px;
    height: 320px;
    background-color: #333;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: rgba(0,0,0,0.66) 0 30px 60px 0, inset #333 0 0 0 5px, inset rgba(255,255,255,0.5) 0 0 0 6px;
    transition: box-shadow 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.card-bg {
    opacity: 0.5;
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100%;
    height: 100%;
    padding: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    transition: 1s cubic-bezier(0.445, 0.05, 0.55, 0.95), opacity 5s 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
    pointer-events: none;
}

.card-info {
    padding: 20px;
    position: absolute;
    bottom: 0;
    color: #fff;
    transform: translateY(40%);
    transition: 0.6s 1.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.card-info h1 {
    font-family: "Playfair Display", serif;
    font-size: 28px;
    font-weight: 700;
    text-shadow: rgba(0,0,0,0.5) 0 10px 10px;
    margin-bottom: 10px;
}

.card-info p {
    opacity: 0;
    text-shadow: rgba(0,0,0,1) 0 2px 3px;
    transition: 0.6s 1.6s cubic-bezier(0.215, 0.61, 0.355, 1);
    font-size: 14px;
}

.card-wrap:hover .card-info {
    transform: translateY(0);
    transition: 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-wrap:hover .card-info p {
    opacity: 1;
    transition: 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-wrap:hover .card-bg {
    opacity: 0.8;
    transition: 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 5s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-wrap:hover .card {
    box-shadow: rgba(255,255,255,0.2) 0 0 40px 5px, rgba(255,255,255,1) 0 0 0 1px, rgba(0,0,0,0.66) 0 30px 60px 0, inset #333 0 0 0 5px, inset #fff 0 0 0 6px;
    transition: 0.6s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 2s cubic-bezier(0.23, 1, 0.32, 1);
}

@media (max-width: 768px) {
    .card {
        width: 200px;
        height: 280px;
    }
    
    .card-info h1 {
        font-size: 24px;
    }
    
    .card-info p {
        font-size: 12px;
    }
}

/* ========================
   PORTFOLIO CERTIFICATES - CENTERED
======================== */
.portfolio-cards-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 80px 20px;
    color: white;
}

.portfolio-cards-header {
    text-align: center;
    margin-bottom: 60px;
    max-width: 800px;
    padding: 0 20px;
}

.portfolio-cards-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(90deg, #ff8a00, #e52e71);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (max-width: 768px) {
    .portfolio-cards-header h1 {
        font-size: 2rem;
    }
}

.portfolio-cards-header p {
    color: #a0a0a0;
    font-size: 1rem;
    line-height: 1.6;
}

.portfolio-cards-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    padding: 20px;
    width: 100%;
    max-width: 1400px;
}

.portfolio-card {
    display: flex;
    flex-direction: column;
    height: 320px;
    width: 300px;
    min-width: 300px;
    background: linear-gradient(145deg, #1c1c2e, #17141d);
    border-radius: 16px;
    box-shadow: -1rem 0 3rem rgba(0, 0, 0, 0.7);
    transition: 0.4s ease-out;
    position: relative;
    left: 0px;
    color: white;
    padding: 25px;
    overflow: hidden;
}

.portfolio-card:not(:first-child) {
    margin-left: -50px;
}

.portfolio-card:hover {
    transform: translateY(-20px) rotate(2deg);
    transition: 0.4s ease-out;
    z-index: 2;
    box-shadow: -1rem 0 4rem rgba(0, 0, 0, 0.9);
}

.portfolio-card:hover ~ .portfolio-card {
    position: relative;
    left: 70px;
    transition: 0.4s ease-out;
}

.portfolio-card-title {
    color: white;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.2rem;
    position: relative;
    display: inline-block;
    line-height: 1.3;
}

.portfolio-card-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    border-radius: 2px;
}

.portfolio-card-content {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #d0d0d0;
    line-height: 1.6;
    flex-grow: 1;
}

.portfolio-card-footer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.portfolio-card-button {
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 0.85rem;
}

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

.portfolio-card-icons {
    display: flex;
    gap: 12px;
}

.portfolio-card-icons i {
    font-size: 1.1rem;
    color: #a0a0a0;
    transition: color 0.3s ease;
    cursor: pointer;
}

.portfolio-card-icons i:hover {
    color: #ff8a00;
}

/* Certificate card styles */
.portfolio-card-1 .portfolio-card-title::after {
    background: linear-gradient(90deg, #ff8a00, #e52e71);
}

.portfolio-card-1 .portfolio-card-button {
    background: linear-gradient(90deg, #ff8a00, #e52e71);
    box-shadow: 0 4px 10px rgba(255, 138, 0, 0.4);
    color: white;
}

.portfolio-card-2 .portfolio-card-title::after {
    background: linear-gradient(90deg, #00c9ff, #92fe9d);
}

.portfolio-card-2 .portfolio-card-button {
    background: linear-gradient(90deg, #00c9ff, #92fe9d);
    box-shadow: 0 4px 10px rgba(0, 201, 255, 0.4);
    color: white;
}

.portfolio-card-3 .portfolio-card-title::after {
    background: linear-gradient(90deg, #fdfc47, #24fe41);
}

.portfolio-card-3 .portfolio-card-button {
    background: linear-gradient(90deg, #fdfc47, #24fe41);
    box-shadow: 0 4px 10px rgba(253, 252, 71, 0.4);
    color: #222;
}

.portfolio-card-4 .portfolio-card-title::after {
    background: linear-gradient(90deg, #a6c0fe, #f68084);
}

.portfolio-card-4 .portfolio-card-button {
    background: linear-gradient(90deg, #a6c0fe, #f68084);
    box-shadow: 0 4px 10px rgba(166, 192, 254, 0.4);
    color: #222;
}

.portfolio-card-5 .portfolio-card-title::after {
    background: linear-gradient(90deg, #ff8a00, #e52e71);
}

.portfolio-card-5 .portfolio-card-button {
    background: linear-gradient(90deg, #ff8a00, #e52e71);
    box-shadow: 0 4px 10px rgba(255, 138, 0, 0.4);
    color: white;
}

/* Mobile responsive for portfolio cards */
@media (max-width: 768px) {
    .portfolio-cards-container {
        flex-direction: column;
        align-items: center;
        padding: 20px 10px;
    }
    
    .portfolio-card {
        width: 100%;
        max-width: 320px;
        margin-left: 0 !important;
        margin-bottom: 20px;
    }
    
    .portfolio-card:hover ~ .portfolio-card {
        left: 0;
        transition: 0.4s ease-out;
    }
}

/* ========================
   PROJECTS SECTION - FIXED
======================== */

/* Container for the 3D carousel - properly contained with full visibility */
.projects-banner-container {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: visible;
    margin-bottom: 120px;
    padding-bottom: 150px;
}

.projects-banner {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.projects-banner .slider {
    position: absolute;
    width: 200px;
    height: 260px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) perspective(1000px);
    transform-style: preserve-3d;
    animation: autoRun 20s linear infinite;
    z-index: 1;
}

.projects-banner .slider.paused {
    animation-play-state: paused;
}

.projects-banner .slider .item {
    will-change: transform;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    position: absolute;
    inset: 0;
    transform: rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)) translateZ(450px);
}

.projects-banner .slider .item.glowing {
    box-shadow: 0 10px 40px rgba(14,165,233,0.18), 0 0 80px rgba(14,165,233,0.12);
    border: 3px solid rgba(14,165,233,0.85);
    border-radius: 10px;
}

@keyframes autoRun {
    from {
        transform: translate(-50%, -50%) perspective(1000px) rotateX(-16deg) rotateY(0deg);
    }
    to {
        transform: translate(-50%, -50%) perspective(1000px) rotateX(-16deg) rotateY(360deg);
    }
}

.projects-banner .slider .item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-backfaceVisibility: hidden;
    backfaceVisibility: hidden;
    image-rendering: auto;
}

/* Carousel responsive */
@media screen and (max-width: 1023px) {
    .projects-banner-container {
        height: 500px;
        padding-bottom: 120px;
        margin-bottom: 100px;
    }
    
    .projects-banner .slider {
        width: 160px;
        height: 220px;
    }
    
    .projects-banner .slider .item {
        transform: rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)) translateZ(350px);
    }
}

@media screen and (max-width: 767px) {
    .projects-banner-container {
        height: 450px;
        padding-bottom: 100px;
        margin-bottom: 80px;
    }
    
    .projects-banner .slider {
        width: 120px;
        height: 180px;
    }
    
    .projects-banner .slider .item {
        transform: rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)) translateZ(220px);
    }
}

@media screen and (max-width: 480px) {
    .projects-banner-container {
        height: 400px;
        padding-bottom: 80px;
        margin-bottom: 60px;
    }
    
    .projects-banner .slider {
        width: 90px;
        height: 140px;
    }
    
    .projects-banner .slider .item {
        transform: rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)) translateZ(160px);
    }
}

/* ========================
   RESPONSIVE UTILITIES
======================== */

/* Container max-width */
.container {
    max-width: 1200px;
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Hide scrollbar for certain elements */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Print styles */
@media print {
    nav, footer, #back-to-top {
        display: none;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}