/* ML Project Portfolio Detail Page */

/* Hero Section */
.project-hero {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--dark-color) 100%);
    color: var(--white);
    padding: 8rem 0 4rem;
    margin-top: 70px;
    position: relative;
    overflow: hidden;
}

.project-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 215, 0, 0.1) 100%);
    pointer-events: none;
}

.project-hero .container {
    position: relative;
    z-index: 1;
}

.featured-badge-large {
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.featured-badge-large i {
    font-size: 0.8rem;
}

.project-hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--white);
    line-height: 1.2;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.meta-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

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

.tech-pill {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--white);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.tech-pill:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Content Grid */
.project-content {
    padding: 4rem 0;
    background: var(--light-color);
}

.project-content .container {
    max-width: 1400px;
}

.content-grid {
    display: grid;
    grid-template-columns: 900px 350px;
    gap: 3rem;
    justify-content: center;
}

.main-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Section Cards */
.section-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    width: 100%;
}

.section-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Collapsible Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-color);
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Toggle Button */
.toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toggle-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toggle-btn:active {
    transform: translateY(0);
}

.toggle-btn.loading {
    position: relative;
    color: transparent !important;
}

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

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

.toggle-btn i {
    transition: transform 0.4s ease;
    font-size: 0.8rem;
}

.toggle-btn.collapsed i {
    transform: rotate(180deg);
}

.toggle-text {
    font-weight: 500;
}

/* Attention-grabbing animation for long content */
.toggle-btn.attention {
    animation: gentle-pulse 3s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
    }
}

/* Collapsible Content */
.description-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, margin-top 0.4s ease;
    opacity: 1;
    margin-top: 0;
    position: relative;
    scroll-behavior: smooth;
}

.description-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: -1rem;
    overflow: hidden;
}

.description-content.expanded {
    max-height: none;
    overflow: visible;
}

.description-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, var(--white) 0%, rgba(255, 255, 255, 0.9) 50%, transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.description-content.collapsed::after {
    opacity: 1;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.description-content.collapsed .scroll-indicator {
    opacity: 1;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-5px);
    }
    60% {
        transform: translateX(-50%) translateY(-3px);
    }
}

.description-text {
    line-height: 1.7;
    color: var(--text-color);
    white-space: pre-line;
    font-size: 1rem;
}

.section-card h2 {
    font-size: 1.75rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-color);
}

.section-card h2 i {
    color: var(--primary-color);
}

.description-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
}

/* Interactive Section */
.interactive-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--secondary-color);
}

.interactive-section h2 {
    color: var(--secondary-color);
    border-bottom-color: rgba(51, 51, 51, 0.2);
}

.interactive-section p {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.btn-colab {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-colab:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: var(--dark-color);
    color: var(--primary-color);
}

/* Visualizations Gallery */
.visualizations-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.viz-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.viz-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.viz-item a {
    display: block;
    position: relative;
    overflow: hidden;
}

.viz-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: all 0.4s ease;
}

.viz-item:hover img {
    transform: scale(1.1);
}

.viz-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

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

.viz-overlay i {
    color: var(--white);
    font-size: 2.5rem;
}

.viz-info {
    padding: 1.25rem;
    background: var(--white);
}

.viz-info h4 {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.viz-info p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.metric-card {
    background: linear-gradient(135deg, var(--light-color) 0%, var(--white) 100%);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.metric-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.metric-icon.accuracy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
}

.metric-icon.precision {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: var(--white);
}

.metric-icon.recall {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: var(--white);
}

.metric-icon.f1 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: var(--white);
}

