/* DmApp Content Creation & Editing Styles */

/* ===== CONTENT EDITOR MODAL ===== */

.content-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.editor-container {
    background: white;
    border-radius: 20px;
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.editor-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.editor-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.editor-close:hover {
    color: #ff0000;
    transform: rotate(90deg);
}

.editor-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
}

#editor-canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

#text-elements-layer,
#sticker-elements-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

#text-elements-layer > *,
#sticker-elements-layer > * {
    pointer-events: all;
}

.text-element,
.sticker-element {
    position: absolute;
    cursor: move;
    user-select: none;
}

.text-element:hover,
.sticker-element:hover {
    outline: 2px dashed #00FF00;
}

.editor-toolbar {
    width: 80px;
    background: #fafafa;
    border-left: 1px solid #e0e0e0;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.toolbar-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toolbar-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 10px 0;
}

.tool-btn {
    width: 60px;
    height: 60px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: #f5f5f5;
    border-color: #00FF00;
    transform: scale(1.1);
}

.tool-btn.active {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.2), rgba(0, 255, 0, 0.1));
    border-color: #00FF00;
}

.tool-options {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    max-height: 200px;
    overflow-y: auto;
}

.text-options,
.draw-options,
.filter-options,
.sticker-options {
    animation: slideIn 0.3s ease-out;
}

.text-options h4,
.draw-options h4,
.filter-options h4,
.sticker-options h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

.text-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}

