/* YouTube Post Designer Styles */

/* Override grid layout for YouTube Post Editor */
body:has(.youtube-post-preview) .editor-container {
    grid-template-columns: 0.4fr 0.6fr;
}

.input-group {
    margin-bottom: 15px;
}

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

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

/* Hide number input spinners */
.input-group input[type="number"]::-webkit-outer-spin-button,
.input-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-group input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.3);
}

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

/* Preview section header controls */
.preview-section .header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* YouTube Post Preview */
.youtube-post-preview {
    background: #0f0f0f;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #272727;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.youtube-post-preview.light-theme {
    background: #ffffff;
    border-color: #e0e0e0;
}

.youtube-post-preview.light-theme .post-header {
    background: #ffffff;
    border-color: #e0e0e0;
}

.youtube-post-preview.light-theme .channel-name {
    color: #030303;
}

.youtube-post-preview.light-theme .post-content {
    background: #ffffff;
    color: #030303;
}

.youtube-post-preview.light-theme .post-actions {
    background: #ffffff;
}

.youtube-post-preview.light-theme .post-image-container {
    background: #ffffff;
}

.youtube-post-preview.light-theme .action-btn {
    color: #606060;
}

.youtube-post-preview.light-theme .post-menu {
    color: #606060;
}

.youtube-post-preview.light-theme .post-timestamp {
    color: #909090;
}

.preview-content {
    padding: 15px;
    background: #36393f;
    border-radius: 6px;
    border: 1px solid #202225;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.5;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    height: fit-content;
    min-height: auto;
}

/* Post Header */
.post-header {
    padding: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: #0f0f0f;
}

.channel-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.channel-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.channel-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.channel-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.channel-name {
    font-weight: 500;
    color: #ffffff;
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.post-menu {
    color: #aaaaaa;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-menu:hover {
    background-color: #272727;
}

/* Post Content */
.post-content {
    padding: 0;
    background: #0f0f0f;
    color: #ffffff;
    font-size: 16px;
    line-height: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-top: 4px;
}

.post-content p {
    margin: 0;
    padding: 0;
}

/* Post Image Container */
.post-image-container {
    padding: 0 68px 16px;
    background: #0f0f0f;
}

.post-image {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    aspect-ratio: 1 / 1;
    min-height: 200px;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #909090;
    font-size: 12px;
}

.image-placeholder svg {
    color: #909090;
}

/* Post Actions */
.post-actions {
    padding: 8px 16px 8px 68px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0f0f0f;
}

.action-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #aaaaaa;
    border-radius: 18px;
    height: fit-content;
}

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

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

.like-count,
.comment-count {
    font-size: 14px;
    font-weight: 500;
    color: #aaaaaa;
    min-width: 20px;
}

.action-btn:hover .like-count,
.action-btn:hover .comment-count {
    color: #ffffff;
}

.post-timestamp {
    color: #aaaaaa;
    font-size: 12px;
    line-height: 18px;
}

/* Watermark Container */
.watermark-container {
    background: #0f0f0f;
    padding: 14px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.youtube-post-preview.light-theme .watermark-container {
    background: #ffffff;
}

/* Watermark */
.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;
}

.youtube-post-preview.light-theme .watermark-logo {
    filter: brightness(0) invert(0);
}

.watermark-text {
    font-size: 0.7rem;
    color: #71767b;
    opacity: 0.7;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.youtube-post-preview.light-theme .watermark-text {
    color: #71767b;
}

/* 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);
}

/* Textarea Container */
.textarea-container {
    position: relative;
    width: 100%;
}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 0.8rem;
    color: #72767d;
    background: rgba(47, 49, 54, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

.input-group textarea {
    width: 100%;
    padding: 10px;
    padding-bottom: 30px;
    border: 1px solid #202225;
    border-radius: 4px;
    background: #40444b;
    color: #dcddde;
    font-size: 0.9rem;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transition: border-color 0.2s ease;
    resize: vertical;
    min-height: 120px;
    overflow-y: auto;
    box-sizing: border-box;
}

.input-group textarea:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.3);
}

/* Upload Button */
.upload-button {
    width: 100%;
    padding: 10px;
    background: #ff0000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #ffffff;
    transition: all 0.2s ease;
    font-weight: 500;
    text-align: center;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.upload-button:hover {
    background: #cc0000;
    transform: translateY(-1px);
}

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

.upload-info {
    font-size: 0.8rem;
    color: #72767d;
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .container {
        padding: 15px;
        min-width: auto;
    }

    .header-controls {
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }

    .youtube-post-preview {
        max-width: 100%;
    }
}

/* Hover Effects */
.youtube-post-preview:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.input-group input:hover,
.input-group select:hover {
    background: #454950;
}

/* Scrollbar styling */
.input-group textarea::-webkit-scrollbar {
    width: 8px;
}

.input-group textarea::-webkit-scrollbar-track {
    background: #2f3136;
    border-radius: 4px;
}

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

.input-group textarea::-webkit-scrollbar-thumb:hover {
    background: #5d6269;
}

