/* Import styles from main CSS */
@import url('style.css');

/* ===============================
   PROJECTS PAGE SPECIFIC STYLES
=============================== */
.projects-page {
    padding: 8rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Project Detail Cards */
.project-detail-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 30px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    transform: translateY(30px);
    animation: slideUpProject 0.7s ease forwards;
    animation-delay: calc(var(--index, 0) * 0.12s);
    position: relative;
    overflow: hidden;
}

@keyframes slideUpProject {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-detail-card::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), transparent);
    opacity: 0;
    transition: all 0.6s ease;
    z-index: 0;
    pointer-events: none;
}

.project-detail-card:hover::before {
    top: 0;
    opacity: 0.05;
}

.project-detail-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 50px var(--shadow-glow);
    border-color: var(--primary-color);
}

.project-detail-card > * {
    position: relative;
    z-index: 1;
}

.project-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.project-detail-header h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--highlight-color);
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
    border-radius: 16px;
    overflow: hidden;
    background: var(--background-tertiary);
}

.carousel-wrapper {
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
}

.carousel-images {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-images img {
    min-width: 100%;
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
    transition: filter 0.5s ease;
}

.project-detail-card:hover .carousel-images img {
    filter: brightness(1.1) contrast(1.05);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(210, 10, 46, 0.95);
    border: 2px solid transparent;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    backdrop-filter: blur(10px);
    font-weight: bold;
}

.carousel-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 8px 30px var(--shadow-glow);
    border-color: rgba(255, 255, 255, 0.3);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(1.05);
}

.carousel-btn svg {
    transition: transform 0.3s ease;
}

.carousel-btn.prev {
    left: 1rem;
}

.carousel-btn.next {
    right: 1rem;
}

.carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: var(--primary-color);
    width: 30px;
    border-radius: 6px;
}

/* Single Image Container */
.single-image-container {
    width: 100%;
    margin-bottom: 2rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.single-image-container img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
    transition: filter 0.5s ease, transform 0.5s ease;
}

.project-detail-card:hover .single-image-container img {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.05);
}

/* Project Detail Content */
.project-detail-content {
    padding: 1rem 0;
}

.project-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.meta-item svg {
    color: var(--primary-color);
}

.project-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 20px var(--shadow-glow);
    border: 2px solid transparent;
    position: relative;
    overflow: visible;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    white-space: normal;
    flex-wrap: wrap;
    line-height: 1.4;
    width: 100%;
}

.project-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: transparent;
    transition: left 0.4s ease;
    z-index: -1;
}

.project-link:hover::before {
    left: 100%;
}

.project-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px var(--shadow-glow);
    border-color: rgba(255, 255, 255, 0.3);
}

.project-link:active {
    transform: translateY(-1px);
}

.project-link svg {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 22px;
    height: 22px;
}

.project-link:hover svg {
    transform: translateX(4px) rotate(45deg);
}

/* Mini Projects Section */
.mini-projects-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.mini-projects-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--highlight-color);
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.mini-projects-title::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 50%;
    width: clamp(60px, 8vw, 100px);
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.mini-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.mini-project-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 15px var(--shadow-color);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.6s ease forwards;
    opacity: 0;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mini-project-card:nth-child(1) { animation-delay: 0.1s; }
.mini-project-card:nth-child(2) { animation-delay: 0.15s; }
.mini-project-card:nth-child(3) { animation-delay: 0.2s; }
.mini-project-card:nth-child(4) { animation-delay: 0.25s; }
.mini-project-card:nth-child(5) { animation-delay: 0.3s; }
.mini-project-card:nth-child(6) { animation-delay: 0.35s; }
.mini-project-card:nth-child(7) { animation-delay: 0.4s; }

.mini-project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(210, 10, 46, 0.1), transparent);
    transition: left 0.5s ease;
    z-index: 0;
}

.mini-project-card:hover::before {
    left: 100%;
}

.mini-project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 10px 35px var(--shadow-glow);
    border-color: var(--primary-color);
}

.mini-project-card > * {
    position: relative;
    z-index: 1;
}

