/**
 * CREATE POST MODAL - Estilos Mejorados
 * Versión: 2.0.0
 * Fecha: 16 de Marzo 2026
 * Diseño moderno y atractivo para crear publicaciones
 */

/* ========================================
   MODAL PRINCIPAL
   ======================================== */

.create-post-modal {
    max-width: 600px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   HEADER CON GRADIENTE
   ======================================== */

.create-post-header {
    background: linear-gradient(135deg, #FF6B35 0%, #FF3CAC 50%, #784BA0 100%);
    color: white;
    padding: 24px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(255, 60, 172, 0.3);
    position: relative;
    overflow: hidden;
}

.create-post-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.create-post-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.create-post-icon-wrapper {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

.create-post-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.create-post-subtitle {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
}

.create-post-close {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.create-post-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ========================================
   SECCIÓN DE USUARIO
   ======================================== */

.create-post-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
}

.create-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #FF6B35, #FF3CAC, #784BA0) border-box;
    box-shadow: 0 4px 12px rgba(255, 60, 172, 0.2);
}

.create-post-user-info {
    flex: 1;
}

.create-post-username {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.create-post-privacy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.create-post-privacy:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========================================
   ÁREA DE TEXTO
   ======================================== */

.create-post-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.create-post-textarea-wrapper {
    padding: 24px;
    position: relative;
}

.create-post-textarea-wrapper textarea {
    width: 100%;
    min-height: 150px;
    background: transparent;
    border: none;
    resize: vertical;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.create-post-textarea-wrapper textarea::placeholder {
    color: var(--text-dim);
    font-size: 18px;
}

.create-post-textarea-wrapper textarea:focus {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
}

.create-post-char-count {
    position: absolute;
    bottom: 28px;
    right: 28px;
    font-size: 12px;
    color: var(--text-dim);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.create-post-textarea-wrapper textarea:focus + .create-post-char-count {
    opacity: 1;
}

/* ========================================
   PREVIEW DE MEDIA
   ======================================== */

.create-post-media-preview {
    padding: 0 24px 16px;
}

.media-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.media-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.media-preview-remove:hover {
    background: #FF3B30;
    transform: scale(1.1);
}

/* ========================================
   OPCIONES DE POST (GRID MEJORADO)
   ======================================== */

.create-post-options-card {
    margin: 16px 24px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05), rgba(255, 60, 172, 0.05), rgba(120, 75, 160, 0.05));
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 20px;
}

.create-post-options-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.create-post-options-title i {
    color: #FFB800;
}

.create-post-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.create-post-option {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.create-post-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
}

.create-post-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.create-post-option:hover::before {
    opacity: 1;
}

.create-post-option:active {
    transform: translateY(-2px);
}

.option-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
}

/* Colores específicos por tipo */
.option-icon-wrapper.photo {
    background: linear-gradient(135deg, #FF6B35, #FF8A65);
    color: white;
}

.option-icon-wrapper.video {
    background: linear-gradient(135deg, #FF3CAC, #FF5AC4);
    color: white;
}

.option-icon-wrapper.emoji {
    background: linear-gradient(135deg, #FFB800, #FFC952);
    color: white;
}

.option-icon-wrapper.gif {
    background: linear-gradient(135deg, #784BA0, #9575CD);
    color: white;
}

.option-icon-wrapper.poll {
    background: linear-gradient(135deg, #00D9FF, #33E3FF);
    color: white;
}

.option-icon-wrapper.location {
    background: linear-gradient(135deg, #00E676, #69F0AE);
    color: white;
}

.option-icon-wrapper.tag {
    background: linear-gradient(135deg, #1DA1F2, #42B4FF);
    color: white;
}

.option-icon-wrapper.music {
    background: linear-gradient(135deg, #E91E63, #F06292);
    color: white;
}

.create-post-option:hover .option-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

.create-post-option span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

/* ========================================
   FOOTER
   ======================================== */

.create-post-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-secondary);
}

.create-post-footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.create-post-emoji-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.create-post-emoji-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.1);
}

.create-post-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
}

.create-post-tip i {
    color: #FFB800;
}

/* ========================================
   BOTÓN PUBLICAR (MEJORADO)
   ======================================== */

.btn-publish {
    background: linear-gradient(135deg, #FF6B35, #FF3CAC);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(255, 60, 172, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-publish::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-publish:hover::before {
    width: 300px;
    height: 300px;
}

.btn-publish:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 60, 172, 0.4);
}

.btn-publish:active {
    transform: translateY(0);
}

.btn-publish:disabled {
    background: var(--bg-tertiary);
    color: var(--text-dim);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-publish:disabled::before {
    display: none;
}

.btn-publish-icon {
    font-size: 18px;
    position: relative;
    z-index: 1;
}

.btn-publish-text {
    position: relative;
    z-index: 1;
}

/* Animación de envío */
@keyframes sendAnimation {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(50px, -50px);
        opacity: 0;
    }
}

.btn-publish.sending .btn-publish-icon {
    animation: sendAnimation 0.6s ease-out;
}

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

@media (max-width: 768px) {
    .create-post-modal {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .create-post-header {
        border-radius: 0;
        padding: 20px 16px;
    }

    .create-post-icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .create-post-header h3 {
        font-size: 18px;
    }

    .create-post-subtitle {
        font-size: 12px;
    }

    .create-post-user {
        padding: 16px;
    }

    .create-post-textarea-wrapper {
        padding: 16px;
    }

    .create-post-textarea-wrapper textarea {
        font-size: 16px;
    }

    .create-post-options-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .create-post-option {
        padding: 12px 8px;
    }

    .option-icon-wrapper {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .create-post-option span {
        font-size: 10px;
    }

    .create-post-footer {
        padding: 16px;
    }

    .create-post-tip {
        display: none;
    }

    .btn-publish {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .create-post-options-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   ESTADOS Y ANIMACIONES
   ======================================== */

/* Estado de carga */
.create-post-modal.loading {
    pointer-events: none;
    opacity: 0.7;
}

.create-post-modal.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 4px solid rgba(255, 60, 172, 0.3);
    border-top-color: #FF3CAC;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Estado de éxito */
.create-post-modal.success .create-post-header {
    background: linear-gradient(135deg, #00E676, #69F0AE);
}

.create-post-modal.success .btn-publish {
    background: linear-gradient(135deg, #00E676, #69F0AE);
}

/* Animación de entrada de opciones */
.create-post-option {
    animation: optionFadeIn 0.4s ease-out backwards;
}

.create-post-option:nth-child(1) { animation-delay: 0.05s; }
.create-post-option:nth-child(2) { animation-delay: 0.1s; }
.create-post-option:nth-child(3) { animation-delay: 0.15s; }
.create-post-option:nth-child(4) { animation-delay: 0.2s; }
.create-post-option:nth-child(5) { animation-delay: 0.25s; }
.create-post-option:nth-child(6) { animation-delay: 0.3s; }
.create-post-option:nth-child(7) { animation-delay: 0.35s; }
.create-post-option:nth-child(8) { animation-delay: 0.4s; }

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

/* ========================================
   ACCESIBILIDAD
   ======================================== */

.create-post-option:focus,
.btn-publish:focus,
.create-post-close:focus {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .create-post-modal,
    .create-post-option,
    .btn-publish,
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ========================================
   NOTIFICACIONES
   ======================================== */

.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification i {
    font-size: 20px;
    flex-shrink: 0;
}

.notification span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Tipos de notificación */
.notification-success {
    border-left: 4px solid #00E676;
}

.notification-success i {
    color: #00E676;
}

.notification-warning {
    border-left: 4px solid #FFB800;
}

.notification-warning i {
    color: #FFB800;
}

.notification-error {
    border-left: 4px solid #FF3B30;
}

.notification-error i {
    color: #FF3B30;
}

.notification-info {
    border-left: 4px solid #00D9FF;
}

.notification-info i {
    color: #00D9FF;
}

@media (max-width: 768px) {
    .notification-container {
        top: 70px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        min-width: auto;
        max-width: none;
    }
}

