/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #fff;
    min-height: 100vh;
}

.chess-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 15px 15px;
    opacity: 0.3;
    z-index: -1;
}

/* Container */
.container {
    max-width: 614px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #000;
    border-bottom: 1px solid #333;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.profile-pic {
    margin-right: 2rem;
}

.avatar {
    width: 77px;
    height: 77px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #dbdbdb;
}

.profile-info {
    flex: 1;
}

.name-and-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.username {
    font-size: 1.75rem;
    font-weight: 300;
    margin: 0;
}

.stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 0.75rem;
}

.stats span {
    font-size: 0.9rem;
}

.bio {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #8e8e8e;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: #333;
    text-decoration: none;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.social-link:hover {
    color: #ff0000;
}

.social-link:nth-child(2):hover {
    color: #e1306c;
}



/* Feed section */
.feed {
    padding: 1rem 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-width: 614px;
    margin: 0 auto;
}

.post {
    background: #000;
    border: 1px solid #333;
    overflow: hidden;
    aspect-ratio: 5 / 4;
    position: relative;
}

.post:hover {
    opacity: 0.8;
}

.post-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.post-image {
    width: 100%;
    height: 100%;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.post-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}

.card-icon {
    font-size: 3rem;
}

.chess-board-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #8b4513, #daa520);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-board {
    font-family: monospace;
    font-size: 0.6rem;
    line-height: 0.8;
    text-align: center;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.placeholder-content {
    text-align: center;
    color: #8e8e8e;
}

.placeholder-content i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.placeholder-content p {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Modal for post details */
.post-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.post-modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dbdbdb;
}

.modal-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    margin-right: 0.75rem;
}

.modal-username {
    font-weight: 600;
    font-size: 0.9rem;
}

.modal-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.modal-body {
    display: flex;
    max-height: 70vh;
}

.modal-image {
    flex: 1;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 400px;
}

.modal-sidebar {
    width: 300px;
    border-left: 1px solid #dbdbdb;
    display: flex;
    flex-direction: column;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dbdbdb;
}

.modal-action-buttons {
    display: flex;
    gap: 1rem;
}

.modal-action-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-action-btn:hover {
    color: #e1306c;
}

.modal-bookmark-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
}

.modal-likes {
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.modal-caption {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    flex: 1;
    overflow-y: auto;
}

.play-link {
    color: #00376b;
    text-decoration: none;
    font-weight: 600;
}

.heart-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    animation: heartPop 1s ease-out;
    pointer-events: none;
    z-index: 1000;
}

@keyframes heartPop {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0;
    }
}



/* Responsive design */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 10px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-pic {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .stats {
        justify-content: center;
    }

    .stories-container {
        padding: 0.5rem;
    }

    .posts-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .mini-board {
        font-size: 1rem;
    }
}
