/* Twitter Post Preview Tool Styles */

/* Input Group Extensions */
.input-group {
    margin-bottom: 15px;
}

/* User Info Section */
.user-info-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #36393f;
    border-radius: 8px;
    border: 1px solid #202225;
}

.user-info-section h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Avatar Upload */
.avatar-upload-area {
    border: 2px dashed #40444b;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #36393f;
}

.avatar-upload-area:hover {
    border-color: #5865f2;
    background: #40444b;
}

.avatar-upload-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.current-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-placeholder-small {
    width: 100%;
    height: 100%;
    background: #1d9bf0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-logo-placeholder-small {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
}

.avatar-upload-text {
    text-align: left;
}

.avatar-upload-text span {
    display: block;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 4px;
}

.avatar-upload-text small {
    color: #b9bbbe;
    font-size: 0.8rem;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #b9bbbe;
    font-size: 0.9rem;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #202225;
    border-radius: 4px;
    background: #40444b;
    color: #dcddde;
    font-size: 0.9rem;
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transition: border-color 0.2s ease;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #5865f2;
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.3);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: #72767d;
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Character Count */
.character-count {
    text-align: right;
    font-size: 0.85rem;
    color: #b9bbbe;
    margin-top: 5px;
}

.character-count.warning {
    color: #faa61a;
}

.character-count.danger {
    color: #f04747;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #40444b;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #36393f;
    position: relative;
    margin-bottom: 15px;
}

.upload-area:hover {
    border-color: #5865f2;
    background: #40444b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.2);
}

.upload-area.dragover {
    border-color: #5865f2;
    background: #40444b;
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.3);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    color: #5865f2;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon {
    opacity: 1;
    transform: scale(1.1);
}

.upload-content h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
}

.upload-content p {
    margin: 0;
    color: #b9bbbe;
    font-size: 0.9rem;
}

.upload-button {
    padding: 10px 20px;
    background: #5865f2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.upload-button:hover {
    background: #4752c4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.upload-button:active {
    transform: translateY(0);
}

/* Media Preview */
.media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.media-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #2f3136;
    border: 1px solid #202225;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.media-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.media-item .remove-btn:hover {
    background: #f04747;
    transform: scale(1.1);
}

/* Post Options */
.post-options {
    margin-top: 20px;
    padding: 15px;
    background: #36393f;
    border-radius: 8px;
    border: 1px solid #202225;
}

.post-options h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #dcddde;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: #ffffff;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #40444b;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    background: #2f3136;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #5865f2;
    border-color: #5865f2;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Hashtag Suggestions */
.hashtag-suggestions {
    margin-top: 15px;
    padding: 15px;
    background: #36393f;
    border-radius: 8px;
    border: 1px solid #202225;
}

.hashtag-suggestions h4 {
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
}

.hashtag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hashtag-btn {
    padding: 6px 12px;
    background: #40444b;
    color: #5865f2;
    border: 1px solid #202225;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 500;
}

.hashtag-btn:hover {
    background: #5865f2;
    color: white;
    transform: translateY(-1px);
}

/* Preview Section */
.preview-content {
    min-height: 400px;
    padding: 15px;
    background: #36393f;
    border-radius: 6px;
    border: 1px solid #202225;
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.5;
    overflow-y: auto;
}

/* Twitter Preview Styles */
.twitter-preview {
    background: #000000;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #2f3336;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.twitter-post {
    padding: 16px;
    background: #000000;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.post-layout {
    display: flex;
    gap: 12px;
}

.avatar-container {
    width: 48px;
    flex-shrink: 0;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: #1d9bf0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-logo-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
}

.content-container {
    flex: 1;
    min-width: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 5px;
    padding: 0;
    border-bottom: none;
}

.display-name {
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    margin: 0;
    text-decoration: none;
}

.username {
    font-size: 15px;
    color: #71767b;
    margin: 0;
    text-decoration: none;
}

.post-time {
    font-size: 15px;
    color: #71767b;
    margin: 0;
}

.post-content {
    margin-bottom: 12px;
}

.post-text {
    font-size: 15px;
    line-height: 1.4;
    color: #ffffff;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.post-text .hashtag {
    color: #1d9bf0;
    text-decoration: none;
}

.post-text .mention {
    color: #1d9bf0;
    text-decoration: none;
}

.post-text .link {
    color: #1d9bf0;
    text-decoration: none;
}

.post-media {
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
    max-width: 100%;
}

.post-media img,
.post-media video {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.post-link {
    margin-top: 12px;
}

.link-preview {
    display: flex;
    flex-direction: column;
    border: 1px solid #2f3336;
    border-radius: 12px;
    overflow: hidden;
    background: #16181c;
}

.link-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.link-preview-content {
    padding: 12px;
}

.link-preview-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    line-height: 1.3;
}

