/* ============================================
   PROJECT DETAILS MODAL - RICH CONTENT
   ============================================ */

/* === MODAL OVERLAY === */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

/* === MODAL CONTENT === */
.modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--bg-primary);
    border-radius: 24px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* === CLOSE BUTTON === */
.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-primary);
}

.modal-close:hover svg {
    stroke: white;
}

/* === SCROLLABLE CONTENT === */
.modal-scroll {
    overflow-y: auto;
    padding: 2rem;
    flex: 1;
}

.modal-scroll::-webkit-scrollbar {
    width: 8px;
}

.modal-scroll::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.modal-scroll::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

.modal-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-dark);
}

/* === MODAL HERO IMAGE === */
.modal-hero-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .modal-hero-image {
        height: 250px;
    }
}

/* ============================================
   MODAL HERO PLACEHOLDER
   For projects without hero images
   ============================================ */
.modal-hero-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.3) 0%, 
        rgba(245, 158, 11, 0.3) 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Animated background effect */
.modal-hero-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 30% 40%, rgba(139, 92, 246, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(245, 158, 11, 0.4) 0%, transparent 50%);
    animation: shimmerGradient 8s ease infinite;
}

/* Large icon for modal */
.modal-hero-placeholder .placeholder-icon {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.modal-hero-placeholder .placeholder-icon svg {
    width: 60px;
    height: 60px;
    stroke: rgba(255, 255, 255, 0.9);
}

/* Project title in placeholder */
.modal-hero-placeholder .placeholder-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
    z-index: 1;
    text-align: center;
    padding: 0 2rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-hero-placeholder {
        height: 250px;
    }
    
    .modal-hero-placeholder .placeholder-icon {
        width: 80px;
        height: 80px;
    }
    
    .modal-hero-placeholder .placeholder-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .modal-hero-placeholder .placeholder-title {
        font-size: 1.5rem;
    }
}

/* === MODAL HEADER === */
.modal-header {
    margin-bottom: 2rem;
}

.modal-badges {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.modal-badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.modal-tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-techs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.modal-tech-tag {
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--color-primary-light);
    font-size: 0.875rem;
    font-weight: 500;
}

/* === KEY METRICS === */
.modal-section {
    margin-bottom: 2.5rem;
}

.modal-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-section-title::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: var(--color-accent);
    border-radius: 2px;
}

.key-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-value {
    font-size: 1.125rem;
    color: var(--color-primary-light);
    font-weight: 700;
}

/* === HIGHLIGHTS === */
.highlights-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.highlight-item {
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--color-primary);
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.highlight-item::before {
    content: '✓';
    color: var(--color-accent);
    font-weight: 700;
    margin-right: 0.75rem;
}

/* === AI SCORES === */
.ai-scores {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(245, 158, 11, 0.1));
    border-radius: 12px;
    border: 1px solid var(--border-primary);
}

.score-item {
    margin-bottom: 1.25rem;
}

.score-item:last-child {
    margin-bottom: 0;
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.score-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-accent);
}

.score-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === TEXT CONTENT === */
.modal-text-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-text-content p {
    margin-bottom: 1rem;
}

.modal-text-content p:last-child {
    margin-bottom: 0;
}

/* === LESSONS LEARNED === */
.lessons-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lesson-item {
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--color-accent);
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
}

.lesson-item::before {
    content: '💡';
    margin-right: 0.75rem;
}

/* === PROJECT INFO === */
.project-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* === ACTION BUTTONS === */
.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-primary);
    flex-wrap: wrap;
}

.modal-btn {
    flex: 1;
    min-width: 200px;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border: none;
}

.modal-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.modal-btn-secondary {
    background: transparent;
    color: var(--color-primary-light);
    border: 2px solid var(--border-primary);
}

.modal-btn-secondary:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--color-primary);
}

.modal-btn svg {
    width: 20px;
    height: 20px;
}

/* === MODAL FOOTER === */
.modal-footer {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .project-modal {
        padding: 0;
    }

    .modal-content {
        max-height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }

    .modal-scroll {
        padding: 1.5rem;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
    }

    .modal-title {
        font-size: 1.75rem;
    }

    .modal-tagline {
        font-size: 1rem;
    }

    .key-metrics-grid {
        grid-template-columns: 1fr;
    }

    .project-info-grid {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}

/* === ANIMATIONS === */
.modal-scroll > * {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.modal-scroll > *:nth-child(1) { animation-delay: 0.1s; }
.modal-scroll > *:nth-child(2) { animation-delay: 0.2s; }
.modal-scroll > *:nth-child(3) { animation-delay: 0.3s; }
.modal-scroll > *:nth-child(4) { animation-delay: 0.4s; }
.modal-scroll > *:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
