/* Instagram Post Designer Styles */

.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 {
    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;
}

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

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

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

/* Instagram Post Preview */
.instagram-post-preview {
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    border: 1px solid #dbdbdb;
    width: 452px;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 1px rgba(0,0,0,.0975);
}

.instagram-post-preview.dark-theme {
    background: #000000;
    border-color: #262626;
}

.instagram-post-preview.dark-theme .post-header {
    background: #000000;
    border-color: #262626;
}

.instagram-post-preview.dark-theme .post-actions {
    background: #000000;
}

.instagram-post-preview.dark-theme .post-likes {
    background: #000000;
    color: #ffffff;
}

.instagram-post-preview.dark-theme .post-caption {
    background: #000000;
    color: #ffffff;
}

.instagram-post-preview.dark-theme .post-hashtags {
    background: #000000;
    color: #ffffff;
}

.instagram-post-preview.dark-theme .post-timestamp {
    background: #000000;
    color: #8e8e8e;
}

.instagram-post-preview.dark-theme .username {
    color: #ffffff;
}

.instagram-post-preview.dark-theme .options {
    color: #ffffff;
}

.instagram-post-preview.dark-theme .action-btn {
    color: #ffffff;
}

.instagram-post-preview.dark-theme .like-count,
.instagram-post-preview.dark-theme .comment-count,
.instagram-post-preview.dark-theme .reblog-count,
.instagram-post-preview.dark-theme .share-count {
    color: #ffffff;
}

.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;
}

/* Preview Container für verschiedene Formate */
.preview-content .instagram-post-preview {
    overflow: visible;
}

/* Post Header */
.post-header {
    padding: 14px 16px;
    border-bottom: 1px solid #efefef;
    background: #ffffff;
    display: flex;
    align-items: center;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    border: 1px solid #3f3f3f;
    box-shadow: 0 0 0 1px rgba(0,0,0,.0975);
}

.username {
    font-weight: 600;
    color: #262626;
    flex: 1;
    font-size: 14px;
    line-height: 18px;
}

.options {
    color: #262626;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    line-height: 18px;
}

/* Post Image */
.post-image {
    width: 100%;
    aspect-ratio: 1;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Instagram Aspect Ratios */
.post-image.aspect-1-1 {
    aspect-ratio: 1 / 1; /* 1080x1080 - Square */
    width: 450px;
    height: 450px;
}

.post-image.aspect-4-5 {
    aspect-ratio: 4 / 5; /* 1080x1350 - Portrait */
    width: 450px;
    height: 500px;
}

.post-image.aspect-1-91-1 {
    aspect-ratio: 1.91 / 1; /* 1080x566 - Landscape */
    width: 450px;
    height: 250px;
}

.post-image.aspect-9-16 {
    aspect-ratio: 9 / 16; /* 1080x1920 - Story/Reel */
    width: 450px;
    height: 650px;
}

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

.image-placeholder svg {
    color: #8e8e8e;
}

/* Post Actions */
.post-actions {
    padding: 12px 16px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.action-buttons {
    display: flex;
    gap: 18px;
}

.action-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    transform: scale(1.1);
}

.like-count,
.comment-count,
.reblog-count,
.share-count {
    font-size: 14px;
    font-weight: 600;
    color: #262626;
    margin-left: 2px;
    display: none;
}

.like-count:not(:empty),
.comment-count:not(:empty),
.reblog-count:not(:empty),
.share-count:not(:empty) {
    display: inline;
}

.like-btn {
    color: #262626;
}

.comment-btn,
.share-btn {
    color: #262626;
}

.save-btn {
    color: #262626;
}

/* Post Content */

.post-caption {
    padding: 0 16px 8px;
    background: #ffffff;
    color: #262626;
    font-size: 14px;
    line-height: 18px;
}

.post-caption .username {
    font-weight: 600;
}

.post-hashtags {
    padding: 0 16px 8px;
    background: #ffffff;
    color: #00376b;
    font-size: 14px;
    line-height: 18px;
}

.post-timestamp {
    padding: 0 16px 12px;
    background: #ffffff;
    color: #8e8e8e;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    line-height: 12px;
}

/* Text Overlay */
.text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.text-overlay.top {
    align-items: flex-start;
    padding-top: 40px;
}

.text-overlay.center {
    align-items: center;
}

.text-overlay.bottom {
    align-items: flex-end;
    padding-bottom: 40px;
}

.text-overlay.small {
    font-size: 16px;
}

.text-overlay.medium {
    font-size: 20px;
}

.text-overlay.large {
    font-size: 24px;
}

.text-overlay.xlarge {
    font-size: 28px;
}

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

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

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

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

/* 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: 80px;
    overflow-y: auto;
    box-sizing: border-box;
}

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

/* Theme Toggle Button */
.theme-toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: #40444b;
    border: 1px solid #202225;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #dcddde;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.theme-toggle-button:hover {
    background: #454950;
    border-color: #5865f2;
    color: #5865f2;
}

.theme-toggle-button:active {
    transform: scale(0.95);
}

.theme-toggle-button.dark-mode {
    background: #5865f2;
    border-color: #5865f2;
    color: #ffffff;
}

.theme-toggle-button.dark-mode:hover {
    background: #4752c4;
    border-color: #4752c4;
}

/* Side by side inputs */
.side-by-side-inputs {
    display: flex;
    gap: 15px;
}

.input-half {
    flex: 1;
}

.input-half label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #dcddde;
}

.input-half select {
    width: 100%;
    padding: 12px;
    border: 1px solid #40444b;
    border-radius: 8px;
    background: #40444b;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

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

/* Upload Button */
.upload-button {
    width: 100%;
    padding: 10px;
    background: #5865f2;
    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: #4752c4;
    transform: translateY(-1px);
}

.upload-button:active {
    background: #3c45a5;
    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;
    }

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

    .button-group {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        margin-right: 0;
        margin-bottom: 8px;
    }
}

/* Hover Effects */
.instagram-post-preview:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

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

/* Scrollbar styling */
.saved-posts-list::-webkit-scrollbar {
    width: 8px;
}

.saved-posts-list::-webkit-scrollbar-track {
    background: #2f3136;
    border-radius: 4px;
}

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

.saved-posts-list::-webkit-scrollbar-thumb:hover {
    background: #5d6269;
}

.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;
}
