/* ===== PROJECTS PAGE STYLES ===== */

.projects-section {
    min-height: 100vh;
    padding: 7rem 2rem 0;
}

.projects-container {
    max-width: 1400px;
    margin: 0 auto;
}

.page-title {
    text-align: center;
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 4rem;
    margin-top: 1rem;
    font-weight: 600;
    opacity: 0;
    animation: fadeInDown 0.8s ease forwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PROJECTS GRID ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
    gap: 3rem;
    perspective: 1000px;
    row-gap: 3.5rem;
    justify-content: center;
    margin-bottom: 0;
}

/* ===== PROJECT CARD ===== */
.project-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.25rem;
    padding-bottom: 1.75rem;
    margin-bottom: 1.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
    overflow: visible;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

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

body.dark-mode .project-card {
    background: rgba(255, 255, 255, 0.02);
}

/* ===== ANIMATED BORDER ===== */
.card-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(45deg, transparent, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: rotateBorder 3s linear infinite;
}

.project-card[data-gradient="blue-purple"] .card-border {
    background: linear-gradient(45deg, #0066cc, #a855f7, #0066cc);
    background-size: 200% 200%;
}

.project-card[data-gradient="orange-pink"] .card-border {
    background: linear-gradient(45deg, #ff6b35, #ec4899, #ff6b35);
    background-size: 200% 200%;
}

.project-card[data-gradient="green-cyan"] .card-border {
    background: linear-gradient(45deg, #10b981, #06b6d4, #10b981);
    background-size: 200% 200%;
}

@keyframes rotateBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== BROWSER BAR ===== */
.browser-bar {
    display: flex;
    align-items: center;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.traffic-lights {
    display: flex;
    gap: 0.35rem;
}

.light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: block;
}

.light.red { background: linear-gradient(135deg, #ff5f56, #ff2d20); }
.light.yellow { background: linear-gradient(135deg, #ffbd2e, #ff9500); }
.light.green { background: linear-gradient(135deg, #27c93f, #00d100); }

/* ===== PROJECT ICON ===== */
.project-icon {
    text-align: center;
    margin-bottom: 1.25rem;
}

.icon-gradient {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    font-size: 2rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.2), rgba(168, 85, 247, 0.2));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.gradient-1 { background: linear-gradient(135deg, rgba(0, 102, 204, 0.3), rgba(168, 85, 247, 0.3)); }
.gradient-2 { background: linear-gradient(135deg, rgba(255, 107, 53, 0.3), rgba(236, 72, 153, 0.3)); }
.gradient-3 { background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(6, 182, 212, 0.3)); }

.project-card:hover .icon-gradient {
    transform: scale(1.1) rotate(5deg);
}

/* ===== PROJECT INFO ===== */
.project-info {
    text-align: center;
}

.project-role {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin-bottom: 0.4rem;
}

.project-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.project-tagline {
    font-size: 0.85rem;
    opacity: 0.8;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

/* ===== HOVER TOOLTIP ===== */
.hover-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 5;
    pointer-events: none;
}

body.dark-mode .hover-tooltip {
    background: rgba(0, 0, 0, 0.88);
}

.project-card:hover .hover-tooltip {
    opacity: 1;
    visibility: visible;
}

.project-card.expanded .hover-tooltip {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

.project-card:has(.expand-arrow:hover) .hover-tooltip {
    opacity: 0;
    visibility: hidden;
}

.tooltip-item {
    margin-bottom: 1.25rem;
    color: white;
    width: 100%;
}

.tooltip-item:last-child {
    margin-bottom: 0;
}

.tooltip-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
    display: block;
    margin-bottom: 0.5rem;
}

.tooltip-value {
    font-size: 0.95rem;
    font-weight: 500;
    display: block;
    line-height: 1.6;
}

.tooltip-item:nth-child(2) .tooltip-value {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tooltip-item:nth-child(2) .tooltip-value::before,
.tooltip-item:nth-child(2) .tooltip-value::after {
    display: none;
}

.tech-chip {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: rgba(128, 128, 128, 0.3);
    border: 1px solid rgba(128, 128, 128, 0.4);
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: 'Victor Mono', monospace;
    color: #e0e0e0;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== EXPAND ARROW ===== */
.expand-arrow {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 2px solid var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    transition: all 0.3s ease;
    z-index: 15;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

body.dark-mode .expand-arrow {
    background: var(--bg-dark);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.expand-arrow:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 102, 204, 0.15);
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
}

.arrow-icon {
    font-size: 16px;
    display: block;
    transition: transform 0.3s ease;
    animation: arrowBounce 2s ease-in-out infinite;
    color: var(--accent-blue);
    font-weight: 600;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

.project-card.expanded .arrow-icon {
    transform: rotate(180deg);
    animation: none;
}

.project-card.expanded .expand-arrow:hover {
    transform: translateX(-50%) scale(1.1) rotate(0deg);
}

/* ===== METRICS BOX ===== */
.metrics-box {
    position: absolute;
    top: calc(100% + 32px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.3s ease;
    z-index: 5;
}

body.dark-mode .metrics-box {
    background: rgba(255, 255, 255, 0.02);
}

.project-card.expanded .metrics-box {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-item {
    text-align: center;
}

.metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.metrics-description {
    margin-bottom: 2rem;
}

.metrics-description h4,
.metrics-tech h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    margin-bottom: 1rem;
}

.metrics-description p {
    line-height: 1.7;
    opacity: 0.9;
}

.metrics-tech {
    margin-bottom: 2rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tech-tag {
    padding: 0.5rem 1rem;
    background: rgba(0, 102, 204, 0.1);
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 500;
}

.project-link {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--accent-blue);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer !important;
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.4);
}

/* ===== 3D HOVER EFFECT ===== */
.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

body.dark-mode .project-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.project-card.expanded {
    transform: none !important;
    cursor: default;
    z-index: 100;
    position: relative;
}

.project-card.expanded:hover {
    transform: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .projects-section {
        padding: 6.5rem 1.5rem 3rem;
    }

    .page-title {
        margin-top: 0.5rem;
        margin-bottom: 3rem;
        font-size: 2.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        row-gap: 3rem;
    }

    .project-card {
        padding: 1.25rem;
        padding-bottom: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .metrics-box {
        padding: 1.5rem;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
    }

    body.dark-mode .metrics-box {
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
    }

    /* Disable 3D tilt on mobile */
    .project-card:hover {
        transform: translateY(-4px) !important;
    }

    /* Make hover tooltip work better on mobile */
    .hover-tooltip {
        padding: 1.5rem;
    }

    .tooltip-label {
        font-size: 0.7rem;
    }

    .tech-chip {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .projects-section {
        padding: 6rem 1rem 2rem;
    }

    .page-title {
        font-size: 2rem;
        margin-top: 0.5rem;
        margin-bottom: 2rem;
    }

    .projects-grid {
        row-gap: 2.5rem;
    }

    .project-card {
        padding: 1rem;
        padding-bottom: 1.5rem;
        margin-bottom: 1rem;
    }

    .metrics-box {
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(25px);
    }

    body.dark-mode .metrics-box {
        background: rgba(10, 10, 10, 0.97);
        backdrop-filter: blur(25px);
    }

    .icon-gradient {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .project-name {
        font-size: 1.2rem;
    }

    .project-tagline {
        font-size: 0.9rem;
    }

    .metrics-box {
        padding: 1.25rem;
    }

    .expand-arrow {
        width: 32px;
        height: 32px;
        bottom: -16px;
    }

    .arrow-icon {
        font-size: 16px;
    }

    .hover-tooltip {
        padding: 1.25rem;
    }

    .tooltip-value {
        font-size: 0.9rem;
    }

    .tech-chip {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    /* Make project link button full width on mobile */
    .project-link {
        display: block;
        text-align: center;
        width: 100%;
    }
}