.link-preview-description {
    font-size: 13px;
    color: #71767b;
    margin-bottom: 4px;
    line-height: 1.4;
}

.link-preview-url {
    font-size: 13px;
    color: #71767b;
    text-transform: lowercase;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #71767b;
    font-size: 13px;
    font-weight: 400;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.action-count {
    font-size: 13px;
    color: #71767b;
    min-width: 16px;
    text-align: center;
}

.action-btn:hover {
    background: rgba(29, 155, 240, 0.1);
    color: #1d9bf0;
}

.action-btn svg {
    width: 18px;
    height: 18px;
    transition: all 0.2s ease;
}

/* Specific button hover colors */
.reply-btn:hover {
    background: rgba(29, 155, 240, 0.1);
    color: #1d9bf0;
}

.retweet-btn:hover {
    background: rgba(0, 186, 124, 0.1);
    color: #00ba7c;
}

.like-btn:hover {
    background: rgba(249, 24, 128, 0.1);
    color: #f91880;
}

.views-btn:hover {
    background: rgba(29, 155, 240, 0.1);
    color: #1d9bf0;
}

.share-btn:hover {
    background: rgba(29, 155, 240, 0.1);
    color: #1d9bf0;
}

/* Active states */
.action-btn:active {
    transform: scale(0.95);
}

.action-btn:active svg {
    transform: scale(0.9);
}

/* Custom scrollbar */
.preview-content::-webkit-scrollbar {
    width: 8px;
}

.preview-content::-webkit-scrollbar-track {
    background: #2f3136;
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb {
    background: #4f545c;
    border-radius: 4px;
    border: 1px solid #2f3136;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: #5d6269;
}

/* Firefox scrollbar */
.preview-content {
    scrollbar-width: thin;
    scrollbar-color: #4f545c #2f3136;
}

/* Responsive Design */
@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .container {
        padding: 15px;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: #40444b;
    border: 1px solid #5865f2;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    position: relative;
    width: 29px;
    height: 29px;
}

.theme-toggle-btn:hover {
    background: #5865f2;
    border-color: #4752c4;
}

.theme-toggle-btn:active {
    transform: translateY(1px);
}

.theme-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.moon-icon {
    opacity: 0;
    transform: rotate(180deg);
}

.theme-toggle-btn.dark .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

.theme-toggle-btn.dark .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Light Theme Styles */
.twitter-preview.light-theme {
    background: #ffffff;
    border: 1px solid #e1e8ed;
}

.twitter-preview.light-theme .twitter-post {
    background: #ffffff;
    border: 1px solid #e1e8ed;
}

.twitter-preview.light-theme .display-name {
    color: #14171a;
}

.twitter-preview.light-theme .username,
.twitter-preview.light-theme .post-time {
    color: #657786;
}

.twitter-preview.light-theme .post-text {
    color: #14171a;
}

.twitter-preview.light-theme .post-actions {
    border-top: none;
}

.twitter-preview.light-theme .action-btn {
    color: #657786;
}

.twitter-preview.light-theme .action-btn:hover {
    color: #1da1f2;
}

.twitter-preview.light-theme .link-preview {
    background: #f7f9fa;
    border: 1px solid #e1e8ed;
}

.twitter-preview.light-theme .link-preview:hover {
    background: #f0f8ff;
}

.twitter-preview.light-theme .link-preview-title {
    color: #14171a;
}

.twitter-preview.light-theme .link-preview-description {
    color: #657786;
}

.twitter-preview.light-theme .link-preview-url {
    color: #657786;
}

/* Mobile adjustments for theme toggle */
@media (max-width: 768px) {
    .theme-toggle-btn {
        width: 36px;
        height: 36px;
        padding: 0;
    }
    
    .input-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .media-preview {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .hashtag-list {
        gap: 6px;
    }
    
    .hashtag-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}

/* Watermark Styles */
.watermark-container {
    background: #000000;
    padding: 14px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid #2f3336;
}

.watermark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    text-align: center;
    width: 100%;
    max-width: 120px;
}

.watermark-logo {
    width: 40px;
    height: 20px;
    opacity: 0.7;
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
    display: block;
    margin: 0 auto;
}

.watermark-text {
    font-size: 0.7rem;
    color: #71767b;
    opacity: 0.7;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
    white-space: nowrap;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    letter-spacing: 0.02em;
}

/* Light theme watermark styles */
.twitter-preview.light-theme .watermark-container {
    background: #ffffff;
    border-top: 1px solid #e1e8ed;
}

.twitter-preview.light-theme .watermark-logo {
    filter: brightness(0) invert(0);
    opacity: 0.8;
}

.twitter-preview.light-theme .watermark-text {
    color: #536471;
    opacity: 0.8;
}

/* Animation for new content */
.post-text.updated {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
