@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    list-style: none;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

:root {
    --nav-bg-color: rgba(255, 255, 255, 0.1);
    --bg-color: #171f2b;
    --second-bg-color: #1f2733;
    --third-bg-color: #2d3542;
    --main-color: #0ef;
    --main-color2: #00abf0;
    --white-color: #fff;
    --tab-list-color: #7c8594;
}

::selection {
    background: var(--main-color);
    color: var(--bg-color);
}

::-webkit-scrollbar {
    width: 0.5rem;
}

::-webkit-scrollbar-thumb {
    background: var(--main-color);
    border-radius: 1rem;
}

html {
    font-size: 62.5%;
}

body {
    background: var(--bg-color);
    color: var(--white-color);
    min-height: 100vh;
    overflow-x: hidden;
}

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-color);
}

/* Blog Header Sticky Styles with Scroll Effects */
.blog-header {
    background: linear-gradient(135deg, var(--main-color2), var(--main-color));
    color: var(--bg-color);
    padding: 2rem 2rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* Scroll effect - header becomes smaller when scrolling */
.blog-header.scrolled {
    padding: 1rem 2rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

.blog-header.scrolled h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.blog-header.scrolled .blog-nav {
    gap: 1rem;
}

.blog-header h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
    transition: font-size 0.3s ease;
}

.blog-header h1 i {
    margin-right: 1rem;
}

.blog-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    position: relative;
    z-index: 2;
    transition: gap 0.3s ease;
}

/* Header Buttons - All Same Style */
.portfolio-btn,
.blog-btn {
    background: var(--bg-color);
    color: var(--main-color);
    border: none;
    padding: 1rem 2rem;
    border-radius: 5rem;
    cursor: pointer;
    font-size: 1.6rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 0 1rem var(--main-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.portfolio-btn:hover,
.blog-btn:hover {
    background: var(--main-color);
    color: var(--bg-color);
    box-shadow: 0 0 2rem var(--main-color);
    transform: translateY(-2px);
}

.blog-nav-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.blog-main {
    padding: 3rem 2rem;
}

/* Blog Post Styles */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.blog-post {
    background: var(--second-bg-color);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
    border-left: 0.4rem solid var(--main-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-0.5rem);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.4);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--third-bg-color);
}

.post-author {
    font-weight: 700;
    color: var(--main-color);
    font-size: 1.8rem;
}

.post-date {
    color: var(--tab-list-color);
    font-size: 1.4rem;
}

.post-title {
    font-size: 2.2rem;
    color: var(--white-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.post-content {
    line-height: 1.7;
    color: var(--white-color);
    margin-bottom: 2rem;
    font-size: 1.6rem;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* NEW: Rating Container Styles */
.rating-container {
    background: var(--third-bg-color);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    border: 1px solid rgba(0, 239, 255, 0.2);
    width: 100%;
}

/* Global Rating Section */
.global-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(124, 133, 148, 0.3);
}

.average-stars {
    font-size: 1.8em;
    letter-spacing: 3px;
}

.average-star {
    color: var(--tab-list-color);
    transition: color 0.3s ease;
}

.average-star.filled {
    color: #ffc107;
}

.rating-info {
    text-align: right;
}

.average-value {
    font-size: 1.6em;
    font-weight: bold;
    color: var(--main-color);
    display: block;
}

.total-ratings {
    font-size: 1.2em;
    color: var(--tab-list-color);
}

/* Personal Rating Section */
.personal-rating {
    text-align: center;
}

.rate-this {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rate-label {
    font-weight: 500;
    color: var(--white-color);
    font-size: 1.4em;
}

.personal-stars {
    font-size: 2em;
    letter-spacing: 5px;
}

.personal-star {
    color: var(--tab-list-color);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 3px;
}

.personal-star:hover {
    color: #ffc107;
    transform: scale(1.3);
}

.personal-star.active {
    color: #ffc107;
}

.your-rating {
    font-size: 1.3em;
    color: var(--tab-list-color);
    font-style: italic;
}

/* Comment Rating Styles */
.comment-rating {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(124, 133, 148, 0.3);
}

.comment-global-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 1.3em;
}

.helpful-text {
    color: var(--white-color);
    font-weight: 500;
}

.comment-stars {
    font-size: 1.3em;
    letter-spacing: 2px;
}

.comment-average-star {
    color: var(--tab-list-color);
    transition: color 0.3s ease;
}

.comment-average-star.filled {
    color: #ffc107;
}

.comment-rating-value {
    color: var(--tab-list-color);
    font-size: 1.2em;
}

.comment-personal-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.2em;
}

.rate-comment-text {
    color: var(--tab-list-color);
}

.comment-rate-stars {
    font-size: 1.4em;
    letter-spacing: 3px;
}

.comment-rate-star {
    color: var(--tab-list-color);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 1px;
}

.comment-rate-star:hover {
    color: #ffc107;
    transform: scale(1.2);
}

.comment-rate-star.active {
    color: #ffc107;
}

/* Old rating styles (keep for backward compatibility) */
.rating {
    display: flex;
    gap: 0.5rem;
}

.star {
    color: var(--tab-list-color);
    cursor: pointer;
    font-size: 1.8rem;
    transition: color 0.2s;
}

.star:hover,
.star.active {
    color: #ffc107;
}

.comment-btn {
    background: var(--main-color);
    color: var(--bg-color);
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 1rem;
}

.comment-btn:hover {
    background: var(--main-color2);
}

.comments-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--third-bg-color);
}