.mini-project-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--highlight-color);
    margin-bottom: 0.8rem;
}

.mini-project-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.mini-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.mini-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.mini-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: block;
}

.mini-project-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mini-project-card a:hover {
    transform: translateX(6px);
    border-bottom: 2px solid var(--primary-color);
    -webkit-text-fill-color: inherit;
}

/* ===============================
   RESPONSIVE DESIGN
=============================== */

/* TABLETS & SMALL DESKTOPS (1024px and below) */
@media (max-width: 1024px) {
    .projects-page {
        padding: 7rem 1.5rem 3rem;
        max-width: 100%;
    }
    
    .project-detail-card {
        padding: 2rem;
        margin-bottom: 2.5rem;
    }
    
    .project-detail-header h3 {
        font-size: 1.8rem;
    }
    
    .carousel-images img,
    .single-image-container img {
        height: 400px;
    }
    
    .carousel-btn {
        width: 45px;
        height: 45px;
    }
    
    .mini-projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .carousel-indicators {
        gap: 0.4rem;
    }
    
    .carousel-indicator {
        width: 10px;
        height: 10px;
    }
}

/* TABLETS (768px to 1024px) */
@media (max-width: 768px) {
    .projects-page {
        padding: 6rem 1rem 2rem;
        max-width: 100%;
    }
    
    .project-detail-card {
        padding: 1.5rem;
        margin-bottom: 2rem;
        border-radius: 16px;
    }
    
    .project-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .project-detail-header h3 {
        font-size: 1.5rem;
        margin: 0;
    }
    
    .carousel-images img,
    .single-image-container img {
        height: 300px;
    }
    
    .carousel-container {
        margin-bottom: 1.5rem;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .carousel-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .carousel-btn.prev {
        left: 0.5rem;
    }
    
    .carousel-btn.next {
        right: 0.5rem;
    }
    
    .carousel-indicators {
        bottom: 0.75rem;
        gap: 0.35rem;
    }
    
    .carousel-indicator {
        width: 10px;
        height: 10px;
    }
    
    .carousel-indicator.active {
        width: 24px;
    }
    
    .project-description {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    .project-meta {
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .meta-item {
        font-size: 0.9rem;
    }
    
    .meta-item svg {
        width: 16px;
        height: 16px;
    }
    
    .project-link {
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
        flex-direction: row;
        width: auto;
    }
    
    .project-link svg {
        width: 20px;
        height: 20px;
    }
    
    .mini-projects-section {
        margin-top: 3rem;
        padding-top: 2.5rem;
    }
    
    .mini-projects-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .mini-projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.25rem;
    }
    
    .mini-project-card {
        padding: 1.25rem;
    }
    
    .mini-project-card h4 {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
    }
    
    .mini-project-card p {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }
    
    .mini-tags {
        gap: 0.4rem;
        margin-bottom: 0.6rem;
    }
    
    .mini-tag {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }
    
    .mini-date {
        font-size: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .mini-project-card a {
        font-size: 0.9rem;
        padding: 0.4rem 0;
    }
}

/* MOBILE PHONES (480px to 768px) */
@media (max-width: 480px) {
    .projects-page {
        padding: 5rem 0.75rem 1.5rem;
        max-width: 100%;
    }
    
    .project-detail-card {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }
    
    .project-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .project-detail-header h3 {
        font-size: 1.25rem;
        margin: 0;
        max-width: 100%;
        word-wrap: break-word;
    }
    
    .carousel-images img,
    .single-image-container img {
        height: 200px;
    }
    
    .carousel-container {
        margin-bottom: 1.25rem;
        border-radius: 12px;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 0.75rem;
    }
    
    .carousel-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .carousel-btn.prev {
        left: 0.35rem;
    }
    
    .carousel-btn.next {
        right: 0.35rem;
    }
    
    .carousel-indicators {
        bottom: 0.5rem;
        gap: 0.3rem;
    }
    
    .carousel-indicator {
        width: 8px;
        height: 8px;
    }
    
    .carousel-indicator.active {
        width: 20px;
    }
    
    .project-description {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 0.6rem;
        margin-bottom: 0.75rem;
    }
    
    .meta-item {
        font-size: 0.8rem;
        gap: 0.4rem;
    }
    
    .meta-item svg {
        width: 14px;
        height: 14px;
    }
    
    .project-link {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        letter-spacing: 0.5px;
        flex-wrap: nowrap;
        width: 100%;
        gap: 0.4rem;
    }
    
    .project-link svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }
    
    /* MINI PROJECTS */
    .mini-projects-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    .mini-projects-title {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
        display: inline-block;
        width: 100%;
    }
    
    .mini-projects-title::after {
        width: 60px;
        height: 3px;
        bottom: -15px;
        left: 50%;
    }
    
    .mini-projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.8rem;
    }
    
    .mini-project-card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .mini-project-card h4 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .mini-project-card p {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }
    
    .mini-tags {
        gap: 0.3rem;
        margin-bottom: 0.5rem;
    }
    
    .mini-tag {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    .mini-date {
        font-size: 0.75rem;
        margin-bottom: 0.6rem;
    }
    
    .mini-project-card a {
        font-size: 0.8rem;
        padding: 0.35rem 0;
    }
}

/* SMALL PHONES (Below 380px) */
@media (max-width: 380px) {
    .projects-page {
        padding: 4.5rem 0.5rem 1rem;
    }
    
    .project-detail-card {
        padding: 0.85rem;
        margin-bottom: 1.25rem;
    }
    
    .project-detail-header h3 {
        font-size: 1.1rem;
    }
    
    .carousel-images img,
    .single-image-container img {
        height: 150px;
    }
    
    .carousel-btn {
        width: 32px;
        height: 32px;
    }
    
    .project-description {
        font-size: 0.85rem;
    }
    
    .project-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .mini-projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.6rem;
    }
    
    .mini-projects-title {
        font-size: 1.2rem;
    }
}

/* Lazy Loading Effect */
img[data-src] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img[data-src].loaded {
    opacity: 1;
}

/* Scroll Animations */
.project-detail-card {
    --index: 0;
}

.project-detail-card:nth-child(1) { --index: 1; }
.project-detail-card:nth-child(2) { --index: 2; }
.project-detail-card:nth-child(3) { --index: 3; }
.project-detail-card:nth-child(4) { --index: 4; }
.project-detail-card:nth-child(5) { --index: 5; }
.project-detail-card:nth-child(6) { --index: 6; }
.project-detail-card:nth-child(7) { --index: 7; }
.project-detail-card:nth-child(8) { --index: 8; }

/* ==============================
   ENHANCED ANIMATIONS
============================== */

/* Project Description Animation */
.project-description {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: calc(var(--index, 0) * 0.12s + 0.2s);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Project Meta Animation */
.project-meta {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: calc(var(--index, 0) * 0.12s + 0.35s);
}

/* Project Link Hover Animation Enhancement */
.project-link {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: calc(var(--index, 0) * 0.12s + 0.5s);
}

.project-link:hover span {
    animation: slideRight 0.4s ease;
}

@keyframes slideRight {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(4px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Carousel Image Fade Animation */
.carousel-images img.loaded {
    animation: imageSlideIn 0.6s ease;
}

@keyframes imageSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mini Projects Animation */
.mini-project-card {
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--mini-index, 0) * 0.1s);
    opacity: 0;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mini-project-card:nth-child(1) { --mini-index: 0; }
.mini-project-card:nth-child(2) { --mini-index: 1; }
.mini-project-card:nth-child(3) { --mini-index: 2; }
.mini-project-card:nth-child(4) { --mini-index: 3; }
.mini-project-card:nth-child(5) { --mini-index: 4; }
.mini-project-card:nth-child(6) { --mini-index: 5; }
.mini-project-card:nth-child(7) { --mini-index: 6; }

/* Section Header Animation */
.section-header {
    animation: slideDown 0.7s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(210, 10, 46, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(210, 10, 46, 0.6);
    }
}

/* Section Header Adjustment for Projects Page */
.projects-page .section-header {
    margin-bottom: 3rem;
}
