:root {
    --primary-bg: #1a1a1a;
    --secondary-bg: #2b2b2b;
    --primary-text: #e0e0e0;
    --secondary-text: #a0a0a0;
    --accent-color: #007bff;
    --border-color: #444;
    --twitter-blue: #1DA1F2;
    --instagram-gradient-start: #833AB4;
    --instagram-gradient-middle: #F56040;
    --instagram-gradient-end: #FCAF45;
    --tiktok-red: #FE2C55;
    --tiktok-blue: #25F4EE;
    --success-green: #28a745;
    --warning-yellow: #ffc107;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--primary-bg);
    color: var(--primary-text);
    line-height: 1.6;
    overscroll-behavior-y: contain;
}

#app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

header h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 2rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

header h1 .fas {
    font-size: 1.8rem;
    color: var(--accent-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

header p {
    font-size: 1.2rem;
    color: var(--secondary-text);
}

/* Upload Button */
.upload-button {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--accent-color), #0056b3);
    color: white;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.upload-button i {
    margin-right: 0.5rem;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Simulations Container */
#simulations-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 3rem;
}

/* Post Wrapper */
.post-wrapper {
    background-color: var(--primary-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.post-wrapper:hover {
    transform: translateY(-2px);
}

.post-wrapper h2 {
    text-align: center;
    padding: 1rem;
    background-color: var(--secondary-bg);
    font-size: 1.2rem;
    color: var(--primary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.post-wrapper h2 i {
    font-size: 1.4rem;
}

#twitter-wrapper h2 i { color: var(--twitter-blue); }
#instagram-wrapper h2 i { 
    background: linear-gradient(45deg, var(--instagram-gradient-start), var(--instagram-gradient-middle), var(--instagram-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
#tiktok-wrapper h2 i { color: var(--tiktok-red); }

/* Post Container (Light theme for social posts) */
.post-container {
    background-color: #ffffff;
    color: #222222;
    padding: 1rem;
}

/* Twitter Specific Styles */
#twitter-post {
    padding: 1.5rem;
}

#twitter-post .post-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

#twitter-post .user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

#twitter-post .username {
    font-weight: 700;
    color: #0f1419;
    font-size: 1rem;
}

#twitter-post .handle, #twitter-post .time {
    color: #536471;
    font-size: 0.9rem;
}

#twitter-post .post-text {
    color: #0f1419;
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

#twitter-post .twitter-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #eff3f4;
    margin-top: 1rem;
}

#twitter-post .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #536471;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s;
}

#twitter-post .stat-item:hover {
    color: var(--twitter-blue);
}

/* Instagram Specific Styles */
#instagram-post {
    padding: 0;
}

#instagram-post .post-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #efefef;
}

#instagram-post .user-info {
    flex: 1;
    margin-left: 1rem;
}

#instagram-post .username {
    font-weight: 600;
    color: #262626;
    font-size: 0.9rem;
    display: block;
}

#instagram-post .location {
    font-size: 0.8rem;
    color: #8e8e8e;
}

#instagram-post .more-options {
    color: #262626;
    cursor: pointer;
}

#instagram-post .post-body {
    margin: 0;
}

#instagram-post .post-footer {
    padding: 1rem;
}

#instagram-post .insta-icons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

#instagram-post .left-icons,
#instagram-post .right-icons {
    display: flex;
    gap: 1rem;
}

#instagram-post .insta-icons i {
    cursor: pointer;
    transition: transform 0.2s;
}

#instagram-post .insta-icons i:hover {
    transform: scale(1.1);
}

#instagram-post .likes {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #262626;
}

#instagram-post .caption {
    color: #262626;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

#instagram-post .comments {
    color: #8e8e8e;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

#instagram-post .post-time {
    color: #8e8e8e;
    font-size: 0.7rem;
    text-transform: uppercase;
}

/* TikTok Specific Styles */
#tiktok-post {
    position: relative;
    padding: 0;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
    background-color: #000;
    overflow: hidden;
}

.tiktok-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.tiktok-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%);
}

.tiktok-content {
    flex: 1;
    padding-right: 1rem;
}

.tiktok-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.tiktok-content .username {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.follow-btn {
    background-color: var(--tiktok-red);
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.tiktok-content .post-text {
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.music-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-size: 0.8rem;
}

.music-info i {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.tiktok-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    color: #fff;
}

.sidebar-profile {
    margin-bottom: 0.5rem;
}

.sidebar-profile .profile-pic {
    width: 48px;
    height: 48px;
    border: 2px solid #fff;
}

.sidebar-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    text-align: center;
}

.sidebar-icon i {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.sidebar-icon i:hover {
    transform: scale(1.2);
}

.sidebar-icon span {
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.music-disc {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Common Elements */
.profile-pic-container {
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.profile-pic-container:hover {
    transform: scale(1.05);
}

.profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #dbdbdb;
}

.post-image {
    width: 100%;
    display: block;
    object-fit: cover;
    max-height: 600px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background-color: var(--secondary-bg);
    gap: 1rem;
}

.action-buttons button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    flex: 1;
    justify-content: center;
}

.edit-btn {
    background-color: var(--warning-yellow);
    color: #000;
}

.edit-btn:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
}

.edit-btn.editing {
    background-color: var(--success-green);
    color: #fff;
}

.save-btn {
    background-color: var(--accent-color);
    color: #fff;
}

.save-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Editable styles */
[contenteditable="true"] {
    outline: 2px dashed var(--accent-color);
    padding: 0.2rem;
    border-radius: 4px;
    background-color: rgba(0, 123, 255, 0.05);
    cursor: text;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--secondary-text);
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: #0056b3;
}

footer .version {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--secondary-text);
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .post-wrapper {
        margin-bottom: 2rem;
    }
    
    #tiktok-post {
        min-height: 500px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
}