/* Estilos para el frontend del plugin ERM */

.erm-login-container {
    max-width: 450px;
    margin: 60px auto;
    padding: 20px;
}

.erm-login-form {
    background: linear-gradient(135deg, #FFFBEA 0%, #ffffff 100%);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(47, 91, 76, 0.15);
    border: 1px solid rgba(47, 91, 76, 0.2);
}

.erm-login-form h2 {
    margin-top: 0;
    margin-bottom: 30px;
    text-align: center;
    color: #1d2327;
    font-size: 28px;
    font-weight: 600;
}

.erm-frontend-posts-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background: #FFFBEA;
    min-height: calc(100vh - 100px);
}

.erm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 25px 30px;
    background: linear-gradient(135deg, #2f5b4c 0%, #1f3d32 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(47, 91, 76, 0.3);
}

.erm-header h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.erm-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    background: #fff;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.erm-tab {
    padding: 14px 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #646970;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.erm-tab:hover {
    color: #2f5b4c;
    background: rgba(47, 91, 76, 0.1);
}

.erm-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #2f5b4c 0%, #1f3d32 100%);
    box-shadow: 0 2px 8px rgba(47, 91, 76, 0.3);
}

.erm-tab-content {
    margin-top: 30px;
}

.erm-post-form-container {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(47, 91, 76, 0.1);
    border: 1px solid rgba(47, 91, 76, 0.15);
}

.erm-post-form-container h3 {
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 22px;
    color: #2f5b4c;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 2px solid #2f5b4c;
}

.erm-form-group {
    margin-bottom: 20px;
}

.erm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.erm-form-group label .required {
    color: #dc3232;
    margin-left: 3px;
}

.erm-form-group input[type="text"],
.erm-form-group input[type="email"],
.erm-form-group input[type="number"],
.erm-form-group select,
.erm-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #fff;
    color: #1d2327;
}

.erm-form-group input[type="text"]:focus,
.erm-form-group input[type="email"]:focus,
.erm-form-group input[type="number"]:focus,
.erm-form-group select:focus,
.erm-form-group textarea:focus {
    outline: none;
    border-color: #2f5b4c;
    box-shadow: 0 0 0 3px rgba(47, 91, 76, 0.1);
}

.erm-form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

.erm-form-group input[type="checkbox"],
.erm-form-group input[type="radio"] {
    margin-right: 8px;
}

.erm-form-group label input[type="checkbox"],
.erm-form-group label input[type="radio"] {
    width: auto;
}

.erm-form-fields {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.erm-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.erm-btn-primary {
    background: linear-gradient(135deg, #2f5b4c 0%, #1f3d32 100%);
    color: #fff;
}

.erm-btn-primary:hover {
    background: linear-gradient(135deg, #1f3d32 0%, #153025 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 91, 76, 0.4);
}

.erm-btn-secondary {
    background: linear-gradient(135deg, #646970 0%, #50575e 100%);
    color: #fff;
}

.erm-btn-secondary:hover {
    background: linear-gradient(135deg, #50575e 0%, #3c434a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 105, 112, 0.4);
}

.erm-btn-danger {
    background: linear-gradient(135deg, #dc3232 0%, #b52727 100%);
    color: #fff;
}

.erm-btn-danger:hover {
    background: linear-gradient(135deg, #b52727 0%, #8a1f1f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 50, 50, 0.4);
}

.erm-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.erm-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.erm-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.erm-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.erm-posts-list {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(47, 91, 76, 0.1);
    border: 1px solid rgba(47, 91, 76, 0.15);
}

.erm-posts-list h3 {
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 22px;
    color: #2f5b4c;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 2px solid #2f5b4c;
}

.erm-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.erm-post-item {
    background: linear-gradient(135deg, #ffffff 0%, #FFFBEA 100%);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(47, 91, 76, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(47, 91, 76, 0.08);
    position: relative;
    overflow: hidden;
}

.erm-post-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #2f5b4c 0%, #1f3d32 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.erm-post-item:hover {
    box-shadow: 0 6px 20px rgba(47, 91, 76, 0.15);
    transform: translateY(-3px);
    border-color: #2f5b4c;
}

.erm-post-item:hover::before {
    transform: scaleY(1);
}

.erm-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e5e9;
}

.erm-post-header h4 {
    margin: 0;
    flex: 1;
    margin-right: 15px;
    font-size: 18px;
    color: #1d2327;
    font-weight: 600;
    line-height: 1.4;
}

.erm-post-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.erm-post-content {
    margin-bottom: 18px;
    color: #50575e;
    line-height: 1.7;
    font-size: 14px;
}

.erm-post-custom-fields {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.erm-post-custom-fields ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.erm-post-custom-fields li {
    margin-bottom: 5px;
    font-size: 14px;
}

.erm-post-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    color: #999;
}

/* Modal de edición */
.erm-edit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    overflow-y: auto;
}

.erm-edit-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.erm-edit-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.erm-edit-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.erm-edit-modal-close:hover {
    color: #000;
}

/* Galería de imágenes */
.erm-gallery-container {
    margin-top: 10px;
}

.erm-gallery-preview {
    margin-bottom: 15px;
    min-height: 100px;
}

.erm-no-images {
    padding: 30px;
    text-align: center;
    color: #666;
    background: rgba(255, 251, 234, 0.5);
    border: 2px dashed rgba(47, 91, 76, 0.3);
    border-radius: 8px;
}

.erm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.erm-gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.erm-gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.erm-gallery-item.featured {
    border-color: #2f5b4c;
    box-shadow: 0 0 0 2px #2f5b4c;
}

.erm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.erm-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.erm-gallery-item:hover .erm-gallery-overlay {
    opacity: 1;
}

.erm-gallery-overlay button {
    background: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    color: #333;
}

.erm-gallery-overlay button:hover {
    background: #2f5b4c;
    color: #fff;
    transform: scale(1.05);
}

.erm-gallery-overlay .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.erm-featured-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #2f5b4c 0%, #1f3d32 100%);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(47, 91, 76, 0.3);
    z-index: 10;
}

.erm-add-gallery-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.erm-add-gallery-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.erm-gallery-container .description {
    margin-top: 10px;
    color: #646970;
    font-size: 13px;
    font-style: italic;
}

/* Imagen destacada (legacy) */
.erm-featured-image-upload {
    margin-top: 10px;
}

.erm-image-preview {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
    max-width: 300px;
}

.erm-image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.erm-remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #dc3232;
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.erm-remove-image:hover {
    background: #b52727;
    transform: scale(1.1);
}

.erm-upload-image-btn,
.erm-select-image-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.erm-upload-image-btn .dashicons,
.erm-select-image-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.erm-post-featured-image {
    margin: 15px 0;
}

.erm-post-featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Responsive */
@media (max-width: 768px) {
    .erm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .erm-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .erm-post-header {
        flex-direction: column;
    }
    
    .erm-post-actions {
        margin-top: 10px;
    }
    
    .erm-image-preview {
        max-width: 100%;
    }
}