.text-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.text-select,
.text-number {
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.text-color,
.draw-color {
    width: 60px;
    height: 38px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
}

.btn-add {
    padding: 10px 20px;
    background: linear-gradient(135deg, #00FF00, #00CC00);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.4);
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.sticker-btn {
    width: 50px;
    height: 50px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sticker-btn:hover {
    background: #f5f5f5;
    border-color: #00FF00;
    transform: scale(1.1);
}

.draw-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.draw-slider {
    flex: 1;
    min-width: 150px;
}

.draw-hint {
    font-size: 13px;
    color: #666;
    margin: 10px 0 0 0;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.filter-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    border-color: #00FF00;
    transform: translateY(-2px);
}

.filter-preview {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1);
    border-radius: 8px;
}

.editor-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
}

.btn-cancel {
    padding: 12px 24px;
    background: #f5f5f5;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-save {
    padding: 12px 24px;
    background: linear-gradient(135deg, #00FF00, #00CC00);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 255, 0, 0.4);
}

/* ===== POST CREATOR MODAL ===== */

.post-creator-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.post-creator-container {
    background: white;
    border-radius: 20px;
    width: 95%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.post-creator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.post-creator-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

.post-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.post-close:hover {
    color: #ff0000;
    transform: rotate(90deg);
}

.post-creator-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
}

.post-media-preview {
    position: relative;
    margin-bottom: 20px;
}

.media-preview-img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.edit-media-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.edit-media-btn:hover {
    background: rgba(0, 255, 0, 0.9);
    transform: scale(1.05);
}

.post-media-upload {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.post-media-upload:hover {
    border-color: #00FF00;
    background: rgba(0, 255, 0, 0.05);
}

.upload-label {
    cursor: pointer;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.post-caption-section {
    margin-bottom: 20px;
}

.caption-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.creator-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #00FF00;
}

.creator-info strong {
    display: block;
    font-size: 15px;
}

.creator-info small {
    font-size: 13px;
    color: #666;
}

.post-caption-input {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
}

.post-caption-input:focus {
    outline: none;
    border-color: #00FF00;
}

.caption-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.caption-tool-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.caption-tool-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00FF00;
}

.tagged-section,
.location-chip {
    background: rgba(0, 255, 0, 0.1);
    padding: 10px 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.tagged-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 5px 10px;
    border-radius: 15px;
    margin-right: 8px;
    margin-top: 5px;
    font-size: 13px;
}

.tagged-user-chip img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.tagged-user-chip button {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 14px;
}

.post-options {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #00FF00;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.share-platforms {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
    margin: 10px 0;
}

.platform-checkbox {
    display: block;
    padding: 8px;
    cursor: pointer;
}

.platform-checkbox input {
    margin-right: 8px;
}

.privacy-select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.post-creator-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
}

.btn-post {
    padding: 12px 24px;
    background: linear-gradient(135deg, #00FF00, #00CC00);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
}

.btn-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 255, 0, 0.4);
}

/* ===== REPLIES MODAL ===== */

.replies-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.replies-container {
    background: white;
    border-radius: 20px;
    width: 95%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.replies-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.replies-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

.replies-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.replies-close:hover {
    color: #ff0000;
    transform: rotate(90deg);
}

.replies-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
}

.no-replies {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-replies-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.reply-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.reply-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.reply-content {
    flex: 1;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.reply-user-name {
    font-size: 14px;
    font-weight: 600;
}

.reply-time {
    font-size: 12px;
    color: #999;
}

.reply-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 5px 0 10px 0;
}

.reply-reactions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.reaction-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reaction-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00FF00;
}

.reaction-btn.active {
    background: rgba(0, 255, 0, 0.2);
    border-color: #00FF00;
}

.reply-actions-bar {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.reply-action-link {
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reply-action-link:hover {
    color: #00FF00;
}

.reply-action-link.delete {
    color: #ff3b30;
}

.nested-replies {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 2px solid #f0f0f0;
}

.nested-reply-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.nested-reply-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.nested-reply-content {
    flex: 1;
    font-size: 13px;
}

.replies-input-section {
    border-top: 1px solid #e0e0e0;
    padding: 15px 25px;
}

.quick-replies {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.quick-reply-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.quick-reply-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-reply-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00FF00;
}

.reply-input-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.reply-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.reply-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
}

.reply-input:focus {
    outline: none;
    border-color: #00FF00;
}

.reply-actions {
    display: flex;
    gap: 8px;
}

.reply-action-btn {
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.reply-action-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00FF00;
}

.reply-send-btn {
    background: linear-gradient(135deg, #00FF00, #00CC00);
    color: white;
    border: none;
    border-radius: 18px;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reply-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
}

/* ===== POPUPS ===== */

.emoji-picker-popup,
.tag-people-popup,
.location-picker-popup,
.sticker-picker-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10003;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.emoji-picker-content,
.tag-people-content,
.location-picker-content,
.sticker-picker-content {
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 25px;
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUpFromBottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin: 15px 0;
}

.emoji-btn {
    width: 45px;
    height: 45px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.emoji-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    transform: scale(1.1);
}

.friends-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 15px 0;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.friend-item:hover {
    background: rgba(0, 255, 0, 0.1);
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.tag-check {
    margin-left: auto;
    color: #00FF00;
    font-size: 18px;
    display: none;
}

.locations-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 15px 0;
}

.location-item {
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.location-item:hover {
    background: rgba(0, 255, 0, 0.1);
}

.sticker-btn-large {
    width: 60px;
    height: 60px;
    background: #f5f5f5;
    border: none;
    border-radius: 10px;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sticker-btn-large:hover {
    background: rgba(0, 255, 0, 0.2);
    transform: scale(1.1);
}

.btn-done,
.btn-close {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #00FF00, #00CC00);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.btn-done:hover,
.btn-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
}

/* ===== NOTIFICATIONS ===== */

.post-notification,
.reply-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10004;
    animation: slideInRight 0.4s ease-out;
    font-weight: 600;
}

.post-notification.success,
.reply-notification.success {
    background: linear-gradient(135deg, #E6FFE6, #CCFFCC);
    border-left: 4px solid #00FF00;
}

.post-notification.info,
.reply-notification.info {
    background: linear-gradient(135deg, #E6F3FF, #CCE6FF);
    border-left: 4px solid #0088FF;
}

.post-notification.fade-out,
.reply-notification.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* ===== ANIMATIONS ===== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideUpFromBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .editor-main {
        flex-direction: column;
    }
    
    .editor-toolbar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .toolbar-section {
        flex-direction: row;
    }
    
    .filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .sticker-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}
