/* Primary Color Variables */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary-color: #10b981;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --gray-color: #9ca3af;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --text-color: #334155;
    --card-border-radius: 0.75rem;
    --button-radius: 0.5rem;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* General Styles */
body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    color: var(--text-color);
}

/* Content Container */
.content-container {
    margin-top: 5rem;
    padding: 0 0.5rem;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}

/* Create Post Styles */
.create-post {
    background-color: white;
    border-radius: var(--card-border-radius);
    padding: 0.4rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s;
}

.create-post:hover {
    transform: translateY(-2px);
}

.create-post-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.create-post-input input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    background-color: #f9fafb;
    transition: border 0.2s;
}

.create-post-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
}

.create-post-actions {
    display: flex;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
    justify-content: space-around;
}

.post-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--button-radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.post-action-btn:hover {
    background-color: #f3f4f6;
}

.photo-action {
    color: var(--secondary-color);
}

.profile-img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.profile-img-sm {
    width: 2rem;
    height: 2rem;
}

.profile-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0.75rem;
    height: 0.75rem;
    background-color: var(--success-color);
    border: 2px solid white;
    border-radius: 50%;
}

/* Posts Container */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post {
    background-color: white;
    border-radius: var(--card-border-radius);
    padding: 1rem;
    box-shadow: var(--box-shadow);
    transition: box-shadow 0.3s;
}

.post:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.3rem;
}

.post-user-info {
    margin-left: 0.75rem;
}

.post-username {
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
}

.post-timestamp {
    color: var(--gray-color);
    font-size: 0.75rem;
    margin: 0;
}

.post-content {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.2rem;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.post-content.truncated {
    max-height: 4.5rem;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.25rem;
}

.post-content.truncated::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1.5rem;
    background: linear-gradient(transparent, white);
}

.read-more-btn {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
    display: block;
    margin-top: 0;
    position: relative;
    margin-bottom: 1rem;
}

.post-media {
    width: 100%;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    max-height: 70vh;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-media:hover {
    opacity: 0.9;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
    gap: 0.25rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-radius: var(--button-radius);
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--dark-color);
    flex: 1;
    min-width: 0;
}

.action-btn:hover {
    background-color: #f3f4f6;
}

.like-btn.liked {
    color: var(--primary-color);
}

.like-btn.liked i {
    color: var(--primary-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    padding-top: 2rem;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger-color);
}

/* Empty state styling */
.empty-state {
    background-color: white;
    border-radius: var(--card-border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    margin-top: 1rem;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--gray-color);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-message {
    color: var(--gray-color);
    margin-bottom: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.animate-like {
    animation: likeAnimation 0.3s ease-in-out;
}

/* Video player styles */
.video-container {
    position: relative;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.video-preview {
    width: 100%;
    border-radius: 0.5rem;
    background-color: #000;
    object-fit: cover;
}

.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 4rem;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
}

.video-container:hover .play-button-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Specific fix for video preview thumbnails only */
.video-container .video-preview {
    width: 100%;
    border-radius: 0.5rem;
    background-color: #000;
    max-height: 400px;
    object-fit: contain;
}

/* Add more space after the preview container */
.video-container {
    margin-bottom: 1.5rem;
}

/* Make sure when the video plays, it can have its natural height */
video.post-media {
    max-height: none;
}

/* Loading indicator */
#loadingIndicator {
    text-align: center;
    padding: 20px;
    display: none;
}

/* Login Modal Styles */
#loginModal {
    display: none;
    position: fixed;
    z-index: 1003;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.login-modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: var(--card-border-radius);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-modal-body {
    padding: 2rem;
    text-align: center;
}

.login-modal-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--button-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.login-modal-btn:hover {
    background-color: var(--primary-hover);
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-container {
        padding: 0;
    }

    .post, .create-post {
        border-radius: 0;
    }

    .action-btn {
        background-color: rgba(242, 244, 247, 1.0);
        padding: 5px 20px;
        border-radius: 25px;
        padding: 0.5rem;
    }
}
