:root {
    --primary: #6e45e2;
    --PRIMARY-LIGHT: #8d6eff;
    --dark: #1A1B26;
    --DARKER: #0a0a0a;
    --light: #FFFFFF;
    --OFF-LIGHT: #c8ccd0;
    --gray: #6C757D;
    --glass: rgba(255, 255, 255, 0.1);
    --GLASS-BORDER: rgba(255, 255, 255, 0.2);
    --success: #28a745;
}

/* General Styling */
body {
    background: linear-gradient(135deg, var(--dark), var(--DARKER));
    color: var(--light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}



/* Project Gallery */
.project-gallery {
    overflow: hidden;
}

.carousel-inner img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.5s ease;
}

.carousel-inner img:hover {
    transform: scale(1.03);
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.project-gallery .stats {
    font-size: 0.9rem;
    color: var(--OFF-LIGHT);
}

.project-gallery .stats span {
    margin-right: 1rem;
}

.project-gallery h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--light);
}

.project-gallery p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--OFF-LIGHT);
}

/* Tabs Section */
.nav-tabs {
    border-bottom: 1px solid var(--GLASS-BORDER);
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    color: var(--OFF-LIGHT);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--PRIMARY-LIGHT);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tabs .nav-link.active {
    color: var(--light);
    background: var(--primary);
    border-bottom: 3px solid var(--PRIMARY-LIGHT);
}

.tab-content {
    background: transparent;
}

.tab-content h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--light);
}

.tab-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--OFF-LIGHT);
}

.tab-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Code Blocks */
pre {
    background: #2d2d2d;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--GLASS-BORDER);
    font-size: 0.9rem;
    color: var(--light);
    overflow-x: auto;
}

code {
    font-family: 'Courier New', Courier, monospace;
}

/* Project Info */
.project-info {
    font-size: 0.9rem;
}

.progress-bar-container label {
    font-size: 0.85rem;
    color: var(--OFF-LIGHT);
    margin-bottom: 0.5rem;
    display: block;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    margin-bottom: 1.2rem;
    position: relative;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--PRIMARY-LIGHT));
    transition: width 0.5s ease;
}

.progress-percent {
    font-weight: 500;
    color: var(--light);
    margin-left: 0.5rem;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--OFF-LIGHT);
    margin-bottom: 0.6rem;
}

.info-list i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.info-list span {
    font-weight: 500;
    color: var(--light);
}

.project-actions .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.project-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(110, 69, 226, 0.3);
}

/* Comment Section */
.comment-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--light);
}

.comment-form textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--GLASS-BORDER);
    color: var(--light);
    border-radius: 8px;
    resize: vertical;
}

.comment-form textarea::placeholder {
    color: var(--OFF-LIGHT);
}

.comment-form .btn {
    border-radius: 50px;
}

.comment {
    margin-bottom: 1.5rem;
}

.comment-bubble {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    max-width: 100%;
}

.comment-bubble::before {
    content: '';
    position: absolute;
    top: 10px;
    left: -10px;
    border: 5px solid transparent;
    border-right-color: rgba(255, 255, 255, 0.05);
}

.creator-comment .comment-bubble {
    background: rgba(110, 69, 226, 0.2);
}

.creator-comment .comment-bubble::before {
    border-right-color: rgba(110, 69, 226, 0.2);
}

.comment-author {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--light);
    margin-bottom: 0.2rem;
}

.creator-badge {
    font-size: 0.75rem;
    background: var(--primary);
    color: var(--light);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
}

.comment-text {
    font-size: 0.9rem;
    color: var(--OFF-LIGHT);
    line-height: 1.6;
}

.comment small {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Sidebar */
.sidebar-right {
    text-align: center;
    padding: 1.5rem;
}

.user-photo img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 2px solid var(--primary);
    transition: all 0.3s ease;
}

.user-photo img:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(110, 69, 226, 0.3);
}

.user-stats span {
    font-size: 0.9rem;
    color: var(--OFF-LIGHT);
}

.user-actions .btn {
    padding: 0.6rem;
    font-size: 0.9rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.user-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(110, 69, 226, 0.3);
}

/* Related Projects */
.related-projects h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 1.2rem;
}

.project-card {
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(110, 69, 226, 0.2);
}

.project-thumbnail {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.project-image {
    width: 100%;
    object-fit: cover;
}

.project-stats {
    top: 0.5rem;
    right: 0.5rem;
}

.project-info {
    background: transparent;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--light);
}

.project-category {
    font-size: 0.8rem;
    background: var(--primary);
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
}

.project-creator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.creator-avatar img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.creator-name {
    font-size: 0.9rem;
    color: var(--light);
}

.creator-title {
    font-size: 0.8rem;
    color: var(--OFF-LIGHT);
}

