/* Project Details Page Specific Styles */

.project-detail-page {
    padding-top: 5rem;
    overflow-x: hidden;
}

/* Project Hero Section */
.project-hero {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(0, 212, 255, 0.15));
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    padding: clamp(2.5rem, 6vw, 4rem) 0;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

/* Thick gradient divider line (match Tool Details hero) */
.project-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--project-primary) 0%, var(--project-secondary) 50%, var(--project-accent) 100%);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
    position: relative;
}

.project-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
    gap: 2.5rem;
    align-items: stretch;
}

.project-hero-main {
    text-align: left;
}

/* Breadcrumbs (match Course/Tool details patterns) */
.project-hero .hero-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    row-gap: 0.35rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.project-hero .hero-breadcrumb a {
    color: var(--project-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.project-hero .hero-breadcrumb a:hover {
    color: var(--project-accent);
}

.project-hero .hero-breadcrumb span {
    color: rgba(255, 255, 255, 0.4);
}

.project-hero .hero-breadcrumb span[aria-current="page"] {
    color: rgba(255, 255, 255, 0.75);
    overflow-wrap: anywhere;
}

.hero-badges {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.project-title {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-align: left;
    background: linear-gradient(135deg, var(--project-primary), var(--project-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    overflow-wrap: anywhere;
}

.project-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-align: left;
}

.project-stats {
    margin-top: 1.5rem;
}

.project-languages-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-lang-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--project-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 1.75rem;
}

.btn-primary, .btn-secondary, .btn-share, .share-btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--project-primary), var(--project-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
    color: white;
}

.btn-secondary {
    background: var(--secondary-bg);
    color: var(--project-primary);
    border: 2px solid var(--project-primary);
}

.btn-secondary:hover {
    background: var(--project-primary);
    color: white;
}

.btn-share {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-share:hover {
    background: var(--secondary-bg);
    color: var(--project-primary);
    border-color: var(--project-primary);
}

/* Share button style aligned with tool details */
.share-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.share-btn:hover {
    background: var(--card-bg);
    border-color: var(--project-primary);
    color: var(--project-primary);
}

.share-icon {
    font-size: 1.1rem;
}

/* New distinct button styles for View Code and Share */
.btn-view-code,
.btn-share-project {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* View Code button - Purple/Blue gradient */
.btn-view-code {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.btn-view-code:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

/* Share button - Teal/Green gradient */
.btn-share-project {
    background: linear-gradient(135deg, #14b8a6 0%, #10b981 100%);
    color: white;
}

.btn-share-project:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
    background: linear-gradient(135deg, #0d9488 0%, #059669 100%);
    color: white;
}

.btn-emoji {
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
}

/* Project meta rating under subtitle */
.project-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.project-meta .review-count {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Make the star rating color match the Submit Review button theme */
.project-detail-page .star.full {
    color: var(--project-primary);
}

.project-detail-page .star.half {
    color: var(--project-primary);
    opacity: 0.6;
}

.project-detail-page .star.empty {
    color: rgba(255, 255, 255, 0.22);
}

.project-detail-page .star-rating .rating-number {
    color: var(--project-primary);
    font-weight: 700;
}

.project-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meta-chip {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.meta-chip-source {
    background: rgba(2, 112, 235, 0.18);
    border-color: rgba(2, 112, 235, 0.6);
    color: #e1e5eb;
}

.meta-chip-pricing {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.7);
    color: #e1e5eb;
}

.meta-chip-trending {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.7);
    color: #facc15;
}

.meta-chip strong {
    color: var(--text-primary);
}

/* Hero aside card */
.project-hero-aside {
    display: flex;
    align-items: stretch;
}

.project-hero-card {
    background: rgba(10, 14, 25, 0.9);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    padding: 1.75rem 1.75rem 1.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hero-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.hero-card-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}

.hero-card-title {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
    opacity: 0.9;
}

.hero-card-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1rem;
}

.hero-card-section:first-of-type {
    border-top: none;
    padding-top: 0.25rem;
}

.hero-card-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.hero-languages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hero-language-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.hero-language-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.hero-card-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hero-quick-stats {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.hero-share-inline .share-link-section {
    margin-bottom: 0.75rem;
}

.hero-share-inline .share-link-input {
    background: rgba(15, 23, 42, 0.95);
}

.hero-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hero-stat-label {
    opacity: 0.8;
}

.hero-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Project Content */
.project-content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem) 4rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 350px);
    gap: 3rem;
}

.main-column {
    min-width: 0;
}

.sidebar-column {
    position: sticky;
    top: 7rem;
    height: fit-content;
}

/* Content Sections */
.content-section {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.content-section h2 {
    /* Match Course Details heading style */
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-section h2::before {
    content: '';
    width: 4px;
    height: 28px;
    /* Same gradient as Project Details Submit Review button */
    background: linear-gradient(135deg, var(--project-primary), var(--project-secondary));
    border-radius: 2px;
    flex-shrink: 0;
}

/* Thumbnail */
.project-thumbnail-section {
    margin-bottom: 2rem;
}

.project-thumbnail-large {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

/* Description */
.description-content {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Installation Content */
.installation-steps {
    display: block;
}

.installation-text {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.storage-requirement {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 212, 255, 0.06);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Tags */
.tags-list {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Non-clickable project tags with distinct colors */
.tag-item {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(2, 112, 235, 0.22), rgba(125, 52, 221, 0.28));
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: default;
}

/* Keep hover subtle so tags don't feel interactive */
.tag-item:hover {
    transform: none;
    box-shadow: none;
}

/* =================================================================
   REVIEWS SECTION (match Course Details styling)
   ================================================================= */

.reviews-section {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.reviews-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.reviews-header h2::before {
    content: '';
    width: 4px;
    height: 28px;
    background: linear-gradient(135deg, var(--project-primary), var(--project-secondary));
    border-radius: 2px;
    flex-shrink: 0;
}

.add-review-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.add-review-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--project-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

.rating-input input[type="radio"] {
    display: none;
}

.rating-input label {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input[type="radio"]:checked ~ label {
    color: var(--project-primary);
    transform: scale(1.1);
}

.submit-review-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--project-primary), var(--project-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.submit-review-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
}

.review-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin-top: -0.5rem;
}

.reviews-list h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.review-item {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.reviewer-name {
    color: var(--text-primary);
    font-weight: 600;
}

.review-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: block;
    margin-top: 0.25rem;
}

.review-rating {
    font-size: 1.2rem;
    /* Emoji stars: shift to match Project Details CTA/Submit button theme */
    filter: hue-rotate(185deg) saturate(1.8) brightness(1.05);
}

.review-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.no-reviews {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

/* Sidebar */
.sidebar-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Project Info card: use the project's primary color as the background */
.project-info-card {
    background: linear-gradient(
        135deg,
        rgba(0, 212, 255, 0.22) 0%,
        rgba(0, 212, 255, 0.10) 100%
    );
    border-color: rgba(0, 212, 255, 0.25);
}

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

.info-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Similar Projects */
.similar-projects-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.similar-project-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.similar-project-item:hover {
    border-color: var(--project-primary);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}

.similar-project-content h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.similar-project-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.similar-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.similar-language {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.similar-lang-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .project-content-wrapper {
        grid-template-columns: 1fr 300px;
        gap: 2rem;
    }
}

@media (max-width: 992px) {
    /* Header can wrap on tablets; ensure content doesn't sit under the fixed header */
    .project-detail-page {
        padding-top: 7rem;
    }

    .project-content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .sidebar-column {
        position: relative;
        top: 0;
    }
}

@media (max-width: 992px) {
    .project-hero-grid {
        grid-template-columns: 1fr;
    }

    .project-hero-main {
        text-align: left;
    }

    .hero-badges {
        justify-content: flex-start;
    }

    .project-hero-aside {
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    /* Header becomes taller on mobile; add enough top padding so content doesn't sit under it */
    .project-detail-page {
        padding-top: 12rem;
    }
    
    .project-hero {
        padding: 2.5rem 0;
    }

    /* container padding is already responsive via clamp; keep this for safety */
    .hero-container {
        padding: 0 1rem;
    }
    
    .project-title {
        font-size: 2.5rem;
    }
    
    .project-subtitle {
        font-size: 1.2rem;
    }
    
    .project-stats {
        gap: 1rem;
        padding: 1.5rem 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary, .btn-secondary, .btn-share {
        width: 100%;
        justify-content: center;
    }
    
    .project-content-wrapper {
        padding: 0 1rem 3rem;
    }
    
    .content-section {
        padding: 1.5rem;
    }
    
    .content-section h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .project-title {
        font-size: 2rem;
    }
    
    .project-subtitle {
        font-size: 1rem;
    }
    
    .project-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-item {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .stat-item:last-child {
        border-bottom: none;
    }
    
    .content-section {
        padding: 1rem;
    }
    
    .install-step {
        flex-direction: column;
        gap: 1rem;
    }
    
    .sidebar-card {
        padding: 1.5rem;
    }
}
