:root {
    --primary-color: #4361ee;
    --primary-light: #4cc9f0;
    --secondary-color: #3f37c9;
    --success-color: #4ad66d;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --border-radius: 12px;
    --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    
    /* Light Mode Colors */
    --bg-color: #ffffff;
    --text-color: #212529;
    --card-bg: #f8f9fa;
    --border-color: #e9ecef;
}


.retweeted {
    color: #00c851 !important;
}


.dark-mode {
    /* Dark Mode Colors */
    --bg-color: #15202b;
    --text-color: #f8f9fa;
    --card-bg: #192734;
    --border-color: #38444d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.main-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.8rem;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.main-nav a:hover {
    color: var(--primary-color);
}

.main-nav i {
    font-size: 1.2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn {
    padding: 8px 20px;
    border-radius: var(--border-radius);
    font-family: 'Tajawal', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1.2rem;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.theme-toggle i {
    position: absolute;
    transition: var(--transition);
    opacity: 0;
}

.theme-toggle .fa-moon {
    opacity: 1;
}

.dark-mode .theme-toggle .fa-moon {
    opacity: 0;
}

.dark-mode .theme-toggle .fa-sun {
    opacity: 1;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
}

/* Main Content */
.main-content {
    padding: 20px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
}

.left-sidebar, .right-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

/* Profile Card */
.profile-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.profile-banner {
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.profile-info {
    padding: 0 20px;
    text-align: center;
    position: relative;
    margin-top: -50px;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--bg-color);
    margin: 0 auto 15px;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h3 {
    margin-bottom: 5px;
}

.profile-info p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
}

.profile-stats div {
    text-align: center;
}

.profile-stats span {
    display: block;
}

.profile-stats span:first-child {
    font-weight: 700;
    font-size: 1.1rem;
}

.profile-stats span:last-child {
    font-size: 0.8rem;
    color: var(--gray-color);
}

/* Trending Topics */
.trending-topics {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.trending-topics h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.trending-topics ul {
    list-style: none;
}

.trending-topics li {
    margin-bottom: 10px;
}

.trending-topics a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.trending-topics a:hover {
    text-decoration: underline;
}

/* Main Feed */
.main-feed {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.compose-post {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    gap: 15px;
    border: 1px solid var(--border-color);
}

.post-avatar {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


.post-input {
    flex-grow: 1;
}
.post-text span {
    display: block;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    line-break: anywhere;
    -webkit-line-break: anywhere;
}



@supports (-webkit-touch-callout: none) {
    .post {
        flex-direction: row !important;
    }
}









/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 50px;
    overflow-y: auto;
}

.modal-box {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    position: relative;
    font-family: 'Tajawal', sans-serif;
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    margin-bottom: 50px;
}

.modal-close {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    z-index: 1;
}

.modal-content {
    padding: 20px;
}

.reply-post {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

/* Adjust the compose post in modal */
.modal-box .compose-post {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 15px;
}

.modal-box .post-input textarea {
    border: none;
    background: transparent;
    padding: 0;
    min-height: 100px;
}
/* Modal Styles */

.suggestion-info a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}






.post-input textarea {
    width: 100%;
    border: none;
    background-color: transparent;
    resize: none;
    height: 80px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    color: var(--text-color);
    padding: 10px;
    margin-bottom: 10px;
}

.post-input textarea:focus {
    outline: none;
}

.post-actions {
    display: flex;
    justify-content: flex-end;
}

.login-prompt {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.login-prompt h3 {
    margin-bottom: 10px;
}

.login-prompt p {
    margin-bottom: 20px;
    color: var(--gray-color);
}

.auth-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Posts */
.post {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    border: 1px solid var(--border-color);
    margin-bottom: 2px;
    overflow: hidden;
}


.post-text a {
    word-break: break-all;
    overflow-wrap: break-word;
    -webkit-line-break: anywhere;
    line-break: anywhere;
}

.post-text span,
.post-text a {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    -webkit-line-break: anywhere;
    line-break: anywhere;
}

.post-content {
    max-width: 100%;
    overflow-x: hidden;
}


.post-header {
    margin-bottom: 10px;
}

.post-author {
    font-weight: 700;
    margin-left: 5px;
}

.post-username, .post-time {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.post-text {
    margin-bottom: 15px;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
    position: relative;
}


.post-actions {
    display: flex;
    justify-content: space-between;
    max-width: 300px;
}

.post-actions button {
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.post-actions button:hover {
    color: var(--primary-color);
}

/* Who to Follow */
.who-to-follow {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.who-to-follow h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.follow-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.follow-suggestion:last-child {
    border-bottom: none;
}

.suggestion-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.suggestion-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-info {
    flex-grow: 1;
}

.suggestion-name {
    font-weight: 500;
    display: block;
}

.suggestion-username {
    font-size: 0.8rem;
    color: var(--gray-color);
}

.show-more {
    display: block;
    margin-top: 10px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.show-more:hover {
    text-decoration: underline;
}

/* Footer Links */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.8rem;
}

.footer-links a {
    color: var(--gray-color);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Main Footer */
.main-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr 2fr;
    }
    
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .left-sidebar {
        display: none;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-actions .btn {
        display: none;
    }
}

@media (max-width: 576px) {
    .auth-buttons {
        flex-direction: column;
    }
    
    .post-actions {
        max-width: 100%;
    }
}



.media-wrapper {
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.media-wrapper img,
.media-wrapper video {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
}








/* تحسين عام للتغريدات */
.tweet {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.tweet:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.dark-mode .tweet:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.tweet-avatar {
    margin-right: 12px;
}

.tweet-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.tweet-content {
    flex: 1;
    min-width: 0;
}

.tweet-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.tweet-author {
    font-weight: 700;
    margin-right: 4px;
    color: var(--text-color);
    text-decoration: none;
}

.tweet-author:hover {
    text-decoration: underline;
}

.tweet-username, .tweet-time {
    color: var(--gray-color);
    font-size: 0.9rem;
    margin-right: 4px;
}

.tweet-text {
    margin-bottom: 12px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

/* تحسين الوسائط */
.tweet-media {
    margin-bottom: 12px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.image-container img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* نسبة 16:9 */
    height: 0;
    background: #000;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* تحسين أزرار التفاعل */
.tweet-actions {
    display: flex;
    justify-content: space-between;
    max-width: 425px;
    margin-top: 12px;
}

.tweet-action {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 8px;
}

.tweet-action:hover {
    color: var(--primary-color);
}

.tweet-action i {
    margin-right: 4px;
}

.tweet-action.reply-btn:hover {
    color: var(--primary-color);
}

.tweet-action.retweet-btn:hover {
    color: #17bf63;
}

.tweet-action.like-btn:hover {
    color: #e0245e;
}

.tweet-action.share-btn:hover {
    color: var(--primary-color);
}


















/* للوسائط المتعددة */
.multi-media {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    border-radius: 16px;
    overflow: hidden;
}

.multi-media .image-container {
    aspect-ratio: 1;
}

.multi-media .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* إذا كانت وسائط متعددة من نوع فيديو */
.multi-media .video-container {
    padding-bottom: 0;
    height: auto;
    aspect-ratio: 16/9;
}









.post-content .media-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.post-content .media-wrapper img,
.post-content .media-wrapper video {
    max-width: 100%;
    border-radius: 16px;
    object-fit: cover;
}