/* Footer */
.footer {
    margin-top: 3rem;
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-brand p {
    font-size: 0.9rem;
    color: var(--OFF-LIGHT);
}

.footer-links ul {
    padding: 0;
    list-style: none;
}

.footer-links a {
    font-size: 0.9rem;
    color: var(--OFF-LIGHT);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-social a {
    font-size: 1.1rem;
    color: var(--OFF-LIGHT);
    margin-right: 0.8rem;
}

.footer-social a:hover {
    color: var(--primary);
}

.footer-bottom {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--OFF-LIGHT);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .project-gallery h3 {
        font-size: 1.5rem;
    }

    .tab-content h2 {
        font-size: 1.4rem;
    }

    .carousel-inner img {
        height: 300px;
    }

    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    /* General Layout */
    .container.mt-5.pt-5 {
        margin-top: 3rem;
        padding-top: 3rem;
    }

    .row {
        display: flex;
        flex-direction: column; /* Stack columns vertically */
        flex-wrap: nowrap;
    }

    .col-md-8,
    .col-md-4 {
        width: 100%; /* Full-width columns */
        max-width: 100%;
        flex: 0 0 100%;
        padding: 0 0.75rem;
    }

    /* Section Ordering */
    .section-project-gallery {
        order: 1;
        /* background: rgba(255, 0, 0, 0.1); */ /* Debug: Red tint */
    }

    .section-tabs {
        order: 2;
        /* background: rgba(0, 255, 0, 0.1); */ /* Debug: Green tint */
    }

    .section-comments {
        order: 6;
        /* background: rgba(0, 0, 255, 0.1); */ /* Debug: Blue tint */
    }

    .section-sidebar {
        order: 3;
        /* background: rgba(255, 255, 0, 0.1); */ /* Debug: Yellow tint */
    }

    .section-project-info {
        order: 4;
        /* background: rgba(255, 0, 255, 0.1); */ /* Debug: Magenta tint */
    }

    .section-related-projects {
        order: 5;
        /* background: rgba(0, 255, 255, 0.1); */ /* Debug: Cyan tint */
    }

    /* Project Gallery */
    .project-gallery {
        padding: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .carousel-inner img {
        height: 250px; /* Increase height for better visibility */
        object-fit: cover;
        border-radius: 6px;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 10%; /* Wider touch area for easier tapping */
        background: rgba(0, 0, 0, 0.5);
        border-radius: 6px;
    }

    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 24px; /* Larger icons for visibility */
        height: 24px;
    }

    .project-gallery .stats {
        font-size: 0.85rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .project-gallery .stats span {
        margin-right: 0.5rem;
    }

    .project-gallery h3 {
        font-size: 1.4rem; /* Slightly smaller for mobile */
        margin: 0.75rem 0;
    }

    .project-gallery p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    /* Project Info */
    .project-info {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .progress-bar-container label {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    .progress {
        height: 6px; /* Slightly thinner for mobile */
        margin-bottom: 1rem;
    }

    .progress-percent {
        font-size: 0.8rem;
    }

    .info-list li {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .info-list i {
        font-size: 0.9rem;
    }

    .project-actions .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        border-radius: 25px;
        width: 100%; /* Full-width buttons for easier tapping */
        margin-bottom: 0.5rem;
    }

    .project-actions .btn:last-child {
        margin-bottom: 0;
    }

    /* Sidebar Right */
    .sidebar-right {
        padding: 1rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }

    .user-photo img {
        width: 90px; /* Slightly larger for visibility */
        height: 90px;
        border-width: 2px;
    }

    .user-stats span {
        font-size: 0.85rem;
        display: inline-block;
        margin: 0.5rem;
    }

    .user-actions .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        border-radius: 25px;
        width: 100%; /* Full-width for easier tapping */
        margin-bottom: 0.5rem;
    }

    .user-actions .btn:last-child {
        margin-bottom: 0;
    }

    /* Tabs Section */
    .tabs-section {
        margin-top: 1.5rem;
    }

    .nav-tabs {
        padding-bottom: 0.5rem; /* Space for scroll bar */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .nav-tabs .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        border-radius: 6px 6px 0 0;
        white-space: nowrap;
    }

    .nav-tabs .nav-link.active {
        border-bottom: 2px solid var(--PRIMARY-LIGHT);
    }

    .tab-content {
        padding: 1rem;
    }

    .tab-content h2 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    .tab-content p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .tab-content img {
        max-width: 100%;
        height: auto;
        border-radius: 6px;
    }

    .tab-content pre {
        font-size: 0.8rem;
        padding: 1rem;
        border-radius: 6px;
    }

    /* Related Projects */
    .related-projects {
        margin-top: 1.5rem;
    }

    .related-projects h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

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

    .project-thumbnail {
        padding-top: 56.25%; /* 16:9 aspect ratio */
    }

    .project-image {
        height: 100%;
        object-fit: cover;
        border-radius: 6px 6px 0 0;
    }

    .project-stats {
        top: 0.5rem;
        right: 0.5rem;
    }

    .stat-item {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .project-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .project-category {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .project-creator {
        gap: 0.5rem;
    }

    .creator-avatar img {
        width: 30px;
        height: 30px;
    }

    .creator-name {
        font-size: 0.85rem;
    }

    .creator-title {
        font-size: 0.75rem;
    }



    /* Comments */
    .comment-section {
        color: aliceblue;
    }

    .comment-section h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .comment-form {
        padding: 0.75rem;
    }

    .comment-form textarea {
        font-size: 0.9rem;
        padding: 0.75rem;
        border-radius: 6px;
        min-height: 100px;
    }

    .comment-form .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        border-radius: 25px;
        width: 100%; /* Full-width for easier tapping */
    }

    .comment-bubble {
        max-width: 100%; /* Full-width for better readability */
        padding: 0.75rem;
        border-radius: 8px;
    }

    .comment-bubble::before {
        left: -8px; /* Adjust arrow position */
        border-width: 4px;
    }

    .comment-author {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .creator-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }

    .comment-text {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .comment small {
        font-size: 0.75rem;
    }
}



.comment-form {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.comment-form:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.comment-textarea {
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    border-radius: 8px !important;
    color: #fff !important;
    padding: 1rem !important;
    resize: none;
    transition: all 0.3s ease;
}

.comment-textarea:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25) !important;
    outline: none;
}

.comment-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.btn-post-comment {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-post-comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

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

.char-counter {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.textarea-actions {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.comment-textarea:focus ~ .textarea-actions {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .comment-form {
        padding: 1rem;
    }
    
    .btn-post-comment {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}