.comments-section h4 {
    margin-bottom: 1.5rem;
    color: var(--main-color);
    font-size: 1.8rem;
}

.comment {
    background: var(--third-bg-color);
    padding: 1.5rem;
    border-radius: 0.8rem;
    margin-bottom: 1.5rem;
    border-left: 0.3rem solid var(--main-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.comment-author {
    font-weight: 700;
    color: var(--main-color);
}

.comment-date {
    color: var(--tab-list-color);
}

.comment-content {
    color: var(--white-color);
    line-height: 1.6;
    font-size: 1.5rem;
}

.add-comment {
    margin-top: 1.5rem;
}

.add-comment input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--third-bg-color);
    border-radius: 0.5rem;
    background: var(--third-bg-color);
    color: var(--white-color);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.add-comment input:focus {
    border-color: var(--main-color);
}

.add-comment button {
    background: var(--main-color);
    color: var(--bg-color);
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 600;
    transition: background 0.3s;
}

.add-comment button:hover {
    background: var(--main-color2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--second-bg-color);
    width: 100%;
    max-width: 600px;
    border-radius: 1rem;
    padding: 3rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
    border: 1px solid var(--main-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--third-bg-color);
}

.modal-header h2 {
    color: var(--main-color);
    font-size: 2.4rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--tab-list-color);
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--main-color);
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--white-color);
    font-size: 1.6rem;
}

.form-control {
    width: 100%;
    padding: 1.2rem;
    border: 1px solid var(--third-bg-color);
    border-radius: 0.8rem;
    background: var(--third-bg-color);
    color: var(--white-color);
    font-size: 1.5rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: var(--main-color);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.btn {
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 0.8rem;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--main-color);
    color: var(--bg-color);
}

.btn-primary:hover {
    background: var(--main-color2);
    box-shadow: 0 0 1rem var(--main-color);
}

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

.btn-secondary:hover {
    background: var(--third-bg-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--tab-list-color);
}

.empty-state i {
    font-size: 6rem;
    margin-bottom: 2rem;
    color: var(--third-bg-color);
}

.empty-state h3 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.6rem;
}

/* Admin Mode Styles */
.admin-active {
    background: #ff9800 !important;
    box-shadow: 0 0 1rem #ff9800 !important;
}

.post-actions-admin,
.comment-actions-admin {
    display: flex;
    gap: 0.5rem;
}

.btn-edit,
.btn-delete,
.btn-edit-small,
.btn-delete-small {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.3rem;
    transition: background 0.3s;
}

.btn-edit,
.btn-edit-small {
    color: var(--main-color);
}

.btn-delete,
.btn-delete-small {
    color: #f44336;
}

.btn-edit:hover,
.btn-edit-small:hover {
    background: rgba(0, 239, 255, 0.1);
}

.btn-delete:hover,
.btn-delete-small:hover {
    background: rgba(244, 67, 54, 0.1);
}

.author-email,
.commenter-email {
    font-size: 1.2rem;
    opacity: 0.7;
    margin-left: 0.5rem;
}

.rating-value {
    margin-left: 1rem;
    font-size: 1.4rem;
    color: var(--tab-list-color);
}

/* Enhanced comment header */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.comment-header > div {
    display: flex;
    flex-direction: column;
}

/* Clickable author names */
.post-author,
.comment-author {
    transition: color 0.3s;
    cursor: pointer;
}

.post-author:hover,
.comment-author:hover {
    color: var(--main-color2);
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .blog-header {
        padding: 1.5rem 1rem;
    }

    .blog-header h1 {
        font-size: 2.5rem;
    }

    .blog-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .blog-nav-buttons {
        flex-direction: column;
        width: 100%;
    }

    .portfolio-btn,
    .blog-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .blog-main {
        padding: 2rem 1.5rem;
    }

    .post-header {
        flex-direction: column;
        gap: 1rem;
    }

    .post-actions {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .modal-content {
        padding: 2rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .post-actions-admin,
    .comment-actions-admin {
        flex-direction: column;
    }

    .comment-header {
        flex-direction: column;
        gap: 1rem;
    }

    /* Mobile rating adjustments */
    .rating-container {
        padding: 12px;
    }

    .global-rating {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .rating-info {
        text-align: center;
    }

    .personal-stars {
        font-size: 1.6em;
        letter-spacing: 3px;
    }

    .average-stars {
        font-size: 1.5em;
    }

    .comment-global-rating,
    .comment-personal-rating {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media screen and (max-width: 480px) {
    .blog-header {
        padding: 1rem;
    }

    .blog-header h1 {
        font-size: 2rem;
    }

    .blog-post {
        padding: 2rem;
    }

    .post-title {
        font-size: 2rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .portfolio-btn,
    .blog-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1.4rem;
    }

    /* Mobile rating adjustments */
    .personal-stars {
        font-size: 1.4em;
        letter-spacing: 2px;
    }

    .average-stars {
        font-size: 1.3em;
    }

    .rate-label {
        font-size: 1.2em;
    }

    .comment-rate-stars {
        font-size: 1.2em;
    }
}

.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #2d3542;
    border-top: 5px solid #0ef;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* @media screen and (max-width: 768px) {
    .loading-spinner {
        padding: 2rem;
        min-width: 150px;
        min-height: 150px;
    }

    .spinner {
        width: 40px;
        height: 40px;
    }

    .loading-text {
        font-size: 1.4rem;
        margin-top: 1rem;
    }
} */