.metric-icon.custom {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: var(--white);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

/* File Explorer */
.file-explorer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.folder-item {
    border: 2px solid var(--light-color);
    border-radius: 10px;
    overflow: hidden;
}

.folder-header {
    background: var(--light-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.folder-header:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.folder-header i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.folder-header:hover i {
    color: var(--secondary-color);
}

.folder-content {
    padding: 0.75rem;
    background: var(--white);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--light-color);
    margin-bottom: 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--secondary-color);
    transition: all 0.3s ease;
}

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

.file-item:hover {
    background: var(--primary-color);
    transform: translateX(10px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.file-item i:first-child {
    font-size: 1.5rem;
    color: #666;
}

.file-item:hover i:first-child {
    color: var(--secondary-color);
}

.file-item span {
    flex: 1;
    font-weight: 500;
}

.file-item i:last-child {
    color: #999;
    opacity: 0;
    transition: all 0.3s ease;
}

.file-item:hover i:last-child {
    opacity: 1;
}

/* Sidebar */
.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 350px;
}

.sidebar-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
}

.sidebar-card.sticky-card {
    position: sticky;
    top: 90px;
}

.sidebar-card h3 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-card h3 i {
    color: var(--primary-color);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.btn-github {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-github:hover {
    background: var(--dark-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-demo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
}

.btn-demo:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-colab-alt {
    background: #f9ab00;
    color: var(--white);
}

.btn-colab-alt:hover {
    background: #e09600;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(249, 171, 0, 0.4);
}

.btn-back {
    background: var(--light-color);
    color: var(--secondary-color);
}

.btn-back:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* Student Info */
.student-info {
    text-align: center;
}

.student-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.contact-link:hover {
    background: var(--light-color);
    color: var(--primary-dark);
}

.contact-link i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Code Viewer with Tabs */
.code-tabs {
    margin-top: 1.5rem;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 1rem;
}

.tab-btn {
    background: var(--light-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: var(--secondary-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--secondary-color);
    border-bottom: 3px solid var(--secondary-color);
}

.code-content {
    display: none;
}

.code-content.active {
    display: block;
}

.code-header {
    background: #282c34;
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-filename {
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.2);
}

.code-content pre {
    margin: 0;
    border-radius: 0 0 8px 8px;
    background: #282c34 !important;
    padding: 1.5rem !important;
    overflow-x: auto;
}

.code-content code {
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Highlight.js custom theme adjustments */
.hljs {
    background: #282c34 !important;
    color: #abb2bf !important;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link {
    color: #c678dd !important;
}

.hljs-function .hljs-keyword {
    color: #c678dd !important;
}

.hljs-string,
.hljs-title,
.hljs-name,
.hljs-type,
.hljs-attribute,
.hljs-symbol,
.hljs-bullet,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable {
    color: #98c379 !important;
}

.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
    color: #5c6370 !important;
}

.hljs-number,
.hljs-built_in {
    color: #d19a66 !important;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .content-grid {
        grid-template-columns: 1fr 350px;
        max-width: 100%;
    }
    
    .main-column {
        width: auto;
    }
}

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }
    
    .sidebar-column {
        width: 100%;
    }
    
    .sidebar-card.sticky-card {
        position: relative;
        top: 0;
    }
    
    .sidebar-column {
        order: -1;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .project-hero {
        padding: 6rem 0 3rem;
    }
    
    .project-hero h1 {
        font-size: 2rem;
    }
    
    .project-meta {
        gap: 1rem;
        font-size: 1rem;
    }
    
    .section-card {
        padding: 1.5rem;
    }
    
    .section-card h2 {
        font-size: 1.4rem;
    }
    
    .visualizations-gallery {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .section-card {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .project-hero h1 {
        font-size: 1.75rem;
    }

    .tech-pill {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

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

    .metric-value {
        font-size: 1.75rem;
    }

    .featured-badge-large {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    /* Collapsible section mobile styles */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .toggle-btn {
        align-self: stretch;
        justify-content: center;
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
        margin-top: 0.5rem;
    }

    .description-content {
        max-height: 400px; /* Adjusted for mobile */
    }

    .description-content.collapsed {
        max-height: 0;
    }

    .scroll-indicator {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
        bottom: 15px;
    }

    /* Better mobile touch targets */
    .toggle-btn, .scroll-indicator {
        min-height: 44px; /* iOS touch target minimum */
        min-width: 44px;
    }
}